Using the SQL bot

From Hashmysql
Jump to: navigation, search

If you are in the #mysql channel on Libera, and the bot is present, you can use it to search the manual and other assorted functions. By prefixing a command with ! you can make use of its various capabilities.

<nick> can either be anyone you want the bot to tell it, or use "me" for yourself, or use "us".

You can also browse all known bot factoids. (See !t command below)

  • !m [50|51|55|56|57] <nick> <section>
    • Tells <nick> the URL to the section in the MySQL manual on dev.mysql.com for the given version. If no version is provided, the latest stable release version will be used (currently 5.7). I.e. !m johndoe select Will also search for functions and settings, but with a lower priority than sections.
  • !man [50|51|55|56|57] section
    • Return the URL to the section in the MySQL manual on dev.mysql.com for the given version. If no version is provided, the latest stable release version will be used (currently 5.7). I.e.!man select Will also search for functions and settings, but with a lower priority than sections.
  • !n [50|51|55|56|57] <nick> <anchor>
    • Tells <nick> the URL to the page anchor in the MySQL manual where the mysql <anchor> is described for the given version. If no version is provided, the latest stable release version will be used (currently 5.7). This is useful to point directly to a function or setting variable. I.e. !n johndoe date_format, !n johndoe innodb_log_file_size.
  • !noo [50|51|55|56|57] <anchor>
    • Return the URL to the page anchor in the MySQL manual where the mysql <anchor> is described for the given version. If no version is provided, the latest stable release version will be used (currently 5.7). This is useful to point directly to a function or setting variable. I.e. !noo date_format, !noo innodb_log_file_size.
  • !t(ell) <nick> [about] <factlet>
    • Looks up the <factlet> in an internal database and returns it to the channel, prepended with the given nick. "about" may be left out. I.e. !t me about reset root.
  • !g[oogle] <nick> <search>
    • Returns a URL to a Google result based on <search> string. Use it to diplomatic tell a user that Google might be the best choice for his question.
  • !l <nick> <search>
    • Returns a URL to lmgtfy.com containing <search> string. Use it to not-so-diplomatic tell a user that his questions can be easily answered by using Google.
  • !perror
    • Returns the corresponding error message to the given <errorid>, either system error or mysql error or both. Example: !perror 13 Note: that command comes with mysql, so you can run "perror 13" on your shell as well.
  • !learn f[actoid]|t[rigger]|a[lias] <key> :: <value>
    • Teach the bot a new factlet, trigger or alias - but don't add garbage! You need to be identified with NickServ for !learn. An alias can only be created to an existing factlet. To teach a new factlet <key>, that <key> must not exist. Triggers are special factlets the bot will return even without !tell. Note the delimiter :: between key and value.
  • !8ball <nick>
    • Behaves as the famous magic 8-ball toy. Possible answers are covered in this link.
  • !roll <sides>|<number>d<sides>
    • Let the bot roll one or more dice for you. <number> stands for number of dice, and <sides> for number of sides. You may specify either <sides>, in which case, one die will be rolled, or <number>d<sides> which will roll multiple dice. For example, !roll 20 will roll one die with 20 sides, and !roll 2d5 will roll 2 dice with 5 sides.

Please note: For older versions of the MySQL manual, the bot will return links to the Internet Archive's WaybackMachine (archive.org/web), as those are unfortunately no longer available on mysql.com.