-
-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added compatibility for deployment on Heroku
- Loading branch information
Luois45
committed
Dec 29, 2021
1 parent
ba5b88d
commit 1b80532
Showing
3 changed files
with
23 additions
and
6 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
worker: python discord-shop.py |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 | ||
|
@@ -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 | ||
|
@@ -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) | ||
|
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
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 | ||
|