fedimbed: guhhh
This commit is contained in:
		
							parent
							
								
									bbc183e179
								
							
						
					
					
						commit
						8ae634fc78
					
				
					 1 changed files with 3 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -1614,10 +1614,11 @@ events.add("messageCreate", "fedimbed", async function (msg) {
 | 
			
		|||
  if (!msg.content || msg.content == "") return;
 | 
			
		||||
 | 
			
		||||
  if (URLS_REGEX.test(msg.content)) {
 | 
			
		||||
    if (!msg.member) {
 | 
			
		||||
    const valid = !msg.webhookID && msg.author != null;
 | 
			
		||||
    if (valid && !msg.member) {
 | 
			
		||||
      msg.member = await msg.channel.guild.getRESTMember(msg.author.id);
 | 
			
		||||
    }
 | 
			
		||||
    if (!msg.member?.permissions?.has?.("embedLinks")) return;
 | 
			
		||||
    if (valid && !msg.member.permissions.has("embedLinks")) return;
 | 
			
		||||
 | 
			
		||||
    const urls = msg.content.match(URLS_REGEX);
 | 
			
		||||
    for (let url of urls) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue