import asyncio import contextlib import discord from redbot.core import commands class StatusRotator(commands.Cog): """Bot status rotation.""" def __init__(self, bot): self.bot = bot self._task = None async def cog_load(self): self._task = asyncio.create_task(self.status_loop()) async def cog_unload(self): if self._task: self._task.cancel() with contextlib.suppress(asyncio.CancelledError): await self._task async def status_loop(self): await self.bot.wait_until_ready() while not self.bot.is_closed(): await self.bot.change_presence( <<<<<<< HEAD ======= status=discord.Status.dnd, >>>>>>> a9c6c65 (feat(statusrotator): change the statuses) activity=discord.Game(name="❓ Prefix: .help") ) await asyncio.sleep(60) await self.bot.change_presence( <<<<<<< HEAD activity=discord.Game(name="💻 I support 100+ commands") ) await asyncio.sleep(30) ======= status=discord.Status.dnd, activity=discord.Game(name="🌐 nexa.zvcloud.net") ) await asyncio.sleep(60) await self.bot.change_presence( status=discord.Status.dnd, activity=discord.Game(name="💻 I support 1200+ commands") ) await asyncio.sleep(30) >>>>>>> a9c6c65 (feat(statusrotator): change the statuses)