tjarbo / discord-moodle-bot

Get notified about changes on moodle on you favorite platform!
https://docs.tjarbo.me/moodle-notification-service/1.0.0/home
GNU Affero General Public License v3.0
25 stars 2 forks source link

✨ Use the rich precense feature of discord to communicate the current update status. #84

Open tjarbo opened 3 years ago

tjarbo commented 3 years ago

As a User I want to see directly in Discord when the Bot will fetch for updates next time. so that I can estimate if it will be better to trigger the bot manually.

Description:

The Rich Presence feature of Discord looks very cool and bots can communicate over it for example how to get started (e.g. "Listens for !help"). We can use this feature to display the current moodle-fetch status.

Let's define the following states: Description Text
STATE-1 Bot is looking for updates "Schaut nach Updates!
STATE-2 Bot will look for updates again at 5:12 pm "Schaut um 17:12 wieder nach."

Links:

Idea by @Stektax https://github.com/tjarbo/discord-moodle-bot/issues/83#issuecomment-759320571

🟢 In scope:

🔴 Not in scope:

What should be the result?

IF the bot starts to fetch new updates THEN the activity will be set to STATE-1

IF the bot finished fetching updates, THEN the activity will display the timestamp of the next fetch.

antonplagemann commented 3 years ago

Coole Idee! Ich denke nur das der STATE-1 (Bot is looking for updates) zu kurz vorliegt um vernünftig angezeigt zu werden. Ein Fetch dauert meist unter einer Sekunde, daher würde vermutlich kaum jemand je diesen Status sehen.

Stektax commented 3 years ago

Vielleicht wäre es besser dass der Bot wenn er Fertig ist den Status "Fetch Finished" für ein paar Sekunden anzeigt. oder halt wenn er gerade dabei ist, das halt auch für X sekunden anzeigt

tjarbo commented 3 years ago

Coole Idee! Ich denke nur das der STATE-1 (Bot is looking for updates) zu kurz vorliegt um vernünftig angezeigt zu werden. Ein Fetch dauert meist unter einer Sekunde, daher würde vermutlich kaum jemand je diesen Status sehen.

@antonplagemann Kann natürlich auch sein, dass die Verarbeitung mal etwas länger andauert. Sei es durch eine langsame Moodle Instanz oder einfach die Menge an Daten :package::package::package::package:

Ich denke, es wäre hierfür mal sinnvoll zu schauen, wie funktional die Discord-API dafür ist und wir es einfach ausprobieren. Kann natürlich auch sein, dass die API zu langsam ist, man also als Endnutzer nichts sieht oder vielleicht auch der Ratelimiter dazwischen funkt, weil wir die Aktivität mehrmals innerhalb einer Sekunde ändern. Versuchen wir es einfach :scientist:

tjarbo commented 3 years ago

Vielleicht wäre es besser dass der Bot wenn er Fertig ist den Status "Fetch Finished" für ein paar Sekunden anzeigt. oder halt wenn er gerade dabei ist, das halt auch für X sekunden anzeigt

Dass er fertig wäre, würde ja durch die Anzeige eines neuen Zeitstempels verdeutlicht werden - also STATE-2. Aber vielleicht denke ich da zu vereinfacht :smile: Wie siehst du das @antonplagemann ?