A Perl 6+5 bot using the IRC::Client Perl 6 module
This is an IRC bot in Perl 5 and 6. It was originally only in Perl 5 but the core has now been rewriten in Perl 6, and the rest is being ported over now.
s/before/after/gi functionality. Use g or i at the end to make it global or case insensitive
If the last character is a slash, we assume any slashes in the $after term are literal ( Except for the last one ) If not, then anything after the last slash is a specifier
Replys with the last time the specified user has spoke, joined, quit or parted. Usage: !seen nickname
The command !SAVE
will cause the channel event data and history file to be saved. Normally it will save when the data changes in memory provided it hasn't already saved within the last 10 seconds
Syntax: !tell nickname message
or !tell nickname in 10 minutes message
Will tell the specified nickname the message the next time they speak in channel
People who have been added as an operator in the 'botnick-ops.json' file will be allowed to perform the following commands if their nick, hostname and usermask match those in the file.
The specified user will be banned by 30 minutes at default. You can override this and set a specific number of seconds to ban for instead. The bot will automatically unban the person once this time period is up, as well as printing to the channel how long the user has been banned for. Usage: !ban nick
.
Usage: !unban nick
Gives ops to specified user, or if no user is specified, gives operator to the user who did the command. Usage: !op
or !op nickname
.
Takes ops away from the specified user, or if no user is specified, removes operator status from the user who did the command. Usage: !deop
or !deop nickname
.
Kicks the specified user from the channel. You are also allowed to specify a custom kickmessage as well. Usage: !kick nickname
or !kick nickname custom message
.
Sets the topic. Usage: !topic new topic message here
.
You can convert between any of these three using the general syntax !from2to
When converting from numerical each value that is a different number is delimited by spaces. Examples are below.
Usage: !hex2uni 🐧ABCD
Output: 1F427 41 42 43 44
Will get the Unicode codepoints in hex for a given string.
Usage: !uni2hex 1F427 41 42 43 44
Output: 🐧ABCD
Gets the last time the specified person mentioned any users the bot knows about.
Usage: !mentioned nickname
Gets the current time in the specified location. Uses Google to do the lookups.
Usage !time Location
Evaluates the requested Perl 6 code and returns the output of standard out and error messages.
Usage: !p6 my $var = "Hello Perl 6 World!"; say $var
Evaluates the requested Perl 5 code and returns the output of standard out and error messages.
Usage: !p my $var = "Hello Perl 5 World!\n"; print $var
o
All of these commands below have not been reimplemented in Perl 6 yet.
Usage: !transliterate ありがとうございました
Works for almost all languages or non language characters. Converts into romanized ASCII text.
Output: arigatougozaimasita
Usage: !fortune
Gets a short fortune using the Linux/Unix fortune
program.
Usage: !ul 🐧
Output: https://www.fileformat.info/info/unicode/char/1f427/index.htm
[ Unicode Character 'PENGUIN' (U+1F427) ]
Will lookup a a unicode character at the fileformat.info website. To get a response not for a character but for the codepoint you want, use:
!unicodelookup 1F427
Usage: !ud thing to look up
Ouput: The top definition and example from urbandictionary.com
You can have the bot answer yes or no questions. Just address the bot by name like so:
mybot is the sky blue?
Response will be either Is the sky blue? No.
or Is the sky blue? Yes.
You can also ask it a this or that question, with a maximum number of arguments being three.
mybot is it going to be a good day today or a bad day today?
It is going to be a good day today
or A bad day today
fullwidth/fw
uc
ucirc
lc
lcirc
help
action