Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve MoobotFactoids documentation #1490

Open
jlu5 opened this issue Sep 10, 2021 · 1 comment
Open

Improve MoobotFactoids documentation #1490

jlu5 opened this issue Sep 10, 2021 · 1 comment

Comments

@jlu5
Copy link
Collaborator

jlu5 commented Sep 10, 2021

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 🤷‍♂️ . 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
Copy link

hashborgir commented Sep 10, 2021

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.

prdes added a commit to prdes/Limnoria that referenced this issue Jul 13, 2022
progval pushed a commit that referenced this issue Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants