Added logic to call statistics #46
This commit is contained in:
parent
c6a5d49942
commit
a57c8da72a
@ -3,6 +3,7 @@
|
|||||||
"DefaultProject": "bot",
|
"DefaultProject": "bot",
|
||||||
"Projects": {
|
"Projects": {
|
||||||
"bot": "src/bot/bot.json",
|
"bot": "src/bot/bot.json",
|
||||||
|
"bot-api": "src/bot_api/bot-api.json",
|
||||||
"bot-core": "src/bot_core/bot-core.json",
|
"bot-core": "src/bot_core/bot-core.json",
|
||||||
"bot-data": "src/bot_data/bot-data.json",
|
"bot-data": "src/bot_data/bot-data.json",
|
||||||
"auto-role": "src/modules/auto_role/auto-role.json",
|
"auto-role": "src/modules/auto_role/auto-role.json",
|
||||||
@ -11,7 +12,7 @@
|
|||||||
"database": "src/modules/database/database.json",
|
"database": "src/modules/database/database.json",
|
||||||
"level": "src/modules/level/level.json",
|
"level": "src/modules/level/level.json",
|
||||||
"permission": "src/modules/permission/permission.json",
|
"permission": "src/modules/permission/permission.json",
|
||||||
"bot-api": "src/bot_api/bot-api.json",
|
"stats": "src/modules/stats/stats.json",
|
||||||
"get-version": "tools/get_version/get-version.json",
|
"get-version": "tools/get_version/get-version.json",
|
||||||
"post-build": "tools/post_build/post-build.json",
|
"post-build": "tools/post_build/post-build.json",
|
||||||
"set-version": "tools/set_version/set-version.json"
|
"set-version": "tools/set_version/set-version.json"
|
||||||
|
@ -10,6 +10,7 @@ from modules.boot_log.boot_log_module import BootLogModule
|
|||||||
from modules.database.database_module import DatabaseModule
|
from modules.database.database_module import DatabaseModule
|
||||||
from modules.level.level_module import LevelModule
|
from modules.level.level_module import LevelModule
|
||||||
from modules.permission.permission_module import PermissionModule
|
from modules.permission.permission_module import PermissionModule
|
||||||
|
from modules.stats.stats_module import StatsModule
|
||||||
|
|
||||||
|
|
||||||
class ModuleList:
|
class ModuleList:
|
||||||
@ -26,6 +27,7 @@ class ModuleList:
|
|||||||
LevelModule,
|
LevelModule,
|
||||||
PermissionModule,
|
PermissionModule,
|
||||||
ApiModule,
|
ApiModule,
|
||||||
|
StatsModule,
|
||||||
# has to be last!
|
# has to be last!
|
||||||
BootLogModule,
|
BootLogModule,
|
||||||
CoreExtensionModule,
|
CoreExtensionModule,
|
||||||
|
@ -11,7 +11,7 @@ Discord bot for the Keksdose discord Server
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'bot_api.abc'
|
__title__ = 'bot_api.service'
|
||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
||||||
|
@ -11,7 +11,7 @@ Discord bot for the Keksdose discord Server
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'bot_core.abc'
|
__title__ = 'bot_core.service'
|
||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
||||||
|
@ -2,7 +2,6 @@ from enum import Enum
|
|||||||
|
|
||||||
|
|
||||||
class FeatureFlagsEnum(Enum):
|
class FeatureFlagsEnum(Enum):
|
||||||
|
|
||||||
# modules
|
# modules
|
||||||
api_module = 'ApiModule'
|
api_module = 'ApiModule'
|
||||||
admin_module = 'AdminModule'
|
admin_module = 'AdminModule'
|
||||||
@ -16,6 +15,7 @@ class FeatureFlagsEnum(Enum):
|
|||||||
level_module = 'LevelModule'
|
level_module = 'LevelModule'
|
||||||
moderator_module = 'ModeratorModule'
|
moderator_module = 'ModeratorModule'
|
||||||
permission_module = 'PermissionModule'
|
permission_module = 'PermissionModule'
|
||||||
|
stats_module = 'StatsModule'
|
||||||
# features
|
# features
|
||||||
api_only = 'ApiOnly'
|
api_only = 'ApiOnly'
|
||||||
presence = 'Presence'
|
presence = 'Presence'
|
||||||
|
@ -25,6 +25,7 @@ class FeatureFlagsSettings(ConfigurationModelABC):
|
|||||||
FeatureFlagsEnum.database_module.value: True, # 02.10.2022 #48
|
FeatureFlagsEnum.database_module.value: True, # 02.10.2022 #48
|
||||||
FeatureFlagsEnum.moderator_module.value: False, # 02.10.2022 #48
|
FeatureFlagsEnum.moderator_module.value: False, # 02.10.2022 #48
|
||||||
FeatureFlagsEnum.permission_module.value: True, # 02.10.2022 #48
|
FeatureFlagsEnum.permission_module.value: True, # 02.10.2022 #48
|
||||||
|
FeatureFlagsEnum.stats_module.value: True, # 08.11.2022 #46
|
||||||
# features
|
# features
|
||||||
FeatureFlagsEnum.api_only.value: False, # 13.10.2022 #70
|
FeatureFlagsEnum.api_only.value: False, # 13.10.2022 #70
|
||||||
FeatureFlagsEnum.presence.value: True, # 03.10.2022 #56
|
FeatureFlagsEnum.presence.value: True, # 03.10.2022 #56
|
||||||
|
@ -11,7 +11,7 @@ Discord bot for the Keksdose discord Server
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'bot_data.abc'
|
__title__ = 'bot_data.service'
|
||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
||||||
|
@ -11,7 +11,7 @@ Discord bot for the Keksdose discord Server
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'modules.base.abc'
|
__title__ = 'modules.base.service'
|
||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
||||||
|
@ -11,7 +11,7 @@ Discord bot for the Keksdose discord Server
|
|||||||
|
|
||||||
"""
|
"""
|
||||||
|
|
||||||
__title__ = 'modules.permission.abc'
|
__title__ = 'modules.permission.service'
|
||||||
__author__ = 'Sven Heidemann'
|
__author__ = 'Sven Heidemann'
|
||||||
__license__ = 'MIT'
|
__license__ = 'MIT'
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
||||||
|
24
kdb-bot/src/modules/stats/stats_module.py
Normal file
24
kdb-bot/src/modules/stats/stats_module.py
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
from cpl_core.configuration import ConfigurationABC
|
||||||
|
from cpl_core.dependency_injection import ServiceCollectionABC
|
||||||
|
from cpl_core.environment import ApplicationEnvironmentABC
|
||||||
|
from cpl_discord.service.discord_collection_abc import DiscordCollectionABC
|
||||||
|
|
||||||
|
from bot_core.abc.module_abc import ModuleABC
|
||||||
|
from bot_core.configuration.feature_flags_enum import FeatureFlagsEnum
|
||||||
|
from modules.stats.command.stats_group import StatsGroup
|
||||||
|
from modules.stats.service.statistic_service import StatisticService
|
||||||
|
|
||||||
|
|
||||||
|
class StatsModule(ModuleABC):
|
||||||
|
|
||||||
|
def __init__(self, dc: DiscordCollectionABC):
|
||||||
|
ModuleABC.__init__(self, dc, FeatureFlagsEnum.stats_module)
|
||||||
|
|
||||||
|
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
||||||
|
pass
|
||||||
|
|
||||||
|
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
||||||
|
services.add_transient(StatisticService)
|
||||||
|
# commands
|
||||||
|
self._dc.add_command(StatsGroup)
|
||||||
|
# events
|
0
kdb-bot/src/modules/stats/test/__init__.py
Normal file
0
kdb-bot/src/modules/stats/test/__init__.py
Normal file
Loading…
Reference in New Issue
Block a user