From 3e388b3b3088bea7d1cef9200e31c557e5b3371a Mon Sep 17 00:00:00 2001 From: jweigele Date: Sun, 14 Aug 2022 11:54:49 -0700 Subject: [PATCH] Exit command, as a workaround for "idles out in discord" lol --- grahbot.py | 5 +++++ 1 file changed, 5 insertions(+) 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:]) -- 2.30.2