Update main.py

This commit is contained in:
igna 2021-08-31 01:50:30 -04:00 committed by GitHub
parent 46201b1ecf
commit 9f7d908a12
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1,18 +1,22 @@
import os import os
import nextcord import nextcord
from nextcord.ext import commands from nextcord.ext import commands
from dotenv import load_dotenv
TOKEN = os.environ['TOKEN'] load_dotenv()
PREFIX = os.environ['PREFIX'] TOKEN = os.getenv('TOKEN')
PREFIX = os.getenv('PREFIX')
intents = nextcord.Intents.default() intents = nextcord.Intents.default()
intents.members = True intents.members = True
bot = commands.Bot(command_prefix=PREFIX, intents=intents) bot = commands.Bot(command_prefix=PREFIX, intents=intents)
@bot.event()
@bot.event
async def on_ready(): async def on_ready():
print(f'{bot.user} is online!') print(f'{bot.user} is online!')
@bot.command() @bot.command()
async def ping(ctx): async def ping(ctx):
await ctx.reply('Pong!') await ctx.reply('Pong!')