Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

1
Help with Discord Bot -- New to making bots
Post Flair (click to view more posts with a particular flair)
Post Body

Hey friends. So, I'm a bit newer to NodeJS (but I am familiar enough to tackle small projects with it), but I'm extremely new to creating Discord bots. My intention is to create a bot that I can run a few commands and it sends information to me regarding what commands were send, but that's irrelevant; that part, I can eventually get to work, code wise--but my issue here, is, I can't get this bot to do anything, not even with discord.js documentation down to basically a T.

So, anyway, I tried creating the bot myself with my own code but followed the guidelines of the documentation from both Discord and discord.js. Nothing worked (no errors though and my bot comes online). So, just to make sure it wasn't an error with my code, I wanted to test to make sure it wasn't an issue with something else BESIDES the code, by literally just taking the code from discord.js's GIT repository, found here: https://github.com/discordjs/guide/tree/main/code-samples/creating-your-bot/command-handling (also listed in discord.js's documentation, found here: https://discordjs.guide/creating-your-bot/#using-config-json).

Anyway, just for testing purposes I only used the "ping.js" and "server.js" files from the "commands" folder, just to make sure I could get it to work.

However, even practically copy pasting the code into my project (again for testing purposes I'm not a code stealer lol) and then properly setting the information inside the config.json file, and then running the module... my bot will come online, but does absolutely nothing. No errors though. From what I understand, with the code I have here, I should be able to run the command: /ping in the discord server and get a response of "pong!", yet, nothing.

Also, don't know if this is helpful or not: when viewing the integration for the bot, in the Discord server, the bot has admin permissions but it still shows the majority of other permissions denied, I would assume that the admin permission would overwrite them anyway, but I'm unsure. ALSO, when I STOP my module, I would assume the bot should go offline--it does NOT. Which is super weird. I would assume if the node server is no longer running, the bot would go offline. But it doesn't. The only way I can get it to go offline after it comes online is to literally reset the bot's token and re-run the node module with the new token.

Anyway, I figured if I followed the discord.js documentation on how they do it, it would work, at least for testing purposes--but I literally cannot get this bot to do ANYTHING. Not even if I DM it (which I heard could be a possible troubleshooting step).

Anyway, the code was a bit long to directly paste here, so I put all of the relevant files into a Google Drive folder and shared them here:

https://drive.google.com/drive/folders/1ksFwpm43O-LceCp-DHpc6UdWkzyhHsUs?usp=share_link

Any help would be greatly appreciated. I'm sure it's something very stupid that I'm missing. Literally everything else works besides getting the bot to actually DO something.

Author
Account Strength
90%
Account Age
4 years
Verified Email
Yes
Verified Flair
No
Total Karma
906
Link Karma
192
Comment Karma
714
Profile updated: 18 hours ago
Posts updated: 9 months ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
1 year ago