Update guild listener command to new data classes.
This commit is contained in:
@@ -17,7 +17,7 @@ class GuildListener(commands.Cog, name="Guild Listener"):
|
|||||||
@commands.Cog.listener()
|
@commands.Cog.listener()
|
||||||
async def on_guild_join(self, guild: nextcord.Guild):
|
async def on_guild_join(self, guild: nextcord.Guild):
|
||||||
"""Listener for Guild Join. Creates skeleton for new guild joined and saves it."""
|
"""Listener for Guild Join. Creates skeleton for new guild joined and saves it."""
|
||||||
highscores_data.add_new_server(guild.id)
|
highscores_data.add_guild(guild.id)
|
||||||
|
|
||||||
welcome_message: str = "Hello, I keep track of Highscores for you!"
|
welcome_message: str = "Hello, I keep track of Highscores for you!"
|
||||||
welcome_message += " Currently only supporting RuneScape boss highscores,"
|
welcome_message += " Currently only supporting RuneScape boss highscores,"
|
||||||
@@ -30,7 +30,7 @@ class GuildListener(commands.Cog, name="Guild Listener"):
|
|||||||
async def on_guild_remove(self, guild: nextcord.Guild):
|
async def on_guild_remove(self, guild: nextcord.Guild):
|
||||||
"""Listener for Guild Remove. Removes data from highscores_data."""
|
"""Listener for Guild Remove. Removes data from highscores_data."""
|
||||||
print(f"Removing data for guild {guild.name} (id {guild.id}).")
|
print(f"Removing data for guild {guild.name} (id {guild.id}).")
|
||||||
highscores_data.remove_guild(guild.id, guild.name)
|
highscores_data.remove_guild(guild.id)
|
||||||
|
|
||||||
|
|
||||||
# This function will be called when this extension is loaded.
|
# This function will be called when this extension is loaded.
|
||||||
|
|||||||
Reference in New Issue
Block a user