From 98e82860520b8b8d78fc4b63b1e7e7e63c872139 Mon Sep 17 00:00:00 2001 From: aikaterna <20862007+aikaterna@users.noreply.github.com> Date: Thu, 28 Dec 2017 10:31:35 -0800 Subject: [PATCH] Add otherbot.py per request --- otherbot/otherbot.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 otherbot/otherbot.py diff --git a/otherbot/otherbot.py b/otherbot/otherbot.py new file mode 100644 index 0000000..b5225eb --- /dev/null +++ b/otherbot/otherbot.py @@ -0,0 +1,17 @@ +import discord + +class OtherbotStatus: + def __init__(self, bot): + self.bot = bot + + async def on_member_update(self, before, after): + if after.status == discord.Status.offline and after.id == "000000000000000000": # this is the bot id that you want to watch + channel_object = self.bot.get_channel("000000000000000000") # this is the channel id for the watcher bot to scream in + await self.bot.send_message(channel_object, "<@000000000000000000>, the bot is offline.") # this is the person to ping and the message + else: + pass + + +def setup(bot): + n = OtherbotStatus(bot) + bot.add_cog(n)