Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- discord.on('MESSAGE_CREATE', async (Message) => {
- let self = await discord.getBotUser();
- let err = await Error();
- let logChannel = await discord.getTextChannel('xxxxxxxxxxxxxxxxx');
- console.log(err.message);
- let embed = new discord.Embed({
- title: 'Pylon Error Handler',
- description: 'An error has been triggered.',
- color: 7441133,
- })
- .setFields([
- {
- name: 'Error Message',
- value: ['```ts', err.message, '```'].join('\n'),
- inline: false,
- },
- {
- name: 'Error Stack',
- value: ['```ts', err.stack, '```'].join('\n'),
- inline: false,
- }, ])
- .setThumbnail({ url: self.getAvatarUrl() })
- .setFooter({
- text: 'Powered by ' + self.username,
- iconUrl: self.getAvatarUrl(),
- });
- await logChannel?.sendMessage(embed);
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement