Made version in presence optional

This commit is contained in:
Sven Heidemann 2023-03-24 14:14:49 +01:00
parent 52035af0cc
commit 24d5bbf4d8
5 changed files with 13 additions and 9 deletions

View File

@ -86,10 +86,10 @@
"no_permission_message": "Nein!\nIch höre nicht auf dich ¯\\_(ツ)_/¯",
"not_implemented_yet": "Ey Alter, das kann ich noch nicht...",
"presence": {
"booting": "{} Ich fahre gerade hoch...",
"restart": "{} Muss neue Kekse holen...",
"running": "{} Ich esse Kekse :D",
"shutdown": "{} Ich werde bestimmt wieder kommen..."
"booting": "Ich fahre gerade hoch...",
"restart": "Muss neue Kekse holen...",
"running": "Ich esse Kekse :D",
"shutdown": "Ich werde bestimmt wieder kommen..."
}
},
"modules": {

View File

@ -10,11 +10,12 @@ class FeatureFlagsEnum(Enum):
boot_log_module = "BootLogModule"
core_module = "CoreModule"
core_extension_module = "CoreExtensionModule"
data_module = ("DataModule",)
database_module = ("DatabaseModule",)
data_module = "DataModule"
database_module = "DatabaseModule"
level_module = "LevelModule"
moderator_module = "ModeratorModule"
permission_module = "PermissionModule"
# features
api_only = "ApiOnly"
presence = "Presence"
version_in_presence = "VersionInPresence"

View File

@ -1,5 +1,4 @@
import traceback
from typing import Optional, Callable
from cpl_core.configuration.configuration_model_abc import ConfigurationModelABC
from cpl_core.console import Console
@ -27,6 +26,7 @@ class FeatureFlagsSettings(ConfigurationModelABC):
# features
FeatureFlagsEnum.api_only.value: False, # 13.10.2022 #70
FeatureFlagsEnum.presence.value: True, # 03.10.2022 #56
FeatureFlagsEnum.version_in_presence.value: False, # 21.03.2023 #253
}
def get_flag(self, key: FeatureFlagsEnum) -> bool:

View File

@ -111,7 +111,11 @@ class ClientUtilsService(ClientUtilsABC):
import bot
name = self._t.transform(t_key).format(bot.__version__)
if self._feature_flags.get_flag(FeatureFlagsEnum.version_in_presence):
name = f"{bot.__version__} {self._t.transform(t_key)}"
else:
name = self._t.transform(t_key)
await self._bot.change_presence(activity=discord.Game(name=name))
self._logger.info(__name__, f"Set presence {name}")

View File

@ -258,7 +258,6 @@ export class AuthService {
async isUserLoggedInAsync(): Promise<boolean> {
const token = this.getToken();
console.log(1, token);
if (!token || !token.refreshToken) {
this.isLoggedIn$.next(false);