view config.quotedb.example @ 519:1cfa567f9500

quotedb: Improve statistics.
author Matti Hamalainen <ccr@tnsp.org>
date Sat, 02 May 2020 15:29:03 +0300
parents 7fdc069840cc
children 0da68d583b38
line wrap: on
line source

##########################################################################
#
# QuoteDB script configuration
#
##########################################################################

# Channels where quote functionality is enabled
# set qdb_channels "#foobar;#baz"
# You can use * to match substrings or everything
set qdb_channels "*"


###
### SQL database settings
###
# Path and filename of the SQLite database
set qdb_file "quotedb.sqlite"


###
### General settings
###

# Verbosity (1 = be verbose, 0 = be quiet)
set qdb_verbose 0


# 1 = Enable logging of various script actions into bot's log
# 0 = Don't.
set qdb_logmsg 1


# What IRC "command" should we use to send messages:
# (Valid alternatives are "PRIVMSG" and "NOTICE")
set qdb_preferredmsg "PRIVMSG"


###
### Search/command related settings
###
set qdb_max_deltime 15
set qdb_max_modtime 30


# Limit how many quotes should the "!<cmd> find" command show at most.
set qdb_showmax_pub 3

# Same as above, but for private message search.
set qdb_showmax_priv 5


# Limit min/max of !quote top <n>
set qdb_toplist_min 2
set qdb_toplist_max 5


###
### Messages
###

array set qdb_messages {

  "name" "Quote"

  "invalid_user" "Pyh."

  "sql_error" "Virhe sörkittäessä @name@-tietokantaa. uliskaa."

  "fmt_get"   "#@1@: @2@ (@3@@@4@, @5@)"

  "fmt_search" "#@1@: @2@ (@3@@@4@)"
  "no_matches" "@name@-haku ei tuottanut tuloksia."

  "you_voted" "Äänestit @name@ #@1@ -> @2@, arvosana nyt @3@"
  "vote_updated" "@name@-äänesi #@1@ päivitetty -> @2@, arvosana nyt @3@"

  "add_success" "@name@-tietokantaa sörkitty (#@1@), kiitos."

  "toplist_limit" "Top-listan määrän oltava @1@ - @2@."
  "fmt_toplist" "@1@. #@2@: @3@ (@4@, @5@)"

  "update_override" " (owner/time override)"
  "update_ok" "@name@ #@1@ päivitetty@2@."
  "update_too_old" "@name@ quote #@1@ vanhempi kuin @2@ minuuttia, ei voida päivittää."
  "update_override" " (owner/time override)"

  "quote_not_found" "@name@ #@1@ ei löydy, tai se ei kuulu käyttäjälle '@2@'."

  "stats" "@name@-tilastot: @1@ quotea, @2@ annettua ääntä."
  "stats2" "Top-@1@ lisääjät: @2@ | Viimeisimmät vuodet: @4@ | Tuottoisimmat vuodet: @6@"

  "help"           "@cmd@ <id> \002|\002 add <teksti> \002|\002 update <id> <teksti> \002|\002 del <id> \002|\002 find <parametrit> \002|\002 vote \[<id> \[1 | -1\]\] \002|\002 top <n> \002|\002 stats"

  "help_add"       "@cmd@ add <teksti>"
  "help_update"    "@cmd@ update <id> <teksti>"
  "help_delete"    "@cmd@ del <id>"
  "help_vote"      "@cmd@ vote \[\[<id>\] \[1|-1\]\]"
  "help_find"      "@cmd@ find [hakuparametrit]"

  "quote_deleted"  "@name@ #@1@ poistettu@2@."
  "quote_too_old"  "@name@ quote #@1@ vanhempi kuin @2@ minuuttia, ei poisteta."
  "quote_does_not_exist" "Quotea #@1@ ei ole."
}


###
### Bind commands for each database etc.
###

# Bind !quote -command for table "quotedb"
bind pub - !vitsi vitsi_pub_cmd
bind msg - !vitsi vitsi_msg_cmd
proc vitsi_pub_cmd {unick uhost uhand uchan utext} { qdb_command "!vitsi" "quotedb" $unick $uhost $uhand $uchan $utext 1 }
proc vitsi_msg_cmd {unick uhost uhand utext}       { qdb_command "!vitsi" "quotedb" $unick $uhost $uhand "" $utext 0 }
set qdb_messages(quotedb_fmt_get) "@2@ (#@1@)"
set qdb_messages(quotedb_urlprefix) ""
set qdb_messages(quotedb_name) "Vitsi"


# Bind !quote -command for table "kissa"
bind pub - !kissa kissa_pub_cmd
bind msg - !kissa kissa_msg_cmd
proc kissa_pub_cmd {unick uhost uhand uchan utext} { qdb_command "!kissa" "kissadb" $unick $uhost $uhand $uchan $utext 1 }
proc kissa_msg_cmd {unick uhost uhand utext}       { qdb_command "!kissa" "kissadb" $unick $uhost $uhand "" $utext 0 }
set qdb_messages(kissadb_fmt_get) "kissa @2@ (#@1@)"
set qdb_messages(kissadb_urlprefix) ""
set qdb_messages(kissadb_name) "Kissa"
set qdb_messages(kissadb_stats) "Kissa-tilastot: @1@ kissajuttua, @2@ äänestettyä kissamaisuutta."
set qdb_messages(kissadb_quote_does_not_exist) "Kissaa #@1@ ei ole olemassa."


bind pub - !spede spede_pub_cmd
bind msg - !spede spede_msg_cmd
proc spede_pub_cmd {unick uhost uhand uchan utext} { qdb_command "!spede" "spededb" $unick $uhost $uhand $uchan $utext 1 }
proc spede_msg_cmd {unick uhost uhand utext}       { qdb_command "!spede" "spededb" $unick $uhost $uhand "" $utext 0 }
set qdb_messages(spededb_urlprefix) "https://tnsp.org/spede/img/"
set qdb_messages(spededb_name) "Spede"
set qdb_messages(spededb_stats) "Spede-tilastot: @1@ spedeä, @2@ äänestettyä spedeä."
set qdb_messages(spededb_quote_does_not_exist) "Spedeä #@1@ ei ole."


bind pub - !mn mn_pub_cmd
bind msg - !mn mn_msg_cmd
proc mn_pub_cmd {unick uhost uhand uchan utext}    { qdb_command "!mn" "mndb" $unick $uhost $uhand $uchan $utext 1 }
proc mn_msg_cmd {unick uhost uhand utext}          { qdb_command "!mn" "mndb" $unick $uhost $uhand "" $utext 0 }
set qdb_messages(mndb_urlprefix) "https://tnsp.org/mndb/img/"
set qdb_messages(mndb_name) "Nykäsismi"
set qdb_messages(mndb_stats) "Nykäs-tilastot: @1@ nykäsismiä, @2@ äänestettyä."
set qdb_messages(mndb_quote_does_not_exist) "Nykäsismiä #@1@ ei ole."


bind pub - !tuksu tuksu_pub_cmd
bind msg - !tuksu tuksu_msg_cmd
proc tuksu_pub_cmd {unick uhost uhand uchan utext} { qdb_command "!tuksu" "tuksudb" $unick $uhost $uhand $uchan $utext 1 }
proc tuksu_msg_cmd {unick uhost uhand utext}       { qdb_command "!tuksu" "tuksudb" $unick $uhost $uhand "" $utext 0 }
set qdb_messages(tuksudb_urlprefix) "https://tnsp.org/tuksu/img/"
set qdb_messages(tuksudb_name) "Tuksu"
set qdb_messages(tuksudb_stats) "Tuksu-tilastot: @1@ tuksuilua, @2@ äänestettyä."
set qdb_messages(tuksudb_quote_does_not_exist) "Tuksuilua #@1@ ei ole."