diff --git a/dbutil.py b/dbutil.py index 4e54199..b6ae37d 100644 --- a/dbutil.py +++ b/dbutil.py @@ -93,6 +93,14 @@ class GuildAppDB(): if application_name in applications.keys(): return applications[application_name] + def get_applications(guild_id: 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]) + return list(applications.keys()) + def set_response_channel(guild_id: str, application_name: str, channel_id: str) -> str: con = sqlite3.connect("applications.db") cur = con.cursor()