Skip to content

Commit

Permalink
Added compatibility for deployment on Heroku
Browse files Browse the repository at this point in the history
  • Loading branch information
Luois45 committed Dec 29, 2021
1 parent ba5b88d commit 1b80532
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 6 deletions.
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
worker: python discord-shop.py
27 changes: 21 additions & 6 deletions discord-shop.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,8 @@ async def get_database_user(user, reaction):
return database_user


@client.event
async def on_ready():
print("Discord: Logged in as {0.user}".format(client))
await client.change_presence(activity=discord.Activity(
type=discord.ActivityType.playing, name="DiscordShopBot"))
# Creates Support role if it doesn't exists
async def start_setup(message):
# Performs the setup of the bot
for guild in client.guilds:
roleExists = False
categoryExists = False
Expand All @@ -60,6 +56,23 @@ async def on_ready():
categoryExists = True
if categoryExists == False:
await guild.create_category("orders")
embed = discord.Embed(title="Performed setup sucessfully",
description="",
color=discord.Colour.from_rgb(255, 0, 0))
embed.add_field(
name=f"Developer",
value=
"Louis_45#0553 | [GitHub](https://github.com/Luois45)\n[email protected]",
inline=True)

await message.channel.send(embed=embed)


@client.event
async def on_ready():
print("Discord: Logged in as {0.user}".format(client))
await client.change_presence(activity=discord.Activity(
type=discord.ActivityType.playing, name="DiscordShopBot"))


@client.event
Expand Down Expand Up @@ -1028,6 +1041,8 @@ async def on_message(message):
message = message
if message.author != client.user and message.guild != None:
role_names = [role.name for role in message.author.roles]
if message.content.startswith("=setup"):
await start_setup(message)
if "Seller" in role_names:
if message.content.startswith("=help"):
await help_command(message)
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
###### Requirements ######
numpy
discord.py==1.5.1
mysql-connector-python==8.0.22
requests==2.25.0
Expand Down

0 comments on commit 1b80532

Please sign in to comment.