HOW TO MAKE A DISCORD BOT The complete guide to make a simple discord bot. BY Chissanuphong N.
INTRODUCTION This book is made to cover the basic of discord bot building and some of an advance discord bot coding, for an instance, discord together bot and music bot. By utilising javascript libraly, which is discord.js, discord- together, and discord-player library. The author is a 3rd year highschool student locate in Thailand, and this book is made to submit to technology class's assignment. If there is any error in this book, I humbly apologise. If you wish to contact the author, you can contact the author via an email: [email protected].
FO ELBAT CONTENTS 2 INTRODUCTION 4 10 BRIEF EXPLANATION OF THIS BOOK AND AUTHOR SETTTING UP SETTING UP THE PROGRAM AND VISUAL STUDIO START CODING THE BOT MAKE A SIMPLE BOT 14 DISCORD TOGETHER BOT 25 MAKE A GAMING BOT FOR INITIATING DISCORD TOGETHER GAME DISCORD MUSIC BOT MAKE A MUSIC STREAMING BOT
HSOTWARTTO
#1 SET UP VISUAL STUDIO You can download Visual Studio, a universal coding program, for free at: https://visualstudio.microsoft.com/
#2 CREATE A NEW JAVASCRIPT PROJECT
#3 INSTALL \"discord.js\" PACKAGE Run a \"npm i discord.js\" command in the terminal to install discord.js package.
#4 SET UP YOUR BOT ACCOUNT Set up an account for your bot at: https://discord.com/developers/applications. Remember to give it an OAuth2 and Permission to make it functional. Pro-tips: only give a permission that associate with your bot function!
#5 INVITE YOUR BOT TO YOUR SERVER After giving permission, an invite link that will invite your bot into the server can now be access. Copy it and paste in on any browser. You are good to go!
#6 SETUP YOUR BOT ON VISUAL STUDIO On your index.js file type:
Create new .js file with name \"interactionCreate.js\" and write :
Create new .js file with name \"messageCreate.js\" and write : Create new .js file with name \"ready.js\" and write :
Create new .json file with name \"config.json\" and write : Insert your bot prefix on the \"your prefix here\" and your bot token on the \"your bot token here\". The prefix can be whatever you want but your token will act as your bot \"National ID\". You can retrieve the token at your bot page and don't give it to anyone else!
#7 MAKE YOUR BOT FIRST COMMAND Now that you have finished setup your bot. It can now be run. But there is no command yet so you can't interact with it. Hence, we gonna create some command now! Create new .js file with your command name! In this case we will create a command that tell the bot's ping hence the name \"ping\"
#8 RUN AND TEST YOUR BOT To run your bot, you can simply type \"node .\" on your Visual Studio's terminal, this will activate your bot. And to test your command, try type \"/ping\" on the server that have your bot in it. The bot should reply to your message with the message: \"bot-ping-here\"ms! (e.g. 274ms!)
YWOIUTRH FTIHRISST, FINBIOSTHISED!
BUT WANT TO GOASDUVRANEC! ER?
GDAMISMACEKOEBRAODT
#1 INSTALL A PACKAGE FOR YOUR DISCORD TOGETHER Install a discord-together package (the discord game package) by using npm. Type the following command on your terminal:
#2 CREATE DISCORD GAME Create new .js file with the game you intended to create as a name (e.g. chess) and write the following code: Pro-tips: You can create a variety of games, try to look it up on the discord-together.api. You can use the exact same code just like this one but replace chess-together with the game you want to create!
POKER GAME
CHECKER GAME
CHESS GAME
YOUTUBE TOGETHER
MUMSAIKCEBAOT
#1 INSTALL A PACKAGE FOR YOUR DISCORD PLAYER Install a discord-player package (the discord track streaming package) by using npm. Type the following command on your terminal:
#2 SETUP A PLAYER Create a player that will stream your track. Start with creating a \"player.js\" file then write the following code:
#3 BUILD A PLAY CODE Create \"play.js\" file then write:
#4 BUILD A SKIP CODE Create \"skip.js\" file then write:
CSOTTHMILELMREMAAANRNDEYS TO TRY OUT
Don't be afraid to try a new thing. Contact author at: [email protected] Motivation.txt (function repeat() { eat(); sleep(); love_yourself(); repeat(); })(); #Quote #Programming #Selfcare
Search
Read the Text Version
- 1 - 32
Pages: