diff --git a/dbutil.py b/dbutil.py index 7d4445c..b760aac 100644 --- a/dbutil.py +++ b/dbutil.py @@ -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()