1
0
Fork 0
mirror of synced 2024-05-19 12:02:29 +12:00

Correct cache lookup

This commit is contained in:
Dan Hess 2020-03-30 15:19:14 -05:00
parent 1c0c7fa053
commit 1c1eade166

View file

@ -30,7 +30,7 @@ class GuildConfiguration(commands.Cog):
"""Handles configuring the different settings that can be used on the bot""" """Handles configuring the different settings that can be used on the bot"""
keys = { keys = {
} }
def _str_to_bool(self, opt, setting): def _str_to_bool(self, opt, setting):
@ -333,7 +333,7 @@ WHERE
id=$2 AND id=$2 AND
NOT $1 = ANY(ignored_channels); NOT $1 = ANY(ignored_channels);
""" """
ctx.bot.loop.create_task(ctx.cache.load_ignored()) ctx.bot.loop.create_task(ctx.bot.cache.load_ignored())
return await ctx.bot.db.execute(query, channel.id, ctx.guild.id) return await ctx.bot.db.execute(query, channel.id, ctx.guild.id)
async def _handle_set_ignored_members(self, ctx, setting): async def _handle_set_ignored_members(self, ctx, setting):
@ -353,7 +353,7 @@ WHERE
id=$2 AND id=$2 AND
NOT $1 = ANY(ignored_members); NOT $1 = ANY(ignored_members);
""" """
ctx.bot.loop.create_task(ctx.cache.load_ignored()) ctx.bot.loop.create_task(ctx.bot.cache.load_ignored())
return await ctx.bot.db.execute(query, setting, ctx.guild.id) return await ctx.bot.db.execute(query, setting, ctx.guild.id)
async def _handle_set_rules(self, ctx, setting): async def _handle_set_rules(self, ctx, setting):
@ -641,44 +641,44 @@ WHERE
birthday_notifications birthday_notifications
*Notify on the birthday that users in this guild have saved* *Notify on the birthday that users in this guild have saved*
**{settings.get("birthday_notifications")}** **{settings.get("birthday_notifications")}**
welcome_notifications welcome_notifications
*Notify when someone has joined this guild* *Notify when someone has joined this guild*
**{settings.get("welcome_notifications")}** **{settings.get("welcome_notifications")}**
goodbye_notifications goodbye_notifications
*Notify when someone has left this guild *Notify when someone has left this guild
**{settings.get("goodbye_notifications")}** **{settings.get("goodbye_notifications")}**
welcome_msg welcome_msg
*A message that can be customized and used when someone joins the server* *A message that can be customized and used when someone joins the server*
**{"Set" if settings.get("welcome_msg") is not None else "Not set"}** **{"Set" if settings.get("welcome_msg") is not None else "Not set"}**
goodbye_msg goodbye_msg
*A message that can be customized and used when someone leaves the server* *A message that can be customized and used when someone leaves the server*
**{"Set" if settings.get("goodbye_msg") is not None else "Not set"}** **{"Set" if settings.get("goodbye_msg") is not None else "Not set"}**
**Alert Channels** **Alert Channels**
default_alerts default_alerts
*The channel to default alert messages to* *The channel to default alert messages to*
**{alerts.get("default_alerts")}** **{alerts.get("default_alerts")}**
welcome_alerts welcome_alerts
*The channel to send welcome alerts to (when someone joins the server)* *The channel to send welcome alerts to (when someone joins the server)*
**{alerts.get("welcome_alerts")}** **{alerts.get("welcome_alerts")}**
goodbye_alerts goodbye_alerts
*The channel to send goodbye alerts to (when someone leaves the server)* *The channel to send goodbye alerts to (when someone leaves the server)*
**{alerts.get("goodbye_alerts")}** **{alerts.get("goodbye_alerts")}**
picarto_alerts picarto_alerts
*The channel to send Picarto alerts to (when a channel the server follows goes on/offline)* *The channel to send Picarto alerts to (when a channel the server follows goes on/offline)*
**{alerts.get("picarto_alerts")}** **{alerts.get("picarto_alerts")}**
birthday_alerts birthday_alerts
*The channel to send birthday alerts to (on the day of someone's birthday)* *The channel to send birthday alerts to (on the day of someone's birthday)*
**{alerts.get("birthday_alerts")}** **{alerts.get("birthday_alerts")}**
raffle_alerts raffle_alerts
*The channel to send alerts for server raffles to* *The channel to send alerts for server raffles to*
**{alerts.get("raffle_alerts")}** **{alerts.get("raffle_alerts")}**
@ -688,30 +688,30 @@ WHERE
followed_picarto_channels followed_picarto_channels
*Channels for the bot to "follow" and notify this server when they go live* *Channels for the bot to "follow" and notify this server when they go live*
**{len(settings.get("followed_picarto_channels"))}** **{len(settings.get("followed_picarto_channels"))}**
ignored_channels ignored_channels
*Channels that the bot ignores* *Channels that the bot ignores*
**{len(settings.get("ignored_channels"))}** **{len(settings.get("ignored_channels"))}**
ignored_members ignored_members
*Members that the bot ignores* *Members that the bot ignores*
**{len(settings.get("ignored_members"))}** **{len(settings.get("ignored_members"))}**
rules rules
*Rules for this server* *Rules for this server*
**{len(settings.get("rules"))}** **{len(settings.get("rules"))}**
assignable_roles assignable_roles
*Roles that can be self-assigned by users* *Roles that can be self-assigned by users*
**{len(settings.get("assignable_roles"))}** **{len(settings.get("assignable_roles"))}**
custom_battles custom_battles
*Possible outcomes to battles that can be received on this server* *Possible outcomes to battles that can be received on this server*
**{len(settings.get("custom_battles"))}** **{len(settings.get("custom_battles"))}**
custom_hugs custom_hugs
*Possible outcomes to hugs that can be received on this server* *Possible outcomes to hugs that can be received on this server*
**{len(settings.get("custom_hugs"))}** **{len(settings.get("custom_hugs"))}**
""".strip() """.strip()
embed = discord.Embed(title=f"Configuration for {ctx.guild.name}", description=fmt) embed = discord.Embed(title=f"Configuration for {ctx.guild.name}", description=fmt)