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

Quote plugin #123

Open
wants to merge 13 commits into
base: main
Choose a base branch
from
Open

Quote plugin #123

wants to merge 13 commits into from

Conversation

bensimner
Copy link
Contributor

@bensimner bensimner commented Mar 28, 2017

Adds a quote plugin with these commands:

(all commands are channel-specific)

  • remember <nick> [<pattern>]
    • remembers a message sent that matches
    • if no pattern then just last message sent
    • NOTICEs the user that !remember'd with a confirmation it was remembered
  • quote [<nick> [<pattern>]]
    • recalls a quote by that was !remember'd
    • if no it defaults to * which is channel-wide quoting
    • Nondeterministically selects a matching quote to send to the channel
  • quote.remove <id> [, <id>]*
    • removes one-or-more quote ID's from the database
    • requires auth
  • quote.list [<pattern>]
    • privately sends a list of quotes that match (or a pastebin link if too many)
    • (only pastes the first ~100 for pastebin)
    • requires auth
    • can be used in private chats but then syntax becomes quote.list <channel> [<pattern>]

Closes #100

@coveralls
Copy link

coveralls commented Mar 28, 2017

Coverage Status

Coverage increased (+0.9%) to 71.876% when pulling 72f5f4f on bensimner:quote-plugin into 3320c10 on HackSoc:master.

csbot/plugins/quote.py Outdated Show resolved Hide resolved
@LordAro LordAro mentioned this pull request Sep 26, 2017
csbot/plugins/quote.py Outdated Show resolved Hide resolved
csbot/plugins/quote.py Outdated Show resolved Hide resolved
csbot/plugins/quote.py Outdated Show resolved Hide resolved
csbot/plugins/quote.py Outdated Show resolved Hide resolved
csbot/plugins/quote.py Outdated Show resolved Hide resolved
@LordAro
Copy link
Member

LordAro commented Jun 30, 2018

Ha, f-strings. Are we ready to drop py3.4 & 3.5 yet?

@LordAro
Copy link
Member

LordAro commented Sep 23, 2018

Well we dropped py3.4...

@bensimner any chance of an update? ;)

bensimner and others added 13 commits February 19, 2022 12:42
Adds extra commands:
  - !quote <nick> [<pattern>]
  - !quote.list [<pattern>]                   # on a channel
  - !qote.list <channel> [<pattern>]  # in a privmsg
  - !quote.remove <id> [, <id>]*
Also adds `!quotes * <pattern>`, for channel-wide quoting.
Does some re-naming !quote -> !remember and !quotes -> !quote, also limits the use of !quote.list and !quote.remove to only authenticated users with the correct permissions.
Also adds tests for the formatter
Each @command is now a dispatch to a simpler function based off a regexp cli definition.
This could probably be formalised into a @command.group() decorator or something later.
Moving all the quote data into an attrs class makes it easier to work with over a dictionary.
Then hiding the database implementation as a mixin made the plugin class itself easier to understand.
I'm not 100% sure what this was doing. I think we don't need it anymore.
@codecov-commenter
Copy link

codecov-commenter commented Feb 19, 2022

Codecov Report

Merging #123 (02af8e9) into main (645fbd5) will increase coverage by 0.50%.
The diff coverage is 76.96%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #123      +/-   ##
==========================================
+ Coverage   75.85%   76.36%   +0.50%     
==========================================
  Files          28       29       +1     
  Lines        2990     3194     +204     
  Branches      501      549      +48     
==========================================
+ Hits         2268     2439     +171     
- Misses        652      672      +20     
- Partials       70       83      +13     
Impacted Files Coverage Δ
src/csbot/util.py 83.42% <14.28%> (-2.69%) ⬇️
src/csbot/plugins/quote.py 79.18% <79.18%> (ø)
src/csbot/plugins/auth.py 88.15% <0.00%> (+18.42%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 645fbd5...02af8e9. Read the comment docs.

@alanbriolat alanbriolat dismissed LordAro’s stale review February 19, 2022 21:11

All conversations in this review already resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Quotes board
5 participants