discordjs

Solutions on MaxInterview for discordjs by the best coders in the world

showing results for - "discordjs"
Juliana
26 Aug 2019
1const Discord = require('discord.js');
2const client = new Discord.Client();
3
4client.on('ready', () => {
5    console.log(`Logged in as ${client.user.tag}.`);
6});
7
8client.on('message', message => {
9    if (message.content.toLowerCase() === 'ping') {
10        message.channel.send('Pong');
11    }
12});
13
14client.login('TOKEN');
Maximilien
13 Apr 2020
1const Canvas = require("discord-canvas"),  Discord = require("discord.js"); const image = await new Canvas.RankCard()    .setAvatar("xixi52")    .setXP("current"500)    .setXP("needed"1000)    .setLevel(7)    .setRank(2)    .setReputation(450)    .setRankName("professional")    .setUsername("xixi52")    .setBadge(1"gold")    .setBadge(3"diamond")    .setBadge(5"silver")    .setBadge(6"bronze")    .setBackground("https://www.site.com/background.jpg")    .toAttachment(); const attachment = new Discord.MessageAttachment(image.toBuffer(), "rank-card.png"); message.channel.send(attachment);
María Fernanda
26 Jul 2019
1const Discord = require('discord.js');
2const client = new Discord.Client();
3
4client.on('ready', () => {
5  console.log(`Logged in as ${client.user.tag}!`);
6});
7
8client.on('message', msg => {
9  if (msg.content === 'ping') {
10    msg.reply('Pong!');
11  }
12});
13
14client.login('token');