Discord bots help you interact with members of a server as well as moderate the server. A discord bot can send messages on the server, message a us...
For further actions, you may consider blocking this person and/or reporting abuse
I'm working on this piece of code for an upcoming test. This is also a useful source of knowledge for me. Fall guys will have you spinning in colorful chaotic battles. Where many players participate in fun combat and defeat the rest to win
Hi, I'm pretty new to coding and I am stuck. When attempting to run the app for the first time, I get.
TypeError: Cannot read properties of undefined (reading 'FLAGS')
Thanks for any help.
Hello, if you're still having issues with this, here is the updated code for intents:
For the
MessageContent
intent, you'd have to give your bot that permission in the developers dashboard.Oh yeah, that's probably because there have been updates to the discord library making some methods or properties in this article outdated.
So try going to the docs and check for any updates.
I'll try and update the article soon
Very well written! Thanks for this great article. A few notes, though:
This isn't true. Intents allow you to subscribe to only the events you want to receive from the discord API to decrease memory usage. Also, why did you include the typing and reaction intents? It didn't seem like those were used in the guide code (and would in fact inflate memory usage unneededly).
Especially since you're assuming the prefix is at the beginning when you slice it off of the message, you should probably use
startsWith
, notincludes
. For example, this would currently pass the "it's a command" check:sad is what I am!
Oh thanks for this. I never really understood the intents yet. Will check more on it and make the changes.
Also the intents I stated were originally to be used, but the article had grown to large already.
And thanks for the correction on the prefix. I checked the message properties, but that of content doesn't seem to have any prop (from the docs). Or is it
msg.startsWith
?, because i still can't find that.Update: I just verified the
startsWith
method on VSCode, but I still can't find it in the docs though. It's like it's hidden or somethingmessage.content
is a string. You can use any string method on it. It wouldn't be listed on discord.js docsdeveloper.mozilla.org/en-US/docs/W...
oh wow! I didn't know about this method before. Thanks for sharing
Just like to stress that "YouTube fetchers" as I believe the author phrases it, are against YouTube's API terms of service and risk being sent a Cease and Desist letter (as happened in the cases of Groovy and Rythm).
Ok let me explain what I mean by YouTube fetchers.
You can actually fetch new videos from a channel as the videos are uploaded. And it usually comes as a link to the video on youtube.
It could also be in an analytical sense, as a channel owner i can connect with the youtube api to see my analytics in the bot.
I really don't know about groovy so well, but from what I have read, I mean nothing like that in that statement.
Thanks for this, got me up and running nicely.
One tweak:
// export startBot as default
module.export = startBot;
to
// export startBot as default
module.exports = startBot;
Thanks for the correction.
I get some errors from node modules files showing the use of "??=" in the place of "=",
Is any one facing the same?
can you describe the issue on github, try pasting the error and how we can reproduce the error.
This is the repo
Done
Not all the time though.
I believe it depends on the purpose of the bot really.
There are some boys that are dedicated to lofi music which is great for coding in my opinion.
Don't get your comment
Great job. Thanks for sharing. Very well written
Glad you liked it