haseramazing.blogg.se

Spam bot for discord on chrome
Spam bot for discord on chrome








spam bot for discord on chrome
  1. #Spam bot for discord on chrome install#
  2. #Spam bot for discord on chrome code#

But, this wouldn’t be much of a tutorial if we stopped at hello world, so let’s go over some of the documentation, so you have a better idea of what’s possible. Alright, So What Else Can I Do?īeyond basic setup, anything else is entirely up to you. Once this is done though, you can give the link to your friends to have them add the bot to their servers as well. You have to take this URL: Īnd replace CLIENTID with your bot’s client ID, found on the general information tab of the application page. Note: Be careful with this, as you don’t really want to deal with recursion. Here, for example, the bot logs its replies to the console, so the bot’s replies trigger client.on('message'). I recommend this method of logging objects to the Chrome Node devtools, and just looking around to see what makes it work. Most notably, you have the author info and the channel info, which you can access with msg.author and msg.channel. So what makes up this message object? A lot of stuff, actually: Now, it should just say “Logged in as ,” but here I’ve added a line that will log all message objects received to the console: This starts up the script, and also fires up the Chrome debugger, which you can access by typing chrome://inspect/ into Chrome’s Omnibar and then opening “dedicated devtools for Node.” Head over to your terminal, and run the following command: nodemon -inspect index.js Don’t ever post your token on the internet.Ĭopy this code, paste in your token at the bottom, and save it as index.js in a dedicated folder. Obviously, the token in the screenshot here is fake. The last line logs in with the token from the bot portal.If the message just says “ping,” then it will reply with “Pong!” The client.on('message') block will fire everytime a new message is posted to any channel. Of course, you’ll need to check the message content, and that’s what the if block does.Here, it’s just configured to log its name to the terminal. The client.on('ready') block will fire when the bot starts up.Line one imports the module into an object called “Discord,” and line two initializes the client object. The first two lines are to configure the client.

#Spam bot for discord on chrome code#

This code is taken from the discord.js example.

spam bot for discord on chrome

You could just use notepad, but we recommend either Atom or VSC.Ĭonsole.log(`Logged in as $!`)

#Spam bot for discord on chrome install#

You can install it by running the following command: npm i -g nodemon It’s a command line app that monitors your bot’s code and restarts automatically on changes. We also recommend installing the nodemon tool.










Spam bot for discord on chrome