Commit Graph

80 Commits

Author SHA1 Message Date
Brian S. Stephan ee6ae7080e
remove the bridge-speaker from the message when relevant
this allows downstream event handlers to react to e.g.:

<discord_user> !weather 12345

as if they were normal leading IRC commands
2023-09-12 09:16:38 -05:00
Brian S. Stephan 333424025b support markov targets with identical names on different servers
markov targets are queried and autogenerated based on chatter, but had a
legacy name which is no longer in use for this, preferring the foreign
keys to channel and consequently server. the name is really just
informative these days, but was still being used to find targets, and
thus was breaking when two servers had the same channel name in them.
this fixes that
2023-05-04 17:24:07 -05:00
Brian S. Stephan f898f35ce6
replace execute_delayed with reactor.scheduler.execute_after
the former was deprecated forever ago, and apparently removed. this may
fix the disconnect detection logic
2023-03-02 00:51:22 -06:00
Brian S. Stephan 4289f95800
report on the version of dr.botzo in CTCP VERSION 2023-03-02 00:45:55 -06:00
Brian S. Stephan 572ecddceb
do some small cleanups 2023-03-02 00:45:29 -06:00
Brian S. Stephan 3aadde4b71
remove XMLRPC inheritence that overrode a method no longer in existence
this is probably from python 2 days; we inherited from
SimpleXMLRPCRequestHandler to change the logging, but the method
overrode no longer exists so this did nothing
2023-03-02 00:20:25 -06:00
Brian S. Stephan c2d26f404e
deduplicate Channel object from irc library
I think this is an extremely ancient copy and paste job I never fully
corrected
2023-03-02 00:19:27 -06:00
Brian S. Stephan ecaabbce89
unpin the irc library 2023-03-02 00:16:32 -06:00
Brian S. Stephan 051e656a82
fix errant reference to IrcChannel object rather than just the name 2023-03-02 00:15:06 -06:00
Brian S. Stephan 39290fb63c
allow : and , after @bot mentions 2023-02-19 22:55:14 -06:00
Brian S. Stephan 55d856b8fd
account for the discord bridge in the core bot addressed flag 2023-02-19 21:12:01 -06:00
Brian S. Stephan f812857d75
add discord bridge field to the channel model
will be used in a future change to clean up markov chains
2023-02-19 17:55:41 -06:00
Brian S. Stephan 40286eeafc replace IRC color codes with nothing 2021-04-25 23:19:18 -05:00
Brian S. Stephan 43f2b09057 don't add the empty string to additional nicks
thinko on my part, this was making the regex for matching all nicks to
'|nick' when the field is '', because of split producing ['']. in
particular this was making markov trigger on every line
2021-04-25 21:00:34 -05:00
Brian S. Stephan 53c874dc21 option to replace IRC control chars with markdown
^C^B isn't allowed through Discord's API, and I'm sure some other stuff
like colors that I don't use. this makes it a server option to replace
them with Markdown, though I think this would only ever be interesting
for BitlBee + Discord
2021-04-25 12:11:59 -05:00
Brian S. Stephan 1036c08147 only autojoin channels for this connection 2021-04-25 11:38:19 -05:00
Brian S. Stephan 9c1109107b relate channels to their server
this is necessary for supporting multiple irc servers in one bot config.
this also has the side effect of requiring some code in ircbot and
markov which autocreates channels to also include the server (retrieved
via the connection). this will again help keep channels coherent for
multi-server arrangements

