discord.js

My Discord.js bot is running (online and shows in console) but it won't respond to commands

佐手、 提交于 2020-02-29 08:02:30
问题 So, one day I was using TeamViewer to connect to my RPi3 and told it to reboot. As soon as it finished, I connected to the pi, started the bot, and it looked like it was starting up properly. When I went to send a command on discord, the bot didn't respond. The bot is still running though. I tried changing some of the code, but nothing changed. Here's the code: // Load up the discord.js library const Discord = require("discord.js"); // This is your client. Some people call it `bot`, some

How to properly do a createReactionCollection

↘锁芯ラ 提交于 2020-02-29 06:55:29
问题 I've been wanting to create an event when a user presses a reaction that is a Check or X. Although, when I use the function I get an error that it doesn't exist for the message object. I've already from awaitReactions back to this and it hasn't worked. EDIT: I did a console.log to the messageSent object and I got this Promise { <pending> } var messageSent = user.send({embed}) .then(function (message) { message.react('✅') message.react('❎') }); messageSent.createReactionCollection(r => ['✅','❎

How to properly do a createReactionCollection

依然范特西╮ 提交于 2020-02-29 06:54:06
问题 I've been wanting to create an event when a user presses a reaction that is a Check or X. Although, when I use the function I get an error that it doesn't exist for the message object. I've already from awaitReactions back to this and it hasn't worked. EDIT: I did a console.log to the messageSent object and I got this Promise { <pending> } var messageSent = user.send({embed}) .then(function (message) { message.react('✅') message.react('❎') }); messageSent.createReactionCollection(r => ['✅','❎

Fetch more than 100 messages

倾然丶 夕夏残阳落幕 提交于 2020-02-24 12:57:31
问题 I'm trying to figure out a way to use loops to get old messages on discord using fetchMesasges() and before . I'd like to get more than the 100 limit using a loop but I cannot figure it out, and every post I can find only discuss how to use loops to DELETE more than the 100 limit, I just need to retrieve them. I'm new to coding and javascript in particular so I'm hoping someone can give me a nudge in the right direction. Here is the only way I could manage to retrieve messages that are

Fetch more than 100 messages

随声附和 提交于 2020-02-24 12:52:44
问题 I'm trying to figure out a way to use loops to get old messages on discord using fetchMesasges() and before . I'd like to get more than the 100 limit using a loop but I cannot figure it out, and every post I can find only discuss how to use loops to DELETE more than the 100 limit, I just need to retrieve them. I'm new to coding and javascript in particular so I'm hoping someone can give me a nudge in the right direction. Here is the only way I could manage to retrieve messages that are

Progress Bar for Leveling System

蹲街弑〆低调 提交于 2020-02-23 07:39:06
问题 So this is kind of 2 questions in one, but basically I'm making a ranking/leveling system for my Discord bot (Discord.js) and I'm having problems with a progress bar for the next level. Here's what I've got so far: const x = "□"; let progressBarArr = [x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x,x]; let currentLevel = Math.ceil(result.allocatedExp/1000)*1000; if (currentLevel < 1000) currentLevel = 1000; let progressBar = "["+progressBarArr.fill("=", Math.ceil(result

How can i add these values to array?

断了今生、忘了曾经 提交于 2020-02-23 07:14:48
问题 I am having trouble while adding these array 637301291068030997 => { guildMemberCount: 4, guildOwnerID: '348832732647784460', guildOwner: 'Ethical Hacker', prefix: '.', guildID: '637301291068030997', guildName: 'test server 3', welcomeChannelID: '-' }, (some number) => {other array} in the above array i am receiving 637301291068030997 number in doc.id variable and rest is getting in doc.data() my code is something like this var temp = {} temp.guilds = [] // after some lines snapshot.forEach

How can i add these values to array?

泪湿孤枕 提交于 2020-02-23 07:14:11
问题 I am having trouble while adding these array 637301291068030997 => { guildMemberCount: 4, guildOwnerID: '348832732647784460', guildOwner: 'Ethical Hacker', prefix: '.', guildID: '637301291068030997', guildName: 'test server 3', welcomeChannelID: '-' }, (some number) => {other array} in the above array i am receiving 637301291068030997 number in doc.id variable and rest is getting in doc.data() my code is something like this var temp = {} temp.guilds = [] // after some lines snapshot.forEach

How can i add these values to array?

非 Y 不嫁゛ 提交于 2020-02-23 07:14:03
问题 I am having trouble while adding these array 637301291068030997 => { guildMemberCount: 4, guildOwnerID: '348832732647784460', guildOwner: 'Ethical Hacker', prefix: '.', guildID: '637301291068030997', guildName: 'test server 3', welcomeChannelID: '-' }, (some number) => {other array} in the above array i am receiving 637301291068030997 number in doc.id variable and rest is getting in doc.data() my code is something like this var temp = {} temp.guilds = [] // after some lines snapshot.forEach

.drawImage function is throwing a “TypeError: Image or Canvas expected”, for canvas

被刻印的时光 ゝ 提交于 2020-01-30 07:44:04
问题 I am trying to add a rank card in my discord bot, and in order to do so I am trying to use canvas but when I use canvas everything works fine until I hit the .drawImage method. Where it gives me an error saying "TypeError: Image or Canvas expected". Although I've already require('canvas') globally, and everything else that has to do with canvas works properly as well. I've tried to require('canvas') inside the function but that doesn't fix the problem either. const canvas = Canvas