-
Notifications
You must be signed in to change notification settings - Fork 1
/
playerException.js
43 lines (42 loc) · 1.27 KB
/
playerException.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/** @format
*
* GPT 4o By mahaaranii
* Version: 6.0.0-beta
* © 2024 NextGen Coders
*/
module.exports = {
name: "playerException",
run: async (client, player, error) => {
const guild = client.guilds.cache.get(player.guildId);
if (!guild) return;
let channel = await client.channels.cache.get(player.textId);
await channel
?.send({
embeds: [
new client.embed().desc(
`${client.emoji.warn} **Unknown exception occured! Please use \`${client.prefix}report\` **\n` +
`Join [support](${client.support}) for more information\n` +
`\`\`\`js\n${error.exception.message}\n\`\`\``,
),
],
})
.catch(() => {});
await client.webhooks.error
.send({
username: client.user.username,
avatarURL: client.user.displayAvatarURL(),
embeds: [
new client.embed()
.desc(
`**Player Exception** in [ ${client.guilds.cache.get(
player.guildId,
)} ]\n` + `\`\`\`js\n${error.exception.message}\n\`\`\``,
)
.setColor("#fa7f2d"),
],
})
.catch(() => {});
await client.sleep(1500);
await client.getPlayer(player?.guildId).then((player) => player?.destroy());
},
};