I am using discord.js and I have a code where if someone votes for my bot on https://top.gg the bot will send a message, but it got this error Here is my code: Please help me that would be very appreciated Answer Heroku changes the Port that runs Node Application from time to time. Try changing your webhook port to
Tag: discord
Can you declare your own function in Discord JS?
Normally I just add to the command files or the index file easily but it’s starting to look messy. Recently I got this leveling system working I would like to be able to put this into its own function and then call it in the “message” section for every time someone sends a message. Is that possible to do? Or
How to respond with embeds
Currently I am trying to work on my bot and update its responses. Right now I am trying to use the code below to make it respond with the random embeds I made. For some reason when doing using this code the bot either responds with “NaN” or “3”? Answer The purpose of: Is to generate a pseudo-random integer between
Small discord.js Avatar image
Avatar issue example I am trying to do the discord.js avatar command and it works. It sends the image it needs to send but the issue is that the image sent is small compared to other bots. Am using the command handler in the discord.js guide Answer You can add a size option like how you did with you format
Is there a way to add tooltip to text in a Discord bot message?
It’s the first time I’m writing a Discord bot, decided to go with the Discord.js module. One of my goals involved adding tooltips to certain words in a sentence so that the user can mouseover the word and get additional information. The only idea I had after searching for an hour was using an embed message and using markdown to
Discord.js restart command is not working (returns undefined error)
I am making a bot with discord.js and my restart command is not working. By not working I mean, I get this error: My code is: If you can, please help Answer Try this: .then() takes a function as argument, so you have to wrap the actions into a function.
How do I make sure that the person has a certain item from the shop?
I’ve had this problem for hours where I can’t make sure that people have bought a pet before doing activities with it. It doesn’t show an error but it doesn’t work properly and I don’t know how to reference a certain item in a player’s inventory because I’m trying to implement a pet feature where you can fight pets with
Is there a difference between GuildMemberManager.resolve() and Guild.member() in discord.js?
Guild.member() returns the GuildMember form of a User object, if the user is present in the guild. It takes a UserResolvable as a parameter (user ID or object). GuildMemberManager resolves a GuildMemberResolvable to a GuildMember object. What confused me is that a GuildMemberResolvable can be either a GuildMember object or a UserResolvable. First of all, why would anybody need to
How do I insert emojis into a nickname in discord.js?
Every time I try to do that, the emoji just changes into a question mark. Here’s my code: Answer Your message variable in the above code is inconsistent. You used ‘msg’ to catch the return value but used ‘message’ to react. Keep it consistent, otherwise, you might face errors. Also, a bot cannot change the nickname of the owner of
Discord.JS How to wait for member reaction
I am making bot to manage my multiple Discord guilds. And I’d like to make confirmation system, like: User does X thing, Bot sends message in sufficient channel, Bot waits for user to react with :thumbdsup: or :thumbsdown: up to 60 seconds If thumbs up, do A, else – do B. If time is up, do C action How can