Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const Discord = require('discord.js');
- const bot = new Discord.Client();
- const { token, prefix } = require('./botconfig.json');
- bot.on('ready', () => {
- console.log('Bot is online!');
- bot.user.setActivity('Quack', { type: "PLAYING" })
- .then(presence => console.log(`Activity set to ${presence.activities[0].name}`))
- .catch(console.error);
- })
- bot.on("message", message => {
- if (message.author.bot) return
- const args = message.content.slice(prefix.length).trim().split(/ +/g);
- const command = args.shift().toLowerCase();
- if (command === 'ping') {
- message.channel.send('Pinging...').then(sent => {
- sent.edit(`Pong! \n**MS:** ${sent.createdTimestamp - message.createdTimestamp}ms`);
- });
- }
- bot.login(token);
Advertisement
Add Comment
Please, Sign In to add comment