From: jweigele Date: Sun, 14 Aug 2022 18:54:49 +0000 (-0700) Subject: Exit command, as a workaround for "idles out in discord" lol X-Git-Url: http://git.hexthepla.net/?a=commitdiff_plain;h=3e388b3b3088bea7d1cef9200e31c557e5b3371a;p=grahbot Exit command, as a workaround for "idles out in discord" lol --- diff --git a/grahbot.py b/grahbot.py index 3faed6a..709bf88 100755 --- a/grahbot.py +++ b/grahbot.py @@ -4,6 +4,7 @@ import discord import socket import random import ssl +import sys import discord.voice_client import datetime import asyncio @@ -482,6 +483,10 @@ class GrahDiscordBot(discord.Client, HornClient, HornProm): log.info('Was instructed to say {} in channel {} guild {}'.format(text, channel, str(guild))) await self.msg_say_channel(channel, text, guild=guild) + async def command_exit(self, message, guild): + await message.channel.send('Exiting now :v:') + log.info('Exiting now by user command') + sys.exit(0) async def command_play(self, message, guild): horn = ' '.join(message.content.split(' ')[1:])