Advertisement
DeveloperADMIN

Show Errors Project

Apr 9th, 2023
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const client = new Discord.Client();
  3. const channelId = 'الاي دي';
  4. //حط اي دي الاتشانل
  5.  
  6. client.on('ready', () => {
  7. console.log(`Logged in as ${client.user.tag}`);
  8. });
  9.  
  10. client.on('error', (error) => {
  11. console.error('Discord client error:', error);
  12. const channel = client.channels.cache.get(channelId);
  13. if (channel) {
  14. channel.send(`An error occurred: \`${error}\``);
  15. }
  16. });
  17.  
  18. client.login(process.env.token)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement