Add Discord channel ID matching (PR #187) and tests for it #202
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Builds on PR #187 (credit to @mraof for adding in the actual change to the code). This adds tests, where I think they're supposed to be? It doesn't actually test that Discord – or the library you're using to interface with it – supports IDs in its API, but this seems to work when I use them in my own config, and these tests should ensure the bot's code itself has no trouble with the IDs.
(IDs can be retrieved by writing, e.g.,
\#general
, which should produce something of the form<#00000000>
. Remove the<#
and>
and use that in the config.)Commit 2ae9e37 was added since the previous check seems to break with this new addition to the config file – it seems to be related to how the items are ordered in the hash and so how they get added to the
channels
list, which I'm pretty sure isn't important anywhere, so I modified it to a check for presence instead of a check that the first item in the list is precisely that.