forked from sh-edraft.de/sh_discord_bot
Merge branch '0.3' into #28
# Conflicts: # kdb-bot/src/bot/translation/de.json # kdb-bot/src/modules/level/command/level_group.py
This commit is contained in:
commit
57d59e91ac
@ -5,13 +5,11 @@
|
|||||||
"bot": "src/bot/bot.json",
|
"bot": "src/bot/bot.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",
|
||||||
"admin": "src/modules/admin/admin.json",
|
|
||||||
"auto-role": "src/modules/auto_role/auto-role.json",
|
"auto-role": "src/modules/auto_role/auto-role.json",
|
||||||
"base": "src/modules/base/base.json",
|
"base": "src/modules/base/base.json",
|
||||||
"boot-log": "src/modules/boot_log/boot-log.json",
|
"boot-log": "src/modules/boot_log/boot-log.json",
|
||||||
"database": "src/modules/database/database.json",
|
"database": "src/modules/database/database.json",
|
||||||
"level": "src/modules/level/level.json",
|
"level": "src/modules/level/level.json",
|
||||||
"moderator": "src/modules/moderator/moderator.json",
|
|
||||||
"permission": "src/modules/permission/permission.json",
|
"permission": "src/modules/permission/permission.json",
|
||||||
"bot-api": "src/bot_api/bot-api.json",
|
"bot-api": "src/bot_api/bot-api.json",
|
||||||
"get-version": "tools/get_version/get-version.json",
|
"get-version": "tools/get_version/get-version.json",
|
||||||
|
@ -4,13 +4,11 @@ from bot_api.api_module import ApiModule
|
|||||||
from bot_core.core_extension.core_extension_module import CoreExtensionModule
|
from bot_core.core_extension.core_extension_module import CoreExtensionModule
|
||||||
from bot_core.core_module import CoreModule
|
from bot_core.core_module import CoreModule
|
||||||
from bot_data.data_module import DataModule
|
from bot_data.data_module import DataModule
|
||||||
from modules.admin.admin_module import AdminModule
|
|
||||||
from modules.auto_role.auto_role_module import AutoRoleModule
|
from modules.auto_role.auto_role_module import AutoRoleModule
|
||||||
from modules.base.base_module import BaseModule
|
from modules.base.base_module import BaseModule
|
||||||
from modules.boot_log.boot_log_module import BootLogModule
|
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.moderator.moderator_module import ModeratorModule
|
|
||||||
from modules.permission.permission_module import PermissionModule
|
from modules.permission.permission_module import PermissionModule
|
||||||
|
|
||||||
|
|
||||||
@ -22,12 +20,10 @@ class ModuleList:
|
|||||||
return List(type, [
|
return List(type, [
|
||||||
CoreModule, # has to be first!
|
CoreModule, # has to be first!
|
||||||
DataModule,
|
DataModule,
|
||||||
AdminModule,
|
|
||||||
AutoRoleModule,
|
AutoRoleModule,
|
||||||
BaseModule,
|
BaseModule,
|
||||||
DatabaseModule,
|
DatabaseModule,
|
||||||
LevelModule,
|
LevelModule,
|
||||||
ModeratorModule,
|
|
||||||
PermissionModule,
|
PermissionModule,
|
||||||
ApiModule,
|
ApiModule,
|
||||||
# has to be last!
|
# has to be last!
|
||||||
|
@ -193,10 +193,17 @@
|
|||||||
"seeding_failed": "Levelsystem konnte nicht neu geladen werden.",
|
"seeding_failed": "Levelsystem konnte nicht neu geladen werden.",
|
||||||
"seeding_finished": "Levelsystem wurde Erfolgreich neu geladen."
|
"seeding_finished": "Levelsystem wurde Erfolgreich neu geladen."
|
||||||
},
|
},
|
||||||
|
"remove": {
|
||||||
|
"success": "Level {} wurde entfernt :D",
|
||||||
|
"error": {
|
||||||
|
"not_found": "Level {} nicht gefunden!"
|
||||||
|
}
|
||||||
|
},
|
||||||
"down": {
|
"down": {
|
||||||
"already_first": "{} hat bereits das erste Level.",
|
"already_first": "{} hat bereits das erste Level.",
|
||||||
"success": "{} wurde auf Level {} runtergesetzt :)",
|
"success": "{} wurde auf Level {} runtergesetzt :)",
|
||||||
"failed": "{} konnte nicht runtergesetzt werden :("
|
"failed": "{} konnte nicht runtergesetzt werden :("
|
||||||
|
"created": "Level {} mit Berechtigungen {} wurde erstellt."
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"database": {},
|
"database": {},
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
bot Keksdose bot
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
|
||||||
|
|
||||||
:copyright: (c) 2022 sh-edraft.de
|
|
||||||
:license: MIT, see LICENSE for more details.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
__title__ = 'modules.admin'
|
|
||||||
__author__ = 'Sven Heidemann'
|
|
||||||
__license__ = 'MIT'
|
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
|
||||||
__version__ = '0.3.dev25'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
|
||||||
version_info = VersionInfo(major='0', minor='3', micro='dev25')
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"ProjectSettings": {
|
|
||||||
"Name": "admin",
|
|
||||||
"Version": {
|
|
||||||
"Major": "1",
|
|
||||||
"Minor": "0",
|
|
||||||
"Micro": "0"
|
|
||||||
},
|
|
||||||
"Author": "",
|
|
||||||
"AuthorEmail": "",
|
|
||||||
"Description": "",
|
|
||||||
"LongDescription": "",
|
|
||||||
"URL": "",
|
|
||||||
"CopyrightDate": "",
|
|
||||||
"CopyrightName": "",
|
|
||||||
"LicenseName": "",
|
|
||||||
"LicenseDescription": "",
|
|
||||||
"Dependencies": [
|
|
||||||
"cpl-core>=2022.10.0.post5"
|
|
||||||
],
|
|
||||||
"DevDependencies": [
|
|
||||||
"cpl-cli==2022.10.0"
|
|
||||||
],
|
|
||||||
"PythonVersion": ">=3.10.4",
|
|
||||||
"PythonPath": {},
|
|
||||||
"Classifiers": []
|
|
||||||
},
|
|
||||||
"BuildSettings": {
|
|
||||||
"ProjectType": "library",
|
|
||||||
"SourcePath": "",
|
|
||||||
"OutputPath": "../../dist",
|
|
||||||
"Main": "admin.main",
|
|
||||||
"EntryPoint": "admin",
|
|
||||||
"IncludePackageData": false,
|
|
||||||
"Included": [],
|
|
||||||
"Excluded": [
|
|
||||||
"*/__pycache__",
|
|
||||||
"*/logs",
|
|
||||||
"*/tests"
|
|
||||||
],
|
|
||||||
"PackageData": {},
|
|
||||||
"ProjectReferences": []
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
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.admin.command.restart_command import RestartCommand
|
|
||||||
from modules.admin.command.shutdown_command import ShutdownCommand
|
|
||||||
|
|
||||||
|
|
||||||
class AdminModule(ModuleABC):
|
|
||||||
|
|
||||||
def __init__(self, dc: DiscordCollectionABC):
|
|
||||||
ModuleABC.__init__(self, dc, FeatureFlagsEnum.admin_module)
|
|
||||||
|
|
||||||
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
|
||||||
# commands
|
|
||||||
self._dc.add_command(RestartCommand)
|
|
||||||
self._dc.add_command(ShutdownCommand)
|
|
||||||
# events
|
|
@ -1,26 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
bot Keksdose bot
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
|
||||||
|
|
||||||
:copyright: (c) 2022 sh-edraft.de
|
|
||||||
:license: MIT, see LICENSE for more details.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
__title__ = 'modules.admin.command'
|
|
||||||
__author__ = 'Sven Heidemann'
|
|
||||||
__license__ = 'MIT'
|
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
|
||||||
__version__ = '0.3.dev25'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
|
||||||
version_info = VersionInfo(major='0', minor='3', micro='dev25')
|
|
@ -11,6 +11,10 @@ from modules.base.command.afk_command import AFKCommand
|
|||||||
from modules.base.command.help_command import HelpCommand
|
from modules.base.command.help_command import HelpCommand
|
||||||
from modules.base.command.info_command import InfoCommand
|
from modules.base.command.info_command import InfoCommand
|
||||||
from modules.base.command.ping_command import PingCommand
|
from modules.base.command.ping_command import PingCommand
|
||||||
|
from modules.base.command.purge_command import PurgeCommand
|
||||||
|
from modules.base.command.restart_command import RestartCommand
|
||||||
|
from modules.base.command.shutdown_command import ShutdownCommand
|
||||||
|
from modules.base.command.user_group import UserGroup
|
||||||
from modules.base.events.base_on_command_error_event import BaseOnCommandErrorEvent
|
from modules.base.events.base_on_command_error_event import BaseOnCommandErrorEvent
|
||||||
from modules.base.events.base_on_command_event import BaseOnCommandEvent
|
from modules.base.events.base_on_command_event import BaseOnCommandEvent
|
||||||
from modules.base.events.base_on_member_join_event import BaseOnMemberJoinEvent
|
from modules.base.events.base_on_member_join_event import BaseOnMemberJoinEvent
|
||||||
@ -35,6 +39,11 @@ class BaseModule(ModuleABC):
|
|||||||
self._dc.add_command(HelpCommand)
|
self._dc.add_command(HelpCommand)
|
||||||
self._dc.add_command(InfoCommand)
|
self._dc.add_command(InfoCommand)
|
||||||
self._dc.add_command(PingCommand)
|
self._dc.add_command(PingCommand)
|
||||||
|
|
||||||
|
self._dc.add_command(RestartCommand)
|
||||||
|
self._dc.add_command(ShutdownCommand)
|
||||||
|
self._dc.add_command(PurgeCommand)
|
||||||
|
self._dc.add_command(UserGroup)
|
||||||
# events
|
# events
|
||||||
self._dc.add_event(DiscordEventTypesEnum.on_command.value, BaseOnCommandEvent)
|
self._dc.add_event(DiscordEventTypesEnum.on_command.value, BaseOnCommandEvent)
|
||||||
self._dc.add_event(DiscordEventTypesEnum.on_command_error.value, BaseOnCommandErrorEvent)
|
self._dc.add_event(DiscordEventTypesEnum.on_command_error.value, BaseOnCommandErrorEvent)
|
||||||
|
@ -14,7 +14,6 @@ from bot_core.abc.message_service_abc import MessageServiceABC
|
|||||||
from bot_core.logging.command_logger import CommandLogger
|
from bot_core.logging.command_logger import CommandLogger
|
||||||
from bot_data.abc.level_repository_abc import LevelRepositoryABC
|
from bot_data.abc.level_repository_abc import LevelRepositoryABC
|
||||||
from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
from bot_data.abc.server_repository_abc import ServerRepositoryABC
|
||||||
from bot_data.abc.user_repository_abc import UserRepositoryABC
|
|
||||||
from bot_data.model.level import Level
|
from bot_data.model.level import Level
|
||||||
from modules.level.level_seeder import LevelSeeder
|
from modules.level.level_seeder import LevelSeeder
|
||||||
from modules.level.service.level_service import LevelService
|
from modules.level.service.level_service import LevelService
|
||||||
@ -31,10 +30,9 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
client_utils: ClientUtilsServiceABC,
|
client_utils: ClientUtilsServiceABC,
|
||||||
permission_service: PermissionServiceABC,
|
permission_service: PermissionServiceABC,
|
||||||
translate: TranslatePipe,
|
translate: TranslatePipe,
|
||||||
db: DatabaseContextABC,
|
db_context: DatabaseContextABC,
|
||||||
levels: LevelRepositoryABC,
|
levels: LevelRepositoryABC,
|
||||||
servers: ServerRepositoryABC,
|
servers: ServerRepositoryABC,
|
||||||
users: UserRepositoryABC,
|
|
||||||
level_service: LevelService,
|
level_service: LevelService,
|
||||||
level_seeder: LevelSeeder,
|
level_seeder: LevelSeeder,
|
||||||
):
|
):
|
||||||
@ -46,10 +44,9 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
self._client_utils = client_utils
|
self._client_utils = client_utils
|
||||||
self._permissions = permission_service
|
self._permissions = permission_service
|
||||||
self._t = translate
|
self._t = translate
|
||||||
self._db = db
|
self._db_context = db_context
|
||||||
self._levels = levels
|
self._levels = levels
|
||||||
self._servers = servers
|
self._servers = servers
|
||||||
self._users = users
|
|
||||||
|
|
||||||
self._level_service = level_service
|
self._level_service = level_service
|
||||||
self._level_seeder = level_seeder
|
self._level_seeder = level_seeder
|
||||||
@ -139,7 +136,7 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
self._levels.add_level(level)
|
self._levels.add_level(level)
|
||||||
self._db.save_changes()
|
self._db_context.save_changes()
|
||||||
self._logger.info(__name__, f'Saved level {name} with color {color}, min_xp {min_xp} and permissions {permissions}')
|
self._logger.info(__name__, f'Saved level {name} with color {color}, min_xp {min_xp} and permissions {permissions}')
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self._logger.error(__name__, f'Could not save level {name} with color {color}, min_xp {min_xp} and permissions {permissions}', e)
|
self._logger.error(__name__, f'Could not save level {name} with color {color}, min_xp {min_xp} and permissions {permissions}', e)
|
||||||
@ -187,6 +184,53 @@ class LevelGroup(DiscordCommandABC):
|
|||||||
# https://discordpy.readthedocs.io/en/latest/api.html#discord.Colour.to_rgb
|
# https://discordpy.readthedocs.io/en/latest/api.html#discord.Colour.to_rgb
|
||||||
return [app_commands.Choice(name=self._t.transform(f'common.colors.{color}'), value=f'rgb({code[0]}, {code[1]}, {code[2]})') for color, code in colors]
|
return [app_commands.Choice(name=self._t.transform(f'common.colors.{color}'), value=f'rgb({code[0]}, {code[1]}, {code[2]})') for color, code in colors]
|
||||||
|
|
||||||
|
@level.command()
|
||||||
|
@commands.guild_only()
|
||||||
|
async def remove(self, ctx: Context, level: str):
|
||||||
|
self._logger.debug(__name__, f'Received command level remove {ctx}')
|
||||||
|
|
||||||
|
if not await self._client_utils.check_if_bot_is_ready_yet_and_respond(ctx):
|
||||||
|
return
|
||||||
|
|
||||||
|
if not self._permissions.is_member_admin(ctx.author):
|
||||||
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('common.no_permission_message'))
|
||||||
|
self._logger.trace(__name__, f'Finished command level remove')
|
||||||
|
return
|
||||||
|
|
||||||
|
if ctx.guild is None:
|
||||||
|
self._logger.trace(__name__, f'Finished command level remove')
|
||||||
|
return
|
||||||
|
|
||||||
|
server = self._servers.get_server_by_discord_id(ctx.guild.id)
|
||||||
|
level_from_db = self._levels.get_levels_by_server_id(server.server_id).where(lambda l: l.name == level).first_or_default()
|
||||||
|
if level_from_db is None:
|
||||||
|
self._logger.debug(__name__, f'level {level} not found')
|
||||||
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.level.remove.error.not_found').format(level))
|
||||||
|
self._logger.trace(__name__, f'Finished command level remove')
|
||||||
|
return
|
||||||
|
|
||||||
|
try:
|
||||||
|
self._levels.delete_level(level_from_db)
|
||||||
|
self._db_context.save_changes()
|
||||||
|
guild: Guild = self._bot.guilds.where(lambda g: g == ctx.guild).single()
|
||||||
|
role: Role = guild.roles.where(lambda r: r.name == level).single_or_default()
|
||||||
|
if role is not None:
|
||||||
|
await role.delete()
|
||||||
|
self._logger.info(__name__, f'Removed level {level}')
|
||||||
|
except Exception as e:
|
||||||
|
self._logger.error(__name__, f'Could not remove level {level}', e)
|
||||||
|
else:
|
||||||
|
await self._message_service.send_ctx_msg(ctx, self._t.transform('modules.level.remove.success').format(level))
|
||||||
|
await self._seed_levels(ctx.channel)
|
||||||
|
|
||||||
|
self._logger.trace(__name__, f'Finished command level remove')
|
||||||
|
|
||||||
|
@remove.autocomplete('level')
|
||||||
|
async def remove_autocomplete(self, interaction: discord.Interaction, current: str) -> TList[app_commands.Choice[str]]:
|
||||||
|
server = self._servers.get_server_by_discord_id(interaction.guild.id)
|
||||||
|
levels = self._levels.get_levels_by_server_id(server.server_id).select(lambda l: l.name)
|
||||||
|
return [app_commands.Choice(name=level, value=level) for level in levels]
|
||||||
|
|
||||||
@level.command()
|
@level.command()
|
||||||
@commands.guild_only()
|
@commands.guild_only()
|
||||||
async def down(self, ctx: Context, member: discord.Member):
|
async def down(self, ctx: Context, member: discord.Member):
|
||||||
|
@ -1,26 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
bot Keksdose bot
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
|
||||||
|
|
||||||
:copyright: (c) 2022 sh-edraft.de
|
|
||||||
:license: MIT, see LICENSE for more details.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
__title__ = 'modules.moderator'
|
|
||||||
__author__ = 'Sven Heidemann'
|
|
||||||
__license__ = 'MIT'
|
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
|
||||||
__version__ = '0.3.dev25'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
|
||||||
version_info = VersionInfo(major='0', minor='3', micro='dev25')
|
|
@ -1,26 +0,0 @@
|
|||||||
# -*- coding: utf-8 -*-
|
|
||||||
|
|
||||||
"""
|
|
||||||
bot Keksdose bot
|
|
||||||
~~~~~~~~~~~~~~~~~~~
|
|
||||||
|
|
||||||
Discord bot for the Keksdose discord Server
|
|
||||||
|
|
||||||
:copyright: (c) 2022 sh-edraft.de
|
|
||||||
:license: MIT, see LICENSE for more details.
|
|
||||||
|
|
||||||
"""
|
|
||||||
|
|
||||||
__title__ = 'modules.moderator.command'
|
|
||||||
__author__ = 'Sven Heidemann'
|
|
||||||
__license__ = 'MIT'
|
|
||||||
__copyright__ = 'Copyright (c) 2022 sh-edraft.de'
|
|
||||||
__version__ = '0.3.dev25'
|
|
||||||
|
|
||||||
from collections import namedtuple
|
|
||||||
|
|
||||||
|
|
||||||
# imports:
|
|
||||||
|
|
||||||
VersionInfo = namedtuple('VersionInfo', 'major minor micro')
|
|
||||||
version_info = VersionInfo(major='0', minor='3', micro='dev25')
|
|
@ -1,44 +0,0 @@
|
|||||||
{
|
|
||||||
"ProjectSettings": {
|
|
||||||
"Name": "moderator",
|
|
||||||
"Version": {
|
|
||||||
"Major": "1",
|
|
||||||
"Minor": "0",
|
|
||||||
"Micro": "0"
|
|
||||||
},
|
|
||||||
"Author": "",
|
|
||||||
"AuthorEmail": "",
|
|
||||||
"Description": "",
|
|
||||||
"LongDescription": "",
|
|
||||||
"URL": "",
|
|
||||||
"CopyrightDate": "",
|
|
||||||
"CopyrightName": "",
|
|
||||||
"LicenseName": "",
|
|
||||||
"LicenseDescription": "",
|
|
||||||
"Dependencies": [
|
|
||||||
"cpl-core>=2022.10.0.post5"
|
|
||||||
],
|
|
||||||
"DevDependencies": [
|
|
||||||
"cpl-cli==2022.10.0"
|
|
||||||
],
|
|
||||||
"PythonVersion": ">=3.10.4",
|
|
||||||
"PythonPath": {},
|
|
||||||
"Classifiers": []
|
|
||||||
},
|
|
||||||
"BuildSettings": {
|
|
||||||
"ProjectType": "library",
|
|
||||||
"SourcePath": "",
|
|
||||||
"OutputPath": "../../dist",
|
|
||||||
"Main": "moderator.main",
|
|
||||||
"EntryPoint": "moderator",
|
|
||||||
"IncludePackageData": false,
|
|
||||||
"Included": [],
|
|
||||||
"Excluded": [
|
|
||||||
"*/__pycache__",
|
|
||||||
"*/logs",
|
|
||||||
"*/tests"
|
|
||||||
],
|
|
||||||
"PackageData": {},
|
|
||||||
"ProjectReferences": []
|
|
||||||
}
|
|
||||||
}
|
|
@ -1,24 +0,0 @@
|
|||||||
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.moderator.command.purge_command import PurgeCommand
|
|
||||||
from modules.moderator.command.user_group import UserGroup
|
|
||||||
|
|
||||||
|
|
||||||
class ModeratorModule(ModuleABC):
|
|
||||||
|
|
||||||
def __init__(self, dc: DiscordCollectionABC):
|
|
||||||
ModuleABC.__init__(self, dc, FeatureFlagsEnum.moderator_module)
|
|
||||||
|
|
||||||
def configure_configuration(self, config: ConfigurationABC, env: ApplicationEnvironmentABC):
|
|
||||||
pass
|
|
||||||
|
|
||||||
def configure_services(self, services: ServiceCollectionABC, env: ApplicationEnvironmentABC):
|
|
||||||
# commands
|
|
||||||
self._dc.add_command(PurgeCommand)
|
|
||||||
self._dc.add_command(UserGroup)
|
|
||||||
# events
|
|
Loading…
Reference in New Issue
Block a user