mirror of
https://github.com/Paillat-dev/Botator.git
synced 2026-01-02 09:16:19 +00:00
✨ feat(server.ts): change port variable case from lowercase port to uppercase PORT to improve semantics
✨ feat(server.ts): add support for process.env.PORT environment variable to be able to run app on a configurable port 🐛 fix(main.py): remove duplicate cog addition in main.py ✨ feat(main.py): add cogs.Help(bot) to the list of cogs in main.py 🐛 fix(main.py): remove redundant import statements in main.py ✨ feat(main.py): add on_guild_remove event handler in main.py ✨ feat(main.py): add on_guild_join event handler in main.py ✨ feat(main.py): add support for discord.Intents in main.py ✨ feat(main.py): add intents.message_content = True in main.py ✨ feat(main.py): add intents.default() in main.py ✨ feat(main.py): add discord.Bot(intents=intents, help_command=None) in main.py ✨ feat(main.py): add import statements in main.py ✨ feat(main.py): add from src.config import debug, discord_token in main.py ✨ feat(main.py): add import discord in main.py ✨ feat(main.py): add import src.config in main.py ✨ feat(main.py): add import src.cogs in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add import src.cogs.channelSetup in main.py ✨ feat(main.py): add import src.cogs.help in main.py ✨ feat(main.py): add import src.cogs.Chat in main.py ✨ feat(main.py): add import src.cogs.ManageChat in main.py ✨ feat(main.py): add import src.cogs.Moderation in main.py ✨ feat(main.py): add import src.cogs.ChannelSetup in main.py ✨ feat(main.py): add import src.cogs.Help in main.py ✨ feat(main.py): add import src.cogs.chat in main.py ✨ feat(main.py): add import src.cogs.manage_chat in main.py ✨ feat(main.py): add import src.cogs.moderation in main.py ✨ feat(main.py): add
This commit is contained in:
24
src/guild.py
24
src/guild.py
@@ -82,18 +82,21 @@ class Guild:
|
||||
def load(self):
|
||||
self.getDbData()
|
||||
|
||||
def addChannel(self, channel: discord.TextChannel, model: str, character: str):
|
||||
print(
|
||||
f"Adding channel {channel.id} to guild {self.id} with model {model} and character {character}"
|
||||
)
|
||||
self.channels[str(channel.id)] = {
|
||||
def addChannel(
|
||||
self, channel: discord.TextChannel | str, model: str, character: str
|
||||
):
|
||||
if isinstance(channel, discord.TextChannel):
|
||||
channel = channel.id
|
||||
self.channels[str(channel)] = {
|
||||
"model": model,
|
||||
"character": character,
|
||||
}
|
||||
self.updateDbData()
|
||||
|
||||
def delChannel(self, channel: discord.TextChannel):
|
||||
del self.channels[str(channel.id)]
|
||||
def delChannel(self, channel: discord.TextChannel | str):
|
||||
if isinstance(channel, discord.TextChannel):
|
||||
channel = channel.id
|
||||
del self.channels[str(channel)]
|
||||
self.updateDbData()
|
||||
|
||||
@property
|
||||
@@ -102,14 +105,17 @@ class Guild:
|
||||
return self.channels
|
||||
if len(self.channels) == 0:
|
||||
return {}
|
||||
return {
|
||||
dictionary = {
|
||||
list(self.channels.keys())[0]: {
|
||||
"model": models.matchingDict[models.default],
|
||||
"character": characters.matchingDict[characters.default],
|
||||
}
|
||||
}
|
||||
if self.channels.get("serverwide", None) is not None:
|
||||
dictionary["serverwide"] = self.channels["serverwide"]
|
||||
return dictionary
|
||||
|
||||
def getChannelInfo(self, channel: str):
|
||||
def getChannelInfo(self, channel: str) -> dict:
|
||||
return self.sanitizedChannels.get(channel, None)
|
||||
|
||||
def addApiKey(self, api: str, key: str):
|
||||
|
||||
Reference in New Issue
Block a user