Worked on #13 and #4. There are some caching issues left, though. Introduced abstract class Cacheable. Replaced async_pymongo with pymongo
This commit is contained in:
@@ -88,14 +88,15 @@ class CogConfig(Cog):
|
||||
try:
|
||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||
except (InvalidId, GuildNotFoundError):
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale))
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale), ephemeral=True)
|
||||
return
|
||||
|
||||
try:
|
||||
timezone_parsed: ZoneInfo = ZoneInfo(timezone)
|
||||
except ZoneInfoNotFoundError:
|
||||
await ctx.respond(
|
||||
self.bot._("timezone_invalid", "messages", locale=ctx.locale).format(timezone=timezone)
|
||||
self.bot._("timezone_invalid", "messages", locale=ctx.locale).format(timezone=timezone),
|
||||
ephemeral=True,
|
||||
)
|
||||
return
|
||||
|
||||
@@ -130,7 +131,7 @@ class CogConfig(Cog):
|
||||
try:
|
||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||
except (InvalidId, GuildNotFoundError):
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale))
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale), ephemeral=True)
|
||||
return
|
||||
|
||||
await guild.purge(self.bot.cache)
|
||||
@@ -146,11 +147,13 @@ class CogConfig(Cog):
|
||||
try:
|
||||
guild: PycordGuild = await self.bot.find_guild(ctx.guild.id)
|
||||
except (InvalidId, GuildNotFoundError):
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale))
|
||||
await ctx.respond(self.bot._("unexpected_error", "messages", locale=ctx.locale), ephemeral=True)
|
||||
return
|
||||
|
||||
if not guild.is_configured():
|
||||
await ctx.respond(self.bot._("guild_unconfigured_admin", "messages", locale=ctx.locale))
|
||||
await ctx.respond(
|
||||
self.bot._("guild_unconfigured_admin", "messages", locale=ctx.locale), ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
await ctx.respond(
|
||||
|
Reference in New Issue
Block a user