From b0a85c1e1f9fc9cf67fe36b90cbab34ac5468269 Mon Sep 17 00:00:00 2001
From: dnns01 <git@dnns01.de>
Date: Fri, 28 May 2021 18:25:42 +0200
Subject: [PATCH] Add notification to yuni, whenever Marcus starts blender

---
 strolly.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/strolly.py b/strolly.py
index b36a23a..a77318e 100644
--- a/strolly.py
+++ b/strolly.py
@@ -15,8 +15,7 @@ load_dotenv()
 TOKEN = os.getenv('DISCORD_TOKEN')
 ACTIVITY = os.getenv('DISCORD_ACTIVITY')
 
-intents = discord.Intents.default()
-intents.members = True
+intents = discord.Intents.all()
 bot = commands.Bot(command_prefix='!', help_command=None, activity=discord.Game(ACTIVITY), intents=intents)
 bot.add_cog(PollCog(bot))
 bot.add_cog(RollCog(bot))
@@ -30,4 +29,14 @@ async def on_ready():
     print("Client started!")
 
 
+@bot.event
+async def on_member_update(before, after):
+    if before.id == 250613346653569025:
+        if after.activity and "Blender" in after.activity.name:
+            if not before.activity or (before.activity and "Blender" not in before.activity.name):
+                channel = await bot.fetch_channel(811980578621620235)
+                await channel.send(
+                    "Achtung <@!490167202625093634>!!! Er tut es schon wieder! Marcus hat gerade die Kultsoftware Blender gestartet!")
+
+
 bot.run(TOKEN)
-- 
GitLab