This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Load up the discord.js library | |
| const Discord = require("discord.js"); | |
| // This is your client. Some people call it `bot`, some people call it `self`, | |
| // some might call it `cootchie`. Either way, when you see `client.something`, or `bot.something`, | |
| // this is what we're refering to. Your client. | |
| const client = new Discord.Client(); | |
| // Here we load the config.json file that contains our token and our prefix values. | |
| const config = require("./config.json"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* | |
| NOTE: This gist is no longer supported and won't get updated. | |
| Please refer to https://github.com/JakyeRU/discord.js-examples for the latest version. | |
| If you have any issues/suggestions you can open an issue/pull request there. | |
| */ | |
| client.on("message", async message => { | |
| // Checking if the message author is a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Discord all events! | |
| // A quick and dirty fleshing out of the discord.js event listeners (not tested at all!) | |
| // listed here -> https://discord.js.org/#/docs/main/stable/class/Client | |
| // Learn from this, do not just copy it mofo! | |
| // | |
| // Saved to -> https://gist.github.com/koad/316b265a91d933fd1b62dddfcc3ff584 | |
| // Last Updated -> Halloween 2022 | |
| /* |