the twitter bot change here is untested but seems like the right idea (I
haven't used the twitter package in forever)
2021-04-25 11:13:10 -05:00
Brian S. Stephan 6136127c5f move IRC server settings to database
this is the first step in trying to get the bot to support multiple
servers with different channels, countdown triggers, and so on

this also ends up affecting some configuration around:
* dispatch
* markov
* admin privmsg form
2021-04-25 10:17:41 -05:00
Brian S. Stephan 44d8b7db00 lint cleanups 2021-04-24 20:49:19 -05:00
Brian S. Stephan d518cb2b77 lint cleanups 2021-04-24 20:49:14 -05:00
Brian S. Stephan f2fb0a26a4 remove unnecessary unicode_literal future imports, we py3 now 2019-06-21 15:23:33 -05:00
Brian S. Stephan 2f98a64cdd version bumps and migration to django 2.2 2019-06-21 10:05:40 -05:00
Brian S. Stephan 0589939137 support multiple strings as counting as nick highlights
also, treat @nicks as being addressed, since we are doing discord
through bitlbee now
2019-01-10 08:48:15 -06:00
Brian S. Stephan 474afe2576 do some ircbot prospector cleanup
bss/dr.botzo#17
2017-03-10 18:51:36 -06:00
Brian S. Stephan dbc4e6fe6f rename event._recursing to event.recursing 2017-03-10 18:29:31 -06:00
Brian S. Stephan 1e428b77db bot: add most_specific_msg for convenience
returns original_msg or addressed_msg, depending on the context

related to bss/dr.botzo#32
2017-03-10 18:16:35 -06:00
Brian S. Stephan a79d0cdd9f bot: add a bunch of event attrs related to msgs
- event.addressed - msg started with 'bot: '
- event.original_msg - the pub/privmsg
- event.addressed_msg - pub/privmsg minus 'bot: '
- event.sender_nick - nick of event.source
- event.sent_location - channel or nick of event.source
- event.in_privmsg - if the event was in a privmsg or not

closes bss/dr.botzo#32
2017-03-10 18:16:11 -06:00
Brian S. Stephan 0003c0c16e bot: default _recursing to False 2017-03-09 08:06:31 -06:00
Brian S. Stephan 6f9bbd304f bot: don't strip []s if no replacement happened 2017-02-26 10:42:32 -06:00
Brian S. Stephan 995bb643f3 attempt to have outbound recursion
same logic as replacing [subcommand] with the output of subcommand, but
on the outbound side, via {subcommand}. this lets you do something like,
say:

!echo {!facts buh}

and that won't get interpreted until '{!facts buh}' is on its way out of
the bot. thus, you could also put '{!facts buh}' into the output of some
other command, like a countdown reminder
2017-02-23 21:35:03 -06:00
Brian S. Stephan 1bbb64618d bot: capture exceptions, try to report on them
it beats crashing, probably
2017-02-22 22:08:04 -06:00
Brian S. Stephan 015eacbe53 xmlrpc: expose IRCBot.reply, use it over privmsg
converts dispatch and the admin form to reply

closes bss/dr.botzo#21
2017-02-12 11:41:29 -06:00
Brian S. Stephan 23bb5cdd78 allow IRCBot.reply() to work eventless
reply() used to require an event, but all it used it for was to
determine the destination and to identify recursion. basically, strictly
only -replies-. we can make this a more robust privmsg, too, by adding
explicit_target and inferring recursion as False. this will let
basically any code currently using privmsg to use reply instead, and
benefit from multi-line and line splitting

bss/dr.botzo#21
2017-02-12 11:33:13 -06:00
Brian S. Stephan 010afd05ce add some anti-flood protection stuff
this throttles multi-line messages in a way that probably doesn't affect
the normal cases much, and scales fairly well to far longer text. for
some reason long ascii art still triggers the flood detection, but with
this code at least it happens later in the process. so, success, for
now? i can fix the ascii art at some future point if i ever hit it
practically

closes bss/dr.botzo#23
2017-02-12 10:58:18 -06:00
Brian S. Stephan 8b4f8b2545 move message splitting into IRCBot.reply()
leaves IRCBot.privmsg() pretty vanilla. this should make it clearer
which version for modules/etc to use (hint: it's reply)

bss/dr.botzo#21
2017-02-12 10:47:27 -06:00
Brian S. Stephan 8f8af4e6b4 package updates and resulting compat stuff
changes to urls.py in the django views, trivial __init__ change for the
irc library stuff

bss/dr.botzo#16
2017-02-06 22:58:51 -06:00
Brian S. Stephan cd23f062a9 collapsing all of dr_botzo one directory 2017-02-04 11:51:22 -06:00
Brian S. Stephan 2dc2b6a8a2 remove old IRC bot entirely
the porting is complete, everything i care about has been moved to the
django-based codebase, and this old junk can finally go

IT IS A NEW ERA, one of maintainability and flexible changes. after
years of procrastinating, i have finally done this. the future is now
2015-06-19 21:50:35 -05:00
Brian S. Stephan adb88c3e95 Storycraft: ported to ircbot v2. deleted
this means the entire modules directory is essentially replaced. we're
in thissssssssssss
2015-06-19 21:11:18 -05:00
Brian S. Stephan 482870621b Dispatch: ported to django REST framework. deleted 2015-06-18 23:59:25 -05:00
Brian S. Stephan fccb5f3fb3 Acro: ported to ircbot v2. deleted 2015-06-18 18:48:51 -05:00
Brian S. Stephan b3da273b2d Countdown: ported to ircbot v2. deleted 2015-06-18 09:20:22 -05:00
Brian S. Stephan e18e629547 Twitter: ported to ircbot v2. deleted 2015-06-16 20:28:36 -05:00
Brian S. Stephan 618a042935 IrcAdmin: ported to ircbot v2. deleted 2015-06-16 19:04:52 -05:00
Brian S. Stephan aca4ed3eac Races: ported to ircbot v2. deleted 2015-06-13 13:41:54 -05:00
Brian S. Stephan 7876ad2290 Markov: ported to ircbot, noted last TODO. deleted 2015-06-13 13:19:18 -05:00
Brian S. Stephan 6eb589d2d6 Dice: ported to ircbot v2. deleted 2015-05-27 21:02:18 -05:00
Brian S. Stephan c486cabd4e TextTransform: ported to bot v2. deleted 2015-05-27 20:07:22 -05:00
Brian S. Stephan 6842fad841 Facts: ported to ircbot v2. deleted 2015-05-21 22:33:35 -05:00
Brian S. Stephan 56b288e8b4 Pi: ported to new bot. deleted 2015-05-21 21:42:37 -05:00