Added get_response_channel

main
Anorak_1 2023-08-12 13:29:10 +02:00
parent 75c3f98c98
commit 0d28df7868
1 changed files with 9 additions and 0 deletions

View File

@ -139,6 +139,15 @@ class GuildAppDB():
else:
return "error on set response channel: application not found"
def get_response_channel(guild_id: str, application_name: str) -> str:
con = sqlite3.connect("applications.db")
cur = con.cursor()
cur.execute("SELECT applications_blob FROM app_guildapp_db WHERE guild_id=(?)", (guild_id, ))
application_blob = cur.fetchone()
applications = pickle.loads(application_blob[0])
if application_name in applications.keys():
return applications[application_name]["resp_channel"]
def add_question(guild_id: str, application_name: str, question: str) -> str:
con = sqlite3.connect("applications.db")
cur = con.cursor()