support #381

Merged
edraft merged 31 commits from support into master 2023-09-28 20:03:32 +02:00
Showing only changes of commit fe42d46a38 - Show all commits

View File

@ -1,5 +1,6 @@
import json
from datetime import datetime
from typing import Optional
from cpl_core.configuration import ConfigurationModelABC
from cpl_core.database import TableABC
@ -27,7 +28,7 @@ class ServerConfig(TableABC, ConfigurationModelABC):
help_voice_channel_id: int,
team_channel_id: int,
login_message_channel_id: int,
default_role_id: int,
default_role_id: Optional[int],
feature_flags: dict[FeatureFlagsEnum],
server: Server,
afk_channel_ids: List[int],
@ -76,7 +77,7 @@ class ServerConfig(TableABC, ConfigurationModelABC):
guild.system_channel.id,
guild.system_channel.id,
guild.system_channel.id,
guild.default_role.id,
None,
{},
server,
List(int),
@ -288,7 +289,7 @@ class ServerConfig(TableABC, ConfigurationModelABC):
{self._help_voice_channel_id},
{self._team_channel_id},
{self._login_message_channel_id},
{self._default_role_id},
{"NULL" if self._default_role_id is None else self._default_role_id},
'{json.dumps(self._feature_flags)}',
{self._server.id}
);
@ -313,7 +314,7 @@ class ServerConfig(TableABC, ConfigurationModelABC):
`HelpVoiceChannelId` = {self._help_voice_channel_id},
`TeamChannelId` = {self._team_channel_id},
`LoginMessageChannelId` = {self._login_message_channel_id},
`DefaultRoleId` = {self._default_role_id},
`DefaultRoleId` = {"NULL" if self._default_role_id is None else self._default_role_id},
`FeatureFlags` = '{json.dumps(self._feature_flags)}',
`ServerId` = {self._server.id}
WHERE `Id` = {self._id};