Merge branch 'add_asyncio_for_pytest' into 'develop'

Add command prefix environment variable

Closes #20

See merge request ekzyis/musicube!18
This commit is contained in:
Ramdip Gill 2021-10-27 15:32:56 +00:00
commit 4927304bb1
2 changed files with 4 additions and 1 deletions

View File

@ -1,2 +1,3 @@
DISCORD_BOT_TOKEN= DISCORD_BOT_TOKEN=
DISCORD_CMD_PREFIX=
YOUTUBE_COOKIES=youtube.com_cookies.txt YOUTUBE_COOKIES=youtube.com_cookies.txt

View File

@ -152,7 +152,9 @@ class Music(commands.Cog):
if __name__ == "__main__": if __name__ == "__main__":
bot = commands.Bot(command_prefix=commands.when_mentioned_or("!"), description='Relatively simple music bot example') prefix = os.environ.get("DISCORD_CMD_PREFIX", "!")
bot = commands.Bot(command_prefix=commands.when_mentioned_or(prefix),
description='Relatively simple music bot example')
@bot.event @bot.event
async def on_ready(): async def on_ready():