I'm trying to make my bot to send a message to a specified channel, when I start livestreaming on twitch. so far I'm fiddling with getting the right "activity" from my status, which represents, that I'm streaming. This is what I got so far :
class Stream(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.Cog.listener()
async def on_ready(self):
print("Streamingstatus loaded")
@commands.Cog.listener()
async def on_member_update(self, before, after):
channel = self.bot.get_channel (751954378772185149)
if after.activity is not None and after.activity.name == '#Twitch or so?' and after.id == 254375451084980224 and guild.id == 670015807551438874:
print(before.activity)
print(after.activity)
if after.activity.title.startswith(#streaming) and before.activity.title != after.activity.title:
await channel.send("Spleens went live on twitch right now! Watch him making a fool out of himself!")
Thanks in advance for any help!^^