Add support for commands monitoring events-only#3
Open
bmeneg wants to merge 2 commits intomeleca:masterfrom
bmeneg:devel
Open
Add support for commands monitoring events-only#3bmeneg wants to merge 2 commits intomeleca:masterfrom bmeneg:devel
bmeneg wants to merge 2 commits intomeleca:masterfrom
bmeneg:devel
Conversation
Every message or event that has a callback registered passes its information through a generic callback interface, which doesn't care about the source event. It always waits a message to be present, and because of that it's impossible to register 'events-only' commands. New field 'EventCode' on 'Message' structure allows callbacks to events that doesn't require explicit message text, that just the name or code of that event would be enough.
Add support for commands that relies on JOIN event from users in the channel. This support to JOIN was made through the new features on callbacks' interface. For now, just JOIN event can be monitored by commands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Correcting the last PR closed: no changes were made on callback interface, thus not breaking Slack/Telegram calls.
This allow implementation of commands/plugins that relies on JOIN events like the "greetings" command that we were thinking about.
A simple example of using this feature would be like the following one:
If you guys think something could be done in a better way, please let me know.
PS.: this PR solves issue #1