def bot_main(token, queue, channel, prefix, desc):
"""Run bot."""
bot = AutomaBot(get=queue, update_channel=channel,
command_prefix=prefix,
description=desc, self_bot=False)
@bot.command(pass_context=True)
@commands.check(is_owner)
async def sleep(ctx):
await bot.change_presence(status=discord.Status.dnd, afk=True)
msg = 'Going to sleep. See you :wave:'
for comm in bot.commands:
if comm is not "wakeup":
bot.commands[comm].enabled = False
await bot.say(msg)
@bot.command(pass_context=True, hidden=True)
@commands.check(is_owner)
async def wakeup(ctx):
for comm in bot.commands:
if comm is not "wakeup":
bot.commands[comm].enabled = True
await bot.change_presence(status=discord.Status.online, afk=False)
msg = 'Goooooooooood morniiing vietnammmmmm :bomb:'
await bot.say(msg)
await bot.start(token)
评论列表
文章目录