1
0
mirror of https://github.com/toast-ts/Daggerbot-TS.git synced 2024-11-17 16:30:58 -05:00
Daggerbot-TS/src/helpers/MessageTool.ts
2023-09-06 11:19:02 +10:00

24 lines
1.0 KiB
TypeScript

import Discord from 'discord.js';
export default class MessageTool {
static embedMusic(color:Discord.ColorResolvable, title:string, thumbnail?:string, footer?:string){
const embed = new Discord.EmbedBuilder().setColor(color).setTitle(title);
if (thumbnail) embed.setThumbnail(thumbnail);
if (footer) embed.setFooter({text: footer});
return embed
}
static embedStruct(color:Discord.ColorResolvable, title:string, description?:string|null, image?:string|null){
const embed = new Discord.EmbedBuilder().setColor(color).setTitle(title);
if (description) embed.setDescription(description);
if (image) embed.setImage(image);
return embed
}
static concatMessage(...messages:string[]){
return messages.join('\n')
}
static formatMention(mention:string, type:'user'|'channel'|'role'){
return `<@${type === 'role' ? '&' : type === 'channel' ? '#' : ''}${mention}>`
}
}
// I want to come up with better name instead of calling this file "MessageTool", but I am super bad at naming things.