people playing: 35, servers online: 15, games played: 142,904,068 Top Player: Ceytune

  Toribash Community » Clans » Organiζations » Official Organiζations » Toribash Academy
Register FAQ General Rules Community
Reply
 
Thread Tools Display Modes
Old Nov 23, 2018   #1
tlclay
Help Squad
 
Myth Belt
Join Date: Jul 2008
Posts: 225
Clan: Budo



[TBA] | CLASSROOM | [MM] Mod Making

Mod Making


Mod Making in Toribash is all about the crafting and creation of mods, and understanding how each aspect of the mod maker works. Periodically lessons, tutorials and content will be posted here for you guys.
You can also post teacher/lesson requests in this thread.

The format is as follows:

Subject: {Ex. Joint Objects, Using the Interface, Using Objects, other. }

Question/Request: {This just gives us a starting point, describe your problems or questions as best you can}


A replay attatchment is encouraged as a visual refference.


After you've submitted your Request a Teacher will follow up with you.
Be sure to check the times to see the best times for our teachers
.
tlclay is online now   Reply With Quote
Old Jan 13, 2019   #2
tlclay
Help Squad
 
Myth Belt
Join Date: Jul 2008
Posts: 225
Clan: Budo



[TBA] | Creating a Discord bot
.
Originally Posted by mitch View Post
Hey everyone, I'm mitch.

I'm here to teach you how to make a basic discord bot in JavaScript!

First off you're going to have to make a new discord application.

1



You can name this anything you want.

After creating your discord application, you'll be taken to this screen.

2



On the left side of your screen choose bot.

3



Ok, We're done with creating our bot account now!

Even though you can use notepad to edit javascript I'd recommend getting an IDE (Integrated Development Environment). I use Visual Studio Code. You can also use other text editors such as Notepad++.

Alright! The last thing we have to do is get Node.js. When installing this, make sure to "Add To PATH".

4



Now time to install Discord.js, The library that will allow us to interact with Discord's API!

Make a new folder in anywhere you want, I'll use my desktop! Inside this folder, we're going to hold down SHIFT and RIGHT-CLICK. It should bring up a drop-down menu, like this.

5



Press "Open PowerShell window here". If there is no option for this, Take a look for "Open Command Prompt window here". If none of these options are available. Goto Command Prompt (or Terminal) and find where your file is, I put mine on the desktop so I'll type "cd Desktop\bot". Once you are here you can type node -v and npm -v to check if you have Node installed. After you know you have Node installed you can type "npm install discord.js". Let that install, once it's done you can exit command prompt!

Now we're going to create the file where all our bots code will be stored! RIGHT-CLICK in the folder where you want your bot to be created.

6



Rename that file you just created to "bot.js" and make sure there is no .txt extension on the end.

If you can't see file extensions then do what is shown in the image below.

7



If you can see file extensions and renaming the file to bot.js worked for you, you can skip the above step.

RIGHT-CLICK this file and if you can see open with Notepad++ or Visual Studio Code, open it with those. If not search for one of them and open the one you searched for. After opening one of them press CTRL + O and find your bot.js file in the folder you created it in.

Once you're inside we can finally start typing up our base code!

javascript code:

const Discord = require('discord.js');
const bot = new Discord.Client();

bot.on('ready', () => {
console.log('Once the bot is ready this message will show!');
});

bot.on('message', async (message) => {
console.log('A message was sent');
});

bot.login(TOKEN);


Where you see "TOKEN" we're going to have to go to our bot account again. You're going to want to press copy on this page. If you can't find your way here, refer to the other steps.

8



After copying this you can come back to your code and copy paste it where I have put "TOKEN". Once you have done this your bot is ready to go!

Time to add it to your discord server for testing! Let's get our invite link.

9



Once you've done this, paste it into your browser and select your server here.

10



Once that's done go to the Command Prompt again and find the folder where your bot.js is. After that, type "node bot.js". This will start your bot, check the Discord server your bot is in and it should be online! Try sending a message and checking your console. It should say "A message was sent". If not, either my tutorial was garbage or you messed something up. Try recreating the steps, or posting on this thread for help.

Take a look at the Discord.js Documentation.

Terminology Used




tlclay is online now   Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 06:46 AM.




Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
ragdoll fighting game physics fighting game ragdoll fighting physics funmotion joints martial arts karate pc mac free game turn based game