mirror of https://github.com/AlphaNecron/Void.git
feat(twilight): added bot avatar to log messages
This commit is contained in:
parent
833d231cbd
commit
d4d69bf6ae
|
@ -4,14 +4,21 @@ import { name, version } from '../../package.json';
|
|||
|
||||
export class Logger {
|
||||
channel: TextChannel;
|
||||
client: Client;
|
||||
|
||||
constructor(client: Client) {
|
||||
if (!config.bot.log_channel) return;
|
||||
this.client = client;
|
||||
this.channel = client.channels.cache.find(c => c.type === 'text' && c.id === config.bot.log_channel) as TextChannel;
|
||||
}
|
||||
|
||||
log(msg: MessageEmbed | string) {
|
||||
if (!this.channel) return;
|
||||
this.channel.send(typeof msg === 'string' ? new MessageEmbed().setTitle(msg).setColor('#B794F4').setTimestamp().setFooter(`${name}@${version}`) : msg);
|
||||
this.channel.send(typeof msg === 'string' ? new MessageEmbed()
|
||||
.setTitle(msg)
|
||||
.setColor('#B794F4')
|
||||
.setTimestamp()
|
||||
.setFooter(`${name}@${version}`, this.client.user.displayAvatarURL())
|
||||
.setThumbnail(this.client.user.displayAvatarURL()) : msg);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue