Limnoria icon indicating copy to clipboard operation
Limnoria copied to clipboard

Improve MoobotFactoids documentation

Open jlu5 opened this issue 4 years ago • 1 comments

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:

  • no x is y - replace factoid x with content y
  • x ~= s/y/z/ applies regexp s/y/z/ to the factoid x

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

jlu5 avatar Sep 10 '21 06:09 jlu5

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.

hashborgir avatar Sep 10 '21 06:09 hashborgir