[fix]: Translation fix

This commit is contained in:
Sweetbread
2023-05-16 16:55:25 +03:00
parent cada18c9f9
commit 260da8a11b
3 changed files with 14 additions and 28 deletions
+1 -15
View File
@@ -43,27 +43,13 @@ class ActiveCount(commands.Cog):
if message.guild is None: return
hour = message.created_at.replace(tzinfo=timezone.utc).astimezone(tz=None).hour
db.history.update_one(
await db.history.update_one(
{"type": "server", "id": message.guild.id},
{"$inc": {f"current.{hour}": 1}}
)
@app_commands.command()
async def activity(self, inter):
async def get_string(inter, string: str) -> str:
data = await self.bot.tree.translator.translate(
app_commands.locale_str(string),
inter.locale,
app_commands.TranslationContext(
app_commands.TranslationContextLocation.other,
"activity"
)
)
logger.debug(data)
if data is None: return string
return data
day = datetime.now().weekday()
fig, ax = plt.subplots(figsize=(8, 5))