mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 00:10:58 -05:00
Attempt to fix annoying automod error
This commit is contained in:
parent
d41268d498
commit
960091792e
@ -11,7 +11,7 @@ export default class MessageTool {
|
||||
}
|
||||
public static concatMessage =(...messages:string[])=>messages.join('\n');
|
||||
public static formatMention =(mention:string, type:'user'|'channel'|'role')=>`<${type === 'role' ? '@&' : type === 'channel' ? '#' : '@'}${mention}>`;
|
||||
public static isStaff =(guildMember:Discord.GuildMember)=>config.dcServer.staffRoles.map((x:string)=>config.dcServer.roles[x]).some((x:string)=>guildMember.roles.cache.has(x));
|
||||
public static isStaff =(guildMember:Discord.GuildMember)=>config.dcServer.staffRoles.map((x:string)=>config.dcServer.roles[x]).some((x:string)=>guildMember.roles?.cache?.has(x));
|
||||
public static youNeedRole =(interaction:Discord.CommandInteraction, role:keyof typeof config.dcServer.roles)=>interaction.reply(`You do not have ${this.formatMention(config.dcServer.roles[role], 'role')} role to use this command.`);
|
||||
public static isModerator =(guildMember:Discord.GuildMember)=>config.dcServer.staffRoles.filter((x:string)=>/^admin|^dcmod/.test(x)).map((x:string)=>config.dcServer.roles[x]).some((x:string)=>guildMember.roles.cache.has(x));
|
||||
public static isWhitelisted =(interaction:Discord.CommandInteraction)=>interaction.reply('You are not on whitelist!')
|
||||
|
Loading…
Reference in New Issue
Block a user