This repository has been archived on 2025-02-16. You can view files and clone it, but cannot push or open issues or pull requests.
Spiffo/cogs/activity.py
Corban-Lee Jones f150bf9ddb
All checks were successful
Build and Push Docker Image / build (push) Successful in 12s
fix duplicate cog name 'ActivityCog'
2024-12-06 11:06:33 +00:00

36 lines
791 B
Python

"""
Handles the activity displayed on the bot's Discord profile.
The current intent is to display the server's player count as the activity.
"""
import logging
from discord import Activity
from discord.ext import commands, tasks
log = logging.getLogger(__name__)
class ActivityCog(commands.Cog):
"""
Handles the bot's profile activity.
"""
def __init__(self, bot: commands.Bot):
self.bot = bot
@tasks.loop(seconds=30)
async def update_activity(self):
"""
Update the bot's profile activity on an interval of 30 seconds.
"""
log.debug("updating activity")
# self.bot.
async def setup(bot: commands.Bot):
cog = ActivityCog(bot)
await bot.add_cog(cog)
log.info("Added %s cog", cog.__class__.__name__)