Last active
November 5, 2020 22:13
-
-
Save 100ze/1a25c0a713404de4187c7c803d66ba21 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# importando módulos | |
import os | |
from dotenv import load_dotenv | |
# importando módulo de bots da biblioteca Discord.py | |
from discord.ext import commands | |
# pegando o token salvo no arquivo .env | |
load_dotenv() | |
TOKEN = os.getenv('DISCORD_TOKEN') | |
# definindo o prefixo do bot e armazenando o objeto 'bot' | |
bot = commands.Bot(command_prefix='!') | |
# mostrando algo no terminal quando o cliente se conectar | |
@bot.event | |
async def on_ready(): | |
print('{0.user} se conectou com sucesso :)'.format(bot)) | |
# conectando ao Discord | |
bot.run(TOKEN) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment