Build your Discord bot to build your Extra Life commands (PART 1) - Extra Life JSON Code Discussion & Sharing - Extra Life Community Hub Jump to content
Patricio_tv

Build your Discord bot to build your Extra Life commands (PART 1)

Recommended Posts

Extra Life has grown up last years. Today we got overlays, Extra Life helpers and donations alerts on Streamlabs and Streamelements but what about Discord? nothing that I know. I didn’t find a good way to check my participant or team information  directly from my Discord server, I needed to visit the official web site every time I needed to check the info. I started to think a way to get common Extra Life info directly from Discord using simple commands, faster and easy, why? because Extra Life is on Twitch, Twitch is integrated with Discord and some Discord communities are strong and supporting Extra Life, it’s good way to post information about your Extra Life campaign, your donors, your goals, your Extra Life marathon, the Extra Life stream team schedule and more for you members. Possibilities are many.

 

What did I need to do that? A custom bot and a way to get the information.

 

I’m going to share this short tutorial to build your custom bot and use the new Extra Life API to build your own commands. This API was released some weeks ago.

 

Requirements:

 

-              A Discord account

-              Basic development knowledge about Node.js and Javascript. https://nodejs.org/en/download/

-              The Extra Life API: https://www.npmjs.com/package/extra-life-api

 

Note: I always suggest to use a test environment. There is not risk about security issues because you’re using a Discord API, Extra Life API and you’re setting your bot permissions. You can add and remove your bot anytime. This is not an Extra Life official bot, I'm explaining how you can build one yourself. The Extra Life bot name and logo are friendly examples for this tutorial.  Please if you want to use them ask for approval to staff team or team leaders.

 

The first part of this tutorial is show you how you can build your Discord Application (your bot), you will find different ways to do this on internet, use whatever best suits for you.

You will add your bot to your Discord Server, later you will be able to build your Extra Life commands as your preference.

 

Here we go:

 

PART 1

 

I'm assuming you already have a Discord account, if not create it please.

 

 

image.png.fead226af76b2c9f542ac368e5fd3b22.png

 

  •  Write a name and create

 

image.png.0c9a8ba120eba4ff06d428f3a9b2e7eb.png

 

  • General info tab: Upload a picture, complete the description (optional) and save the changes.

 

image.png.99c13bec6ba6bf33b640272711b2524d.png

 

  • Go to bot tab and click on add bot. After confirmation your bot will have visibility with Discord.

 

image.png.4937370bb8df9f04869a449571eeff22.png

 

image.png.cc17f5e421c7f4d19df1ba735709d21d.png

 

  • After bot creation. You will see a confirmation a new options available.

 

image.png.aedce547815503c28e8729fd7c6af726.png

 

image.png.5fb472047561e4fb4915e6a51399c224.png

 

Now your bot has a token, this works like a password so take care of it. You can regenerate it any time in case your security is compromised. This token will allow you to connect your bot with Discord when you start to build your commands. 

 

  • Go to oauth tab. We’re using a bot application so our scope is “bot” and set your  permissions.

 

image.png.5d53acd12811eeec74bd74f7e58b2bf1.png

 

image.png.057da5c4a9bd5ad913604fbb26c83b92.png

 

on the permissions you set like any other bot (Dyno, Mee6, couchbot, etc). I’m using few here permissions because I don’t want the bot manage channels, roles, kick members or these kind of administration actions. The bot just use commands to get Extra Life information. If you want to give your bot more permissions for administrations purposes is up to you.

 

  • The red number are your permissions, it will change each time you add or remove permissions, you can calculate this number on bot tab too.

 

https://discordapp.com/api/oauth2/authorize?client_id=597566571417960488&permissions=75776&scope=bot

 

  • Copy the link and paste it on your browser. See what happens.

 

image.png.8617828ee09b062751b52c1581bd57e7.png

 

image.png.c1cf355420146a210df21aebf93f7144.png

 

If you did all correctly, you will authorize your new bot to join your Discord server with the permissions you set before. It’s clear, isn't it?

 

  • Now choose your Discord server and set authorize. You receive the following confirmation.

 

image.png.a8361d7fe4068cbcc12e6eff2536d51d.png

 

  • Go to your Discord Server and check if the bot is joined. It should be there offline.

 

image.png.a7ae1f758c9aa8bf3d354b21d8170042.png

 

Alright your bot is joined and offline. Why offline? because you used the Discord API to build your bot but it still wasn’t developed to listen messages, read commands and reply.

What did you learn here?

 

  1. Use the Discord API to build your bot.

  2. Understand how permissions work and are set.

  3. Understand how bot invitations work.

  4. Understand how your bot joins on your Discord server.

 

Next chapter I’m going to explain how you should install Node.js to start coding your bot. You will use your bot token to login on Discord, it will be online and ready to listen for messages.

 

If you enjoyed this content, please share it!!!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...