Ryyan

Code for discord bot.

May 21st, 2019
4,501
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.97 KB | None | 0 0
  1. const Discord = require('discord.js');
  2. const bot = new Discord.Client();
  3.  
  4. const token = 'NTgwMjUxMTk4ODcxODMwNTM4.XON_Gg.JOuiUkBfuVJdC1i1j2liIy6aKEg';
  5.  
  6. const PREFIX = '!!';
  7.  
  8. var version = '1.0.9';
  9.  
  10.  
  11. bot.on('ready', () => {
  12. console.log('Ryyan just got updated.');
  13. bot.user.setActivity('slow jazz', {
  14. type: 'LISTENING'
  15. }).catch(console.error);
  16.  
  17.  
  18. })
  19.  
  20. bot.on('guildMemberAdd', member => {
  21. const channel = member.guild.channels.find(channel => channel.name === "welcome");
  22. if (!channel) return;
  23.  
  24. channel.send(`Welcome to our server, ${member}, please read the rules in the rules channel!`)
  25. });
  26.  
  27.  
  28.  
  29.  
  30.  
  31. bot.on('message', message => {
  32.  
  33. let args = message.content.substring(PREFIX.length).split(" ");
  34.  
  35. switch (args[0]) {
  36. case 'ping':
  37. message.reply('pong!');
  38. break;
  39. case 'hello':
  40. message.reply('Hello there!');
  41. break;
  42. }
  43. });
  44.  
  45. bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment