Improved some messages and prepared them for i18n
This commit is contained in:
@@ -4,7 +4,15 @@ from logging import Logger
|
||||
from typing import Any, Dict, List, Optional
|
||||
|
||||
from bson import ObjectId
|
||||
from discord import Bot, Guild, Member, PermissionOverwrite, TextChannel, Forbidden, Role
|
||||
from discord import (
|
||||
Bot,
|
||||
Forbidden,
|
||||
Guild,
|
||||
Member,
|
||||
PermissionOverwrite,
|
||||
Role,
|
||||
TextChannel,
|
||||
)
|
||||
from discord.abc import GuildChannel
|
||||
from libbot.cache.classes import Cache
|
||||
from pymongo.results import InsertOneResult
|
||||
@@ -106,12 +114,8 @@ class PycordUser:
|
||||
"guild_id": self.guild_id,
|
||||
"event_channels": self.event_channels,
|
||||
"is_jailed": self.is_jailed,
|
||||
"current_event_id": (
|
||||
self.current_event_id if not json_compatible else str(self.current_event_id)
|
||||
),
|
||||
"current_stage_id": (
|
||||
self.current_stage_id if not json_compatible else str(self.current_stage_id)
|
||||
),
|
||||
"current_event_id": (self.current_event_id if not json_compatible else str(self.current_event_id)),
|
||||
"current_stage_id": (self.current_stage_id if not json_compatible else str(self.current_stage_id)),
|
||||
"registered_event_ids": (
|
||||
self.registered_event_ids
|
||||
if not json_compatible
|
||||
@@ -367,9 +371,7 @@ class PycordUser:
|
||||
|
||||
# TODO Add documentation
|
||||
async def set_event_stage(self, stage_id: str | ObjectId | None, cache: Optional[Cache] = None) -> None:
|
||||
await self._set(
|
||||
cache, current_stage_id=stage_id if isinstance(stage_id, str) else ObjectId(stage_id)
|
||||
)
|
||||
await self._set(cache, current_stage_id=stage_id if isinstance(stage_id, str) else ObjectId(stage_id))
|
||||
|
||||
async def jail(self, cache: Optional[Cache] = None) -> None:
|
||||
await self._set(cache, is_jailed=True)
|
||||
|
Reference in New Issue
Block a user