mirror of
https://github.com/toast-ts/Daggerbot-TS.git
synced 2024-11-17 20:30:58 -05:00
Attempt to fix annoying automod error
This commit is contained in:
parent
17a44acd7d
commit
ffd86fe236
@ -11,7 +11,7 @@ export default class MessageTool {
|
|||||||
}
|
}
|
||||||
public static concatMessage =(...messages:string[])=>messages.join('\n');
|
public static concatMessage =(...messages:string[])=>messages.join('\n');
|
||||||
public static formatMention =(mention:string, type:'user'|'channel'|'role')=>`<${type === 'role' ? '@&' : type === 'channel' ? '#' : '@'}${mention}>`;
|
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 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 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!')
|
public static isWhitelisted =(interaction:Discord.CommandInteraction)=>interaction.reply('You are not on whitelist!')
|
||||||
|
Loading…
Reference in New Issue
Block a user