Exit command, as a workaround for "idles out in discord" lol
authorjweigele <jweigele@local>
Sun, 14 Aug 2022 18:54:49 +0000 (11:54 -0700)
committerjweigele <jweigele@local>
Sun, 14 Aug 2022 18:54:49 +0000 (11:54 -0700)
grahbot.py

index 3faed6a578b89991926f2bb74113eea6708e6ecf..709bf882e1b69548e41ae8908fb0250945a7d3b1 100755 (executable)
@@ -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:])