67 Commits

Author SHA1 Message Date
Adrian Malacoda
ca6f3391d4 simplify even more; just return an EventLoop (will probably be renamed something like Handler) 2018-02-22 02:50:49 -06:00
Adrian Malacoda
5c87b9001a simplify Envelope type, just have event loop threads generate Events which are then wrapped by Envelopes transparently 2018-02-22 02:40:22 -06:00
Adrian Malacoda
055a323d64 simplify loops, less work done in dispatcher thread 2018-02-22 02:30:54 -06:00
Adrian Malacoda
56ca5ae767 move to a model of one thread per dispatcher, instead of one main thread 2018-02-22 02:04:09 -06:00
Adrian Malacoda
fcc86a671e rearchitect event transmission so that the parents/children of each module are explicitly specified and we establish the linkages between them 2018-02-22 01:09:39 -06:00
Adrian Malacoda
3614c7eb5d update all dependencies to latest version. Need to wait for discord-rs to update though 2018-02-18 16:29:30 -06:00
Adrian Malacoda
0b289b6956 prefer if let where possible, removes empty blocks and reduces nesting 2017-05-17 21:23:00 -05:00
Adrian Malacoda
c69cc61114 prefer if let when possible 2017-05-16 21:35:05 -05:00
Adrian Malacoda
25d247f299 New filters implementation. "tags" are removed and replaced with an implementation that filters directly on the event, using an object/map instead of strings. 2017-05-11 01:29:33 -05:00
Adrian Malacoda
8cd8756722 add todo 2017-05-10 02:28:04 -05:00
Adrian Malacoda
97cc215f05 more tags 2017-05-10 02:16:05 -05:00
Adrian Malacoda
2c0e5170f4 properly implement discord channels, dry up code 2017-05-10 02:13:56 -05:00
Adrian Malacoda
bb25846566 Add GCL to interwiki list 2017-05-10 01:16:04 -05:00
Adrian Malacoda
495e3129d4 split logic for filtering out events into Subscription struct 2017-05-10 01:13:52 -05:00
Adrian Malacoda
7c26e0294a Add tag filters. This is a primitive way to screen out events that do not match a certain criteria (e.g. from user Dave) 2017-05-10 00:17:22 -05:00
Adrian Malacoda
6dda3e227f add "Logger" module which logs all received events 2017-05-09 23:39:21 -05:00
Adrian Malacoda
2baffdacd3 implement Debug for all structs, provide implementation for message senders 2017-05-09 23:36:56 -05:00
Adrian Malacoda
e8b944b836 implement run() which just forwards to event loop 2017-05-09 22:48:04 -05:00
Adrian Malacoda
9e9da11f79 begin tenquestionmarks 0.0.2. Separate Module trait into Module struct (which holds metadata and config about the module) and EventLoop trait, which implements the event loop. The constructors still return Modules, but they are structs and not boxes. 2017-05-09 22:44:33 -05:00
Adrian Malacoda
23e32f28fe update to discord 0.8.0 2017-05-09 19:50:33 -05:00
Adrian Malacoda
21b312543b yugioh rules text shouldn't be bolded 2017-03-12 18:58:20 -05:00
Adrian Malacoda
33e83d63d9 expand on mtg/ygo autolink 2017-03-12 18:48:34 -05:00
Adrian Malacoda
4888029aff Data YES (thanks Ikewise) 2017-03-05 17:18:00 +00:00
Adrian Malacoda
9112b4ada6 add some yeses to balance out the nos 2017-03-05 05:29:26 +00:00
Adrian Malacoda
8c57bd6eb7 initial working implementation of autolink module 2017-02-26 18:05:45 -06:00
Adrian Malacoda
5551ebd552 WIP for autolinker module. Currently can't use stc and tqm together because of conflicting dependencies, so this is a placeholder. 2017-02-26 17:17:22 -06:00
Adrian Malacoda
a7b9d801a1 Require echobox to have a parameter 2017-02-26 03:05:40 -06:00
Adrian Malacoda
fd1aecf4d3 add support for "general" config in the module loader. The "general" config is found under the "general" heading and is passed to each module constructor. 2017-02-26 02:44:53 -06:00
Adrian Malacoda
0a45cbb9f2 "general" as a header is reserved 2017-02-26 02:19:46 -06:00
Adrian Malacoda
d9ab75a607 Initial implementation of lua module. 2017-02-26 02:10:28 -06:00
Adrian Malacoda
41fa36cccf Transmit selfjoin event on connect 2017-02-25 23:52:43 -06:00
Adrian Malacoda
109a9131f0 Parse loglevel from environment variable 2017-02-25 23:52:31 -06:00
Adrian Malacoda
709eff63e0 add timestamp to log message 2017-02-25 23:34:01 -06:00
Adrian Malacoda
57b52772f5 set default loglevel to info 2017-02-25 23:25:09 -06:00
Adrian Malacoda
8dad1fc4aa Do not send events to their originators, or to any event not specified in the "to" list. 2017-02-25 21:31:32 -06:00
Adrian Malacoda
1fbba2554d replace Sender with ExtSender from transformable_channels. Now we can tag each outgoing envelope with the name of its sender 2017-02-25 21:11:25 -06:00
Adrian Malacoda
544974117f rename various sender/receiver variables to be clearer 2017-02-25 20:38:09 -06:00
Adrian Malacoda
4d5a412395 we're sending Envelope and transmitting Arc<Envelope>, since we're wrapping the Envelope in an Arc to transmit it, we (probably) don't need to wrap the Event in an Arc too 2017-02-25 20:33:47 -06:00
Adrian Malacoda
f22e4755d3 remove unused variable 2017-02-25 20:20:01 -06:00
Adrian Malacoda
37a9645f5b Simplify module trait by combining produce/consume event methods into a single run method that runs in the module's own thread and can produce and/or consume events. Introduce an Envelope struct that encapsulates event + to/from so we can (eventually) tag every event and also limit where events are sent (e.g. you can have a specific module configured to talk or listen only to a certain other module). 2017-02-25 20:17:46 -06:00
Adrian Malacoda
442b617f31 now with amazing echobox powers 2017-02-22 23:40:30 -06:00
Adrian Malacoda
2c893926c3 can finally commit more helpful example config 2017-02-20 15:11:13 -06:00
Adrian Malacoda
96bc25234e more event types 2017-02-19 18:21:11 -06:00
Adrian Malacoda
ce35368676 tag senders/receivers with module names so we can eventually associate individual events to module names 2017-02-19 17:31:37 -06:00
Adrian Malacoda
0f945ec604 create a dedicated Message struct and implement reply(&str) on there, since it seems to be a commonly used thing. Begin implementing helpers for command parsing. 2017-02-19 05:37:56 -06:00
Adrian Malacoda
b9d5b7916c cleanup 2017-02-19 05:06:55 -06:00
Adrian Malacoda
9b00500a77 pvn dependency 2017-02-19 04:49:26 -06:00
Adrian Malacoda
c5a88b8405 initial pvn module implementation 2017-02-19 04:49:06 -06:00
Adrian Malacoda
84d2921f8f send/receive Arc<Event> instead of Event so we don't have to clone objects all over the place. This might also enable us to be a bit more flexible with what we send with Events, and might simplify things elsewhere. 2017-02-19 02:55:30 -06:00
Adrian Malacoda
1a69349557 Add ability to specify the "playing" status string (with tenquestionmarks default) 2017-02-17 02:44:00 -06:00