add tasks to commands

This commit is contained in:
2024-06-17 21:58:13 +02:00
parent 465a4c2f03
commit b427531896

View File

@@ -7,23 +7,6 @@ from my_project_name.caldav_handler import CaldavHandler
import json
import requests
def weekly_reminder():
api_url = "https://tasklist.malobeo.org/api/next"
response = requests.get(api_url)
if response.status_code != 200:
return "Error requesting " + api_url + " Status Code: " + str(response.status_code)
data = response.json()
message = "# Weekly Task Reminder\n"
for task in data:
message += "- {}: **{}**\n".format(task["Name"], task["Value"])
message += "\n*Write* ```!c tasks``` *to get details about the tasks*"
return message
def task_help():
api_url = "https://tasklist.malobeo.org/api/next"
response = requests.get(api_url)
@@ -146,7 +129,7 @@ class Command:
if topic == "rules":
text = "be nice to each other."
elif topic == "commands":
text = "Available commands: today, week, month"
text = "Available commands: today, week, month, tasks"
else:
text = "I dont know what you are talking about.."
await send_text_to_room(self.client, self.room.room_id, text)