Skip to content

Getting Started

Kyle Santiago edited this page May 6, 2019 · 1 revision

Installation

As with most Python libraries, Discord.py can be installed with Pip. However, since we're using the rewrite (the latest and the only supported) version, you also need to have Git installed if you want to contribute, so be sure to do that. After you have that installed (and, optionally, you're in whatever venv you want to use) just run the command

pip install -U git+https://github.com/Rapptz/discord.py@rewrite#egg=discord.py[voice]

This will install Discord.py's rewrite version from Github with the voice module.

Bot Token

After we have that installed, we need to grab a bot token from Discord. A "token" is a string that you send to a server to authenticate with; its the bot's unique identifier.

Go here and create a new application. The name you supply will be the name of your bot, but you can change that later. After you've made an application, you should be redirected to a page with all of the app's details on it. Scroll to the bottom of this page and press "create a bot user". You will then have a "click to reveal" link that shows you your bot's token.

DO NOT SHARE THIS TOKEN WITH ANYONE and certainly do not post it on GitHub.

Before you close that page, be sure to review whether you want your bot to be public or not. If the box is ticked, then anyone with the invite link will be able to add your bot to their guild, but if left un-ticked, only you can add the bot to any given guild.

Adding your Bot

It's fairly important that you add your bot to the guild you want to test it on, and that's simple enough to do. On your application page, you should be able to see an OAuth2 category. Click on it and look for the OAuth2 URL Generator. Just below it there will be a toggle-able boxes under the name "Scopes" -- toggle the bot scope and then scroll down; a permission category will appear. These are the permissions that your bot needs in order to function, so select what your bot needs, and then generate the URL. Now you just have to use it and add your bot to any server you have the privilege to do so.or, you may send that link to others who might wish to add your bot to their server.

Clone this wiki locally