Advertisement
Guest User

Untitled

a guest
Aug 23rd, 2019
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.03 KB | None | 0 0
  1. const { Client, RichEmbed } = require("discord.js");
  2. const { config } = require("dotenv");
  3.  
  4. const client = new Client({
  5. disableEveryone: true
  6. })
  7.  
  8. config({
  9. path: __dirname + "/.env"
  10. })
  11.  
  12. client.on("ready", () => {
  13. console.log(`Hi, ${client.user.username} is now online!`);
  14.  
  15. client.user.setPresence({
  16. status: "dnd",
  17. game: {
  18. name: "デート・ア・ライブ",
  19. type: "WATCHING"
  20. }
  21. });
  22. })
  23.  
  24. client.on("message", async message => {
  25. const prefix = "$";
  26.  
  27. // If the author's a bot, return
  28. // If the message was not sent in a server, return
  29. // If the message doesn't start with the prefix, return
  30. if (message.author.bot) return;
  31. if (!message.guild) return;
  32. if (!message.content.startsWith(prefix)) return;
  33.  
  34. // Arguments and command variable
  35. // cmd is the first word in the message, aka the command
  36. // args is an array of words after the command
  37. // !say hello I am a bot
  38. // cmd == say (because the prefix is sliced off)
  39. // args == ["hello", "I", "am", "a", "bot"]
  40. const args = message.content.slice(prefix.length).trim().split(/ +/g);
  41. const cmd = args.shift().toLowerCase();
  42.  
  43. if (cmd === "ping") {
  44. // Send a message
  45. const msg = await message.channel.send(`🏓 Pinging....`);
  46.  
  47. // Edit the message
  48. msg.edit(`🏓 Pong!\nLatency is ${Math.floor(msg.createdAt - message.createdAt)}ms\nAPI Latency is ${Math.round(client.ping)}ms`);
  49. }
  50.  
  51. if (cmd === "say") {
  52. // Check if you can delete the message
  53. if (message.deletable) message.delete();
  54.  
  55. if (args.length < 0) return message.reply(`Nothing to say?`).then(m => m.delete(5000));
  56.  
  57. // Role color
  58. const roleColor = message.guild.me.highestRole.hexColor;
  59.  
  60. // If the first argument is embed, send an embed,
  61. // otherwise, send a normal message
  62. if (args[0].toLowerCase() === "embed") {
  63. const embed = new RichEmbed()
  64. .setDescription(args.slice(1).join(" "))
  65. .setColor(roleColor === "#000000" ? "#ffffff" : roleColorv)
  66. .setTimestamp()
  67. .setImage(client.user.displayAvatarURL)
  68. .setAuthor(message.author.username, message.author.displayAvatarURL);
  69.  
  70. message.channel.send(embed);
  71. } else {
  72. message.channel.send(args.join(" "));
  73. }
  74. }
  75. });
  76.  
  77. client.on('message',message=>{
  78. if (message.content === "Where is Tohka?"){
  79. message.reply('Hello my dear <3');
  80. }
  81.  
  82. })
  83.  
  84. client.on('message',message=>{
  85. if (message.content === "Hey Tohka!" & message.author.bot)
  86. message.channel.send('Hey Lilli whats up?');
  87. if (message.content === "Not much, what about you?" & message.author.bot){
  88. message.channel.send('Watching Date A Live with <@271279004336521227>, btw I wanted to ask you something. In what language were you made and who made you?');
  89. }
  90.  
  91. })
  92.  
  93. client.login(process.env.TOKEN);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement