Refactor presence to loops.

This commit is contained in:
2023-03-28 13:02:07 -04:00
parent 7d1e69c007
commit 379f280c11
2 changed files with 15 additions and 8 deletions
+14
View File
@@ -0,0 +1,14 @@
"""
Initializing code for all loops.
"""
from nextcord.ext import commands
from .bot_presence import BotPresence
# This function will be called when this extension is loaded.
# It is necessary to add these functions to the bot.
def setup(bot: commands.Bot):
"""Adds function to bot"""
bot.add_cog(BotPresence(bot))
@@ -1,5 +1,5 @@
"""
Functions for controlling the bot's presence.
Functions for controlling the bot's presence. Also contains the loop.
"""
import random
@@ -46,10 +46,3 @@ class BotPresence(commands.Cog, name="Bot Presence"):
status += f" | {len(self.bot.guilds)} servers"
await self.bot.change_presence(activity=nextcord.Game(status))
# This function will be called when this extension is loaded.
# It is necessary to add these functions to the bot.
def setup(bot: commands.Bot):
"""Adds function to bot"""
bot.add_cog(BotPresence(bot))