This commit is contained in:
2024-04-09 00:44:42 +02:00
parent 1bcb2aacc2
commit 5d8b5b0de0
+10 -2
View File
@@ -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,))