From 5d8b5b0de0415d0342ab1e47c3389a53a741d634 Mon Sep 17 00:00:00 2001 From: Migatu Date: Tue, 9 Apr 2024 00:44:42 +0200 Subject: [PATCH] test --- bot.py | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index e251d6c..b52fe51 100644 --- a/bot.py +++ b/bot.py @@ -286,7 +286,6 @@ logger.info("Creating discord bot") client = commands.Bot(intents=intents, command_prefix="$") logger.info("Done") logger.info("Creating flask app") -app = Flask(__name__) logger.info("Done") @@ -2213,6 +2212,15 @@ async def krecimy_pornola(ctx): else: ctx.reply("Jak ładnie szefa poprosisz.") +app = Flask(__name__) +@app.route("/mp3", methods=["GET"]) +def get_music_list(): + """ + The function `get_music_list` returns a JSON object containing a list of music files. + :return: A JSON response containing a key "music_file_list" with the value of the variable + `music_file_list`. + """ + return jsonify({"music_file_list": MASTER_TIMEOUT}) @app.route("/conjurer", methods=["GET"]) def answer_external_command(): @@ -2249,7 +2257,7 @@ def waitress_run(_logger): # *================================== Run if __name__ == "__main__": - # TODO: wpakowac kondzia w wąteki odpalic asynchronicznie rownolegle z flaskiem do sterowania nim + # TODO: wpakowac kondzia w wątki odpalic asynchronicznie rownolegle z flaskiem do sterowania nim logger.info("Starting discord bot") threads = [] t1 = threading.Thread(target=client.run, args=(TOKEN,))