{"action":"created","issue":{"url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/54","repository_url":"https://api.github.com/repos/FuelRats/pipsqueak3","labels_url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/54/comments","events_url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/54/events","html_url":"https://github.com/FuelRats/pipsqueak3/pull/54","id":337878335,"node_id":"MDExOlB1bGxSZXF1ZXN0MTk4OTQ3MjY0","number":54,"title":"SPARK-54, SPARK-55 and SPARK-56: Rule decorator improvements","user":{"login":"MHajoha","id":29020266,"node_id":"MDQ6VXNlcjI5MDIwMjY2","avatar_url":"https://avatars0.githubusercontent.com/u/29020266?v=4","gravatar_id":"","url":"https://api.github.com/users/MHajoha","html_url":"https://github.com/MHajoha","followers_url":"https://api.github.com/users/MHajoha/followers","following_url":"https://api.github.com/users/MHajoha/following{/other_user}","gists_url":"https://api.github.com/users/MHajoha/gists{/gist_id}","starred_url":"https://api.github.com/users/MHajoha/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MHajoha/subscriptions","organizations_url":"https://api.github.com/users/MHajoha/orgs","repos_url":"https://api.github.com/users/MHajoha/repos","events_url":"https://api.github.com/users/MHajoha/events{/privacy}","received_events_url":"https://api.github.com/users/MHajoha/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-07-03T12:30:48Z","updated_at":"2018-08-22T17:15:39Z","closed_at":null,"author_association":"CONTRIBUTOR","pull_request":{"url":"https://api.github.com/repos/FuelRats/pipsqueak3/pulls/54","html_url":"https://github.com/FuelRats/pipsqueak3/pull/54","diff_url":"https://github.com/FuelRats/pipsqueak3/pull/54.diff","patch_url":"https://github.com/FuelRats/pipsqueak3/pull/54.patch"},"body":"This PR implements SPARK-55 and the SPARK-54, which it requires. It also implements SPARK-56.\r\n\r\nIt adds a `pass_match` parameter to the rule decorator to implement SPARK-55. It also adds a parameter for toggling case-sensitivity as well as one to switch whether the regex should match the entire message (minus the prefix on non-prefixless rules, see below) or just the first word (for command-like rules).\r\n\r\nSPARK-56's prefixless rules are also implemented. This did, however, need some doing in the command triggering logic: `MechaClient.on_message` now only checks that the message does not come from Mecha itself. `rat_command.trigger` tries to find a command, a regular old rule or a prefixless rule, in that order. If it can't find anything, it returns, possibly logging a warning. These changes also remove the need for `CommandNotFoundException`.\r\n\r\nTo facilitate simpler tests, this PR also adds callable mocks somewhat similar to those from unittest. These can be inquired as to if and how they were called. There is also an async version which can be treated as a coroutine function."},"comment":{"url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/comments/415108796","html_url":"https://github.com/FuelRats/pipsqueak3/pull/54#issuecomment-415108796","issue_url":"https://api.github.com/repos/FuelRats/pipsqueak3/issues/54","id":415108796,"node_id":"MDEyOklzc3VlQ29tbWVudDQxNTEwODc5Ng==","user":{"login":"theunkn0wn1","id":3110986,"node_id":"MDQ6VXNlcjMxMTA5ODY=","avatar_url":"https://avatars1.githubusercontent.com/u/3110986?v=4","gravatar_id":"","url":"https://api.github.com/users/theunkn0wn1","html_url":"https://github.com/theunkn0wn1","followers_url":"https://api.github.com/users/theunkn0wn1/followers","following_url":"https://api.github.com/users/theunkn0wn1/following{/other_user}","gists_url":"https://api.github.com/users/theunkn0wn1/gists{/gist_id}","starred_url":"https://api.github.com/users/theunkn0wn1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/theunkn0wn1/subscriptions","organizations_url":"https://api.github.com/users/theunkn0wn1/orgs","repos_url":"https://api.github.com/users/theunkn0wn1/repos","events_url":"https://api.github.com/users/theunkn0wn1/events{/privacy}","received_events_url":"https://api.github.com/users/theunkn0wn1/received_events","type":"User","site_admin":false},"created_at":"2018-08-22T17:15:39Z","updated_at":"2018-08-22T17:15:39Z","author_association":"COLLABORATOR","body":"I would like `invoke` to sit somewhere in your rules module.\r\nThe function is that `invoke` can become a event subscriber (probably `on_message_raw`, not decided yet).\r\n\r\nThis also moves the rule handling logic out of rat_command where it does not belong.\r\n\r\nSince Event is still pending a function call to your emit would be appropriate, i can refactor that out in the Event system PR."}}
{"actor":{"display_login":"theunkn0wn1"}}