Ver Fonte

Add check for DM prevention

ghorsington há 5 anos atrás
pai
commit
31a87e7bd1
1 ficheiros alterados com 3 adições e 0 exclusões
  1. 3 0
      bot/src/util.ts

+ 3 - 0
bot/src/util.ts

@@ -25,6 +25,9 @@ export function isValidImage(fileName: string) {
 }
 
 export async function isAuthorisedAsync(member : GuildMember) {
+    if(!member)
+        return false;
+        
     let repo = getRepository(KnownUser);
 
     let user = await repo.findOne({