refactor(help.py, settings.py): remove debug import and debug statements

feat(settings.py): add ctx_to_guid function to convert context to guild id for database queries
feat(settings.py): add support for changing the model used by the bot
fix(settings.py): fix images command not updating the database correctly

feat(cogs/setup.py): add dms_only check to setup_dms command
refactor(cogs/setup.py): move ctx_to_guid function to config.py
refactor(cogs/setup.py): move mg_to_guid function to config.py

feat(makeprompt.py): add support for DMs conversations
fix(makeprompt.py): fix images setting retrieval from database
fix(makeprompt.py): fix guild_id to guid conversion in database queries
refactor(makeprompt.py): extract historicator function to get the channel or user of a message
refactor(makeprompt.py): remove debug statements and unused variables
This commit is contained in:
Paillat
2023-05-05 12:38:02 +02:00
parent f8907667e0
commit 94974b2bd3
5 changed files with 185 additions and 139 deletions

View File

@@ -23,8 +23,18 @@ def debug(message):
else:
print(message)
def ctx_to_guid(ctx):
if ctx.guild is None:
return ctx.author.id
else:
return ctx.guild.id
def mg_to_guid(mg):
if mg.guild is None:
return mg.author.id
else:
return mg.guild.id
# connect to the database
con_data = sqlite3.connect("../database/data.db")
curs_data = con_data.cursor()
con_premium = sqlite3.connect("../database/premium.db")