- Construct a list of channels in which to join one-shot
This commit is contained in:
Tristan B. Velloza Kildaire 2023-07-04 12:15:59 +02:00
parent 1def85e5d2
commit e6eb559117
1 changed files with 7 additions and 2 deletions

View File

@ -230,7 +230,7 @@ string ntfyServer, ntfyChannel;
string serverHost;
ushort serverPort;
string nickname;
string channelName;
string[] channels;
string[string] associations;
/**
@ -307,11 +307,16 @@ void main(string[] args)
/**
* Mapping between `repo -> #channel`
*
* Extract from the JSON, build the map
* and also construct a list of channels
* 9which we will use later to join
*/
JSONValue[string] channelAssociations = ircBlock["channels"].object();
foreach(string repoName; channelAssociations.keys())
{
associations[repoName] = channelAssociations[repoName].str();
channels ~= associations[repoName];
}
@ -368,7 +373,7 @@ void main(string[] args)
/* Join the requested channels */
Thread.sleep(dur!("seconds")(4));
ircBot.joinChannel(associations.keys());
ircBot.joinChannel(channels);
/* Setup the web server */