progval / Limnoria

A robust, full-featured, and user/programmer-friendly Python IRC bot, with many existing plugins.
https://docs.limnoria.net/
Other
622 stars 174 forks source link

Improve MoobotFactoids documentation #1490

Open jlu5 opened 3 years ago

jlu5 commented 3 years ago

Today in #limnoria-bots we found that MoobotFactoids supports replacing and regex-replacing existing factoids. This isn't documented in the plugin README, so it's not obvious at all for folks new to the plugin. Syntax seems to be:

I assume that this is covered in the original moobot docs, though I'm not really sure which moobot the plugin refers to - Google gives me 3-4 different results :man_shrugging: . blootbot (from 2005!) does have a few more examples in the tarballs, /blootbot/doc/old/EXAMPLES. Ironically their "new" docs URL is a dead link

hashborgir commented 3 years ago

There is also :

elif ['is', 'also'] in utils.seq.window(tokens, 2):
            self.augmentFactoid(irc, msg, tokens)

Proposed documentation change:

no <factoid key> is <something>
Replace the stored factoid with a new factoid

<factoid key> ~= s/something/nothing/
Applies the sed style regex replacement to the factoid text.

<factoid key> is also <something else>
Augment the factoid, or append new text to the end of factoid.

Hash: secbot Hash is awesome Hash: secbot no Hash is super awesome Hash: secbot Hash is also likes python. Hash: secbot Hash =~ s/awesome/amazing/

.hash secbot: Hash is awesome .hash secbot: Hash is super awesome .hash secbot: Hash is super awesome or likes python .hash secbot: Hash is super amazing or likes python

Feel free to phrase it better.