add loop which updates bot's status every 45 min
from discord.ext import commands, tasks
+import discord
+import random
import arrow
@@ -14,6 +16,11 @@ class Loops(commands.Cog):
self.clear_rcon_cache.cancel()
self.update_minecraft_servers.cancel()
+ @tasks.loop(minutes=45)
+ async def change_status(self):
+ await self.bot.wait_until_ready()
+ await self.bot.change_presence(activity=discord.Game(name=random.choice(self.d.playing_list)))
+
@tasks.loop(seconds=30)
async def clear_rcon_cache(self):
"""clear old connections from the rcon cache"""
