From 9f7d908a1236058b60e2c81ac7b75eae05910f65 Mon Sep 17 00:00:00 2001 From: igna <88955484+nekospara@users.noreply.github.com> Date: Tue, 31 Aug 2021 01:50:30 -0400 Subject: [PATCH 1/3] Update main.py --- src/main.py | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/main.py b/src/main.py index 986e2c0..9dea847 100644 --- a/src/main.py +++ b/src/main.py @@ -1,18 +1,22 @@ -import os +import os import nextcord from nextcord.ext import commands +from dotenv import load_dotenv -TOKEN = os.environ['TOKEN'] -PREFIX = os.environ['PREFIX'] +load_dotenv() +TOKEN = os.getenv('TOKEN') +PREFIX = os.getenv('PREFIX') intents = nextcord.Intents.default() intents.members = True bot = commands.Bot(command_prefix=PREFIX, intents=intents) -@bot.event() + +@bot.event async def on_ready(): print(f'{bot.user} is online!') + @bot.command() async def ping(ctx): await ctx.reply('Pong!') From 13eccad2d5e8785ba2e06e72430416f7a3ee08ef Mon Sep 17 00:00:00 2001 From: igna <88955484+nekospara@users.noreply.github.com> Date: Tue, 31 Aug 2021 01:52:03 -0400 Subject: [PATCH 2/3] fix: heroku error not running bot --- Procfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Procfile b/Procfile index c445cb1..de7e435 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -worker: python3 main.py \ No newline at end of file +worker: python3 src/main.py From c7b917da8c5ce3117402a34f0536b51c926fd747 Mon Sep 17 00:00:00 2001 From: igna <88955484+nekospara@users.noreply.github.com> Date: Tue, 31 Aug 2021 01:52:21 -0400 Subject: [PATCH 3/3] Update requirements.txt --- requirements.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/requirements.txt b/requirements.txt index 5436c86..30da507 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1 +1,2 @@ -nextcord \ No newline at end of file +nextcord +python-dotenv