Ignore:
Timestamp:
02/11/09 05:38:23 (3 years ago)
Author:
notopic
Message:

Be more terse by default, add -v option

File:
1 edited

Legend:

Unmodified
Added
Removed
  • QuoteEngine/QuoteEngine.tcl

    r38 r40  
    201201  if [matchattr $handle $quote_noflags] { return 0 } 
    202202 
    203   if {![regexp {[0-9]+} $text]} { 
    204     puthelp "PRIVMSG $channel: Use: !getquote <id>" 
     203        set verbose "" 
     204 
     205  if {![regexp {(-v )?([0-9]+)} $text matches verbose quote_id]} { 
     206    puthelp "PRIVMSG $channel: Use: !getquote \[-v\] <id>" 
    205207    return 0 
    206208  } 
     
    211213        } 
    212214 
    213         set text [mysqlescape $text] 
     215         
     216        set text [mysqlescape $quote_id] 
    214217  set sql "SELECT * FROM quotes WHERE id='$text'" 
    215218  putloglev d * "QuoteEngine: executing $sql" 
     
    228231    if {$chan != $channel} { 
    229232      puthelp "PRIVMSG $channel :\[\002$id\002\] $quote" 
    230       puthelp "PRIVMSG $channel :\[\002$id\002\] From $chan, added $by at $when." 
     233      if {$verbose != ""} { 
     234                                puthelp "PRIVMSG $channel :\[\002$id\002\] From $chan, by added $by at $when." 
     235                        } 
    231236    } else { 
    232237      puthelp "PRIVMSG $channel :\[\002$id\002\] $quote" 
    233       puthelp "PRIVMSG $channel :\[\002$id\002\] Added $by at $when." 
     238                        if {$verbose != ""} { 
     239                                puthelp "PRIVMSG $channel :\[\002$id\002\] Added by $by at $when." 
     240                        } 
    234241    } 
    235242  } else { 
     
    504511  puthelp "PRIVMSG $nick :  !delquote <id> - deletes a quote. You must be either a bot/channel master or the person who added the quote to delete it." 
    505512  puthelp "PRIVMSG $nick :  !randquote \[--all\] \[--channel=#channel\] \[-c #channel\] - fetches a random quote from the current channel. --all chooses from all channels, not just the one the command is executed from. --channel and -c choose only from the given channel." 
    506   puthelp "PRIVMSG $nick :  !getquote <id> - fetches the quote with number <id>" 
     513  puthelp "PRIVMSG $nick :  !getquote \[-v\]<id> - fetches the quote with number <id>. Gives info of who added it if -v is specified." 
    507514  puthelp "PRIVMSG $nick :  !findquote \[--all\] \[--channel=#channel\] \[-c #channel\] \[--count <int>\] \[-n <int>\] <text> - finds up to <int> (default 5) quotes containing 'text'. Optional parameters same as !randquote. -n is a shortcut for --count." 
    508515  puthelp "PRIVMSG $nick :  !quoteurl - get the URL for the web interface to the quotes" 
Note: See TracChangeset for help on using the changeset viewer.