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.
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.
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/CodingHelp/...