Gitea IRC Bot

- Switched to using `getRespectiveChannel(string)` for `/commit` and /`issue` handling
This commit is contained in:
Tristan B. Velloza Kildaire 2023-09-24 15:47:32 +02:00
parent c5863751de
commit e4ba063a44
1 changed files with 2 additions and 2 deletions

View File

@ -81,7 +81,7 @@ void commitHandler(HTTPServerRequest request, HTTPServerResponse response)
string repositoryName = json["repository"]["full_name"].str();
/* Extract JUST the repository's name */
toChannel = associations[json["repository"]["name"].str()];
toChannel = getRespectiveChannel(json["repository"]["name"].str());
string ircMessage = bold("["~repositoryName~"]")~setForeground(SimpleColor.GREEN)~" New commit "~resetForegroundBackground()~commitMessage~" ("~commitID~") by "~italics(authorName)~" ("~authorEmail~") ["~underline(commitURL)~"]";
ircBot.channelMessage(ircMessage, toChannel); //TODO: Add IRC error handling
@ -128,7 +128,7 @@ void issueHandler(HTTPServerRequest request, HTTPServerResponse response)
string repositoryName = issueBlock["repository"]["full_name"].str();
/* Extract JUST the repository's name */
toChannel = associations[json["repository"]["name"].str()];
toChannel = getRespectiveChannel(json["repository"]["name"].str());
/* Opened a new issue */
if(cmp(issueAction, "opened") == 0)