From f292124228dca93b10c2b8671b6b5793c52b2124 Mon Sep 17 00:00:00 2001 From: SocksOnHead Date: Fri, 25 Oct 2024 21:38:47 +0200 Subject: [PATCH] Update documentation --- Bot/README.md | 34 +++++++++++++++++++++++++++------- 1 file changed, 27 insertions(+), 7 deletions(-) diff --git a/Bot/README.md b/Bot/README.md index 3bede89..9a8b74e 100644 --- a/Bot/README.md +++ b/Bot/README.md @@ -2,11 +2,15 @@ ```mermaid flowchart TD Program[Program] -->|Register| EventListener + Program --> Intervals[VoiceChannelMonitorService] + Intervals --> SetStatus[SetStatus, Updates status with amount of playing bots] + Intervals --> LeaveChannel[LeaveOnAlone, Leaves channel when alone for a time] EventListener[DiscordEventListener] --> A[MessageReceivedHandler] EventListener[DiscordEventListener] --> A2[SlashCommandReceivedHandler] A --> |Message| f{If bot is mentioned} + A --> |Message '!LunarisStats'| p[Responds with Server and Channel Statistics.] f --> |ChatCommand| v[ChatHandler] A2[SlashCommandReceivedHandler] -->|Message| C{Send to correct command by @@ -14,8 +18,11 @@ flowchart TD C -->|JoinCommand| D[JoinHandler] C -->|PlayCommand| E[PlayHandler] - C -->|HelloCommand| F[HelloHandler] - C -->|GoodbyeCommand| G[GoodbyeHandler] + C -->|PauseCommand| F[PauseHandler] + C -->|DisconnectCommand| H[DisconnectHandler] + C -->|ResumeCommand| J[ResumeHandler] + C -->|SkipCommand| K[SkipHandler] + C -->|ClearQueueCommand| L[ClearQueueHandler] ``` Program registers an event listener ```DiscordEventListener``` which publish a message : @@ -30,20 +37,33 @@ await Mediator.Publish(new MessageReceivedNotification(arg), _cancellationToken) ## Handler integrations ```mermaid -flowchart TD +flowchart LR D[JoinHandler] --> Disc[Discord Api] E[PlayHandler] --> Disc[Discord Api] - F[HelloHandler] --> Disc[Discord Api] - G[GoodbyeHandler] --> Disc[Discord Api] + F[SkipHandler] --> Disc[Discord Api] + G[PauseHandler] --> Disc[Discord Api] v[ChatHandler] --> Disc[Discord Api] + ClearQueueHandler --> Disc + ClearQueuehandler --> Lava + DisconnectHandler --> Disc + Resumehandler --> Disc v --> o[Ollama Server] o --> v E --> Lava[Lavalink] + F --> Lava + G --> Lava ``` |Name| Description | |--|--| | JoinHandler| Handles the logic for **just** joining a voice channel. | | PlayHandler| Handles the logic for joining and playing music in a voice channel. | -| HelloHandler| Responds with Hello. (Dummy handler, will be removed)| -| GoodbyeHandler| Responds with Goodbye. (Dummy handler, will be removed)| +| PauseHandler | Handles the logic for pausing currently playing track. | +| DisconnectHandler | Handles the logic for disconnecting from voicechannels. | +| ClearQueueHandler | Handles the logic for clearing the queued songs, except the currently playing one. | +| SkipHandler | Handles the logic for skipping tracks that are queued. If 0 trackS is in queue, it stops the current one.| +| Resumehandler | Resumes paused tracks. | | ChatHandler| Handles the logic for LLM chat with user. | + + + +