Ticket #91 (assigned task)

Opened 3 years ago

Last modified 2 years ago

quotes.rb cleanups

Reported by: giuseppe.bilotta Assigned to: giuseppe.bilotta (accepted)
Priority: low Milestone: 0.9.11
Component: plugins Version: 0.9.9
Severity: minor Keywords:
Cc:

Description

quotes.rb could use a clean-up. Two things in particular should be addressed:

  1. lines 223 onward in listen are probably never reached and should be deleted
  2. would it be cleaner to have the plugin register the various quote commands and use privmsg instead of listen?

Change History

06/01/06 01:50:40 changed by epitron

I agree, quotes.rb is a mess. It could be like 50 lines long if it used "map" instead of a crapload of regular expressions and all that logic.

You wanna fix it? :)

06/01/06 02:21:40 changed by epitron

  • status changed from new to closed.
  • resolution set to fixed.

Applied in [185]

06/01/06 02:22:04 changed by epitron

  • status changed from closed to reopened.
  • resolution deleted.

06/01/06 02:22:27 changed by epitron

Oops. :) Sorry, closed the wrong ticket.

06/01/06 03:28:04 changed by giblet

Don't forget, quotes.rb was written before I made the map-based interface. And the complexity of the quotes plugin was one of the things the new interface was aimed at solving :)

Agreed it could be a lot simpler. However note that if you ditch the listen, then things like !addquote stop working (unless you configure ! as an address prefix I suppose). Mind you I only implemented those for compatibility with another quote bot I used to use. Probably wouldn't be the end of the world :P

Feel free to tidy it all up tho :D

06/01/06 03:35:31 changed by epitron

Haha..I didn't realize that it ignored the prefix-character. I guess I never noticed since '!' is my prefix character. :)

It seems silly to have it unique like that though. I can't see any real reason not to use plugin.map. I mean, I guess somebody who uses !addquote and only !addquote might cry... I've got kleenex if they need it. :)

06/03/06 00:37:00 changed by giuseppe.bilotta

Yeah, that's a whole section of duplicated code. I think everything but markov should use map}}. There are a few things to fine-tune about {{{map though, and I'm going to open a new task about this.

10/23/06 17:04:13 changed by giuseppe.bilotta

  • owner changed from giblet to giuseppe.bilotta.
  • status changed from reopened to new.

10/23/06 19:51:17 changed by giuseppe.bilotta

  • status changed from new to assigned.
  • milestone set to 0.9.11.