Merge pull request #1 from nekospara/yeah

hotfix and better dotenv
This commit is contained in:
igna 2021-08-31 01:53:01 -04:00 committed by GitHub
commit ddc936a891
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 5 deletions

View File

@ -1 +1 @@
worker: python3 main.py worker: python3 src/main.py

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!')