Added get applications function

main
Anorak_1 2023-08-11 10:55:56 +02:00
parent 9aafca25cf
commit 5a4ee3dda3
1 changed files with 8 additions and 0 deletions

View File

@ -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()