-
Notifications
You must be signed in to change notification settings - Fork 0
/
commands
99 lines (84 loc) · 4.77 KB
/
commands
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
# === DOCUMENTATION === #
# Empty lines and lines starting with # are IGNORED.
# Incorrect lines are also ignored (don't abuse it, punks)
# Lines that contain ' -> ' are parsed as COMMANDS.
# (the amount or type of whitespace surrounding -> is irrelevant)
# Both sides are first parsed with .format(). The following substrings are replaced:
# * {myname} = the name of the bot
# * {sender} = the sender's nick, not including ident and/or hostname
# * {channel} {message} are both obvious
# * If { or } is needed, they should be escaped: {{ resp. }}
# Left hand side:
# * parsed as a REGULAR EXPRESSION using .match(<the string>+'$')
# > this means that the whole left side has to match the whole message!
# * {arg} is replaced with (?P<arg>.+?)
# * {c} is replaced with the command_prefix-string from config
# Right hand side:
# * no regex parsing
# * {arg} is replaced with what {arg} stood for in the left side
# * {qarg} is a shorthand for quote(arg), handy for urls
# > can execute real python code if the text starts with '#py:':
# * everything after '#py:' is run through eval()
# * all modules that have been imported in THIS FILE (commands) can be used
# * that means, any and all modules that are to be used must be imported here!
# * (see IMPORT lines below for more info on how)
# * arguments ({arg}, {qarg}) are written without surrounding {}
# Lines that contain TWO ' ?> ' are parsed as HELP LINES.
# (the amount or type of whitespace surrounding ?> is irrelevant)
# These are used in the .help function.
# The structure of these lines is:
# <command> ?> <arguments> ?> <help text>
# Command:
# * {c} is replaced with the command_prefix-string
# * NOT parsed as a regex
# Arguments:
# * just a simple dumb string, should show what kind of arguments that should be provided
# Help text:
# * the text that will be shown when a user types .help command
# Lines that are NOT COMMANDS or HELP (see below) are treated as IMPORT LINES
# * The lines should follow this pattern: <module-name>, <module-name>, … etc
# * Modules that doesn't exist will not be imported or cause a crash.
# IMPORTANT! The urllib.*-modules can not be imported separately and should
# instead be imported as only urllib, once.
# === IMPORTS === #
calendar, datetime, random, urllib
# === MEMES === #
{c}tidigt -> <calle> {sender} går alltid och lägger sig tidigt
{c}tidigt {arg} -> <calle> {arg} går alltid och lägger sig tidigt
{c}tidigt/me {arg} -> * {arg} går alltid och lägger sig tidigt
{c}nej -> <jocke-l> jag har alltid och nej, det har jag inte.[\n]<jocke-l> ALLITD
{c}allitd {arg} -> <jocke-l> jag har alltid och {arg}[\n]<jocke-l> ALLITD
ALLITD -> ALLITD
{c}rullar {arg} -> {arg} rullar in som det ska[\n]det går bra nu
{c}wannab -> luktar wanna b amerikan
{c}murk( hyad)? -> ☻
{c}lose -> The Game.
{c}lök -> <Goebbels> Nu ska jag handla LÖK.
{c}lök {arg} -> <Goebbels> Nu ska {arg} handla LÖK.
.*?LÖ+K.*? -> #py: 'L' + 'Ö'*random.randint(2,8) + 'K'
{c}mr_basic -> <kobran> abobaloba baloba[\n]<kobran> he'sa mr_basic[\n]<kobran> mr fantastic
{c}yo -> * Pranz joined the channel[\n]<Pranz> Yo[\n]<calle> micraft server[\n]<Pranz> Vad ligger den på?[\n][lång tystnad]
{c}hybrid -> <psi-omega> i want it in mah hybrid car bitch!
{c}regex(es)? -> http://i.solidfiles.net/c66.jpg
{c}ok -> jag tror jag skriver ned det i syntaxtabellen
{c}ok {arg} -> {arg}: jag tror jag skriver ned det i syntaxtabellen
{c}welcome -> <nycz> welcome to the real world jackass
{c}welcome {arg} -> {arg}: welcome to the real world jackass
# === MISC === #
echo {arg} -> {arg}
{myname}! -> wuh?
{c}title -> nej
{c}ping -> pong
# === COMMANDS === #
{c}choose {arg} -> #py: random.choice(arg.split('|')).strip()
{c}tyda {arg} -> {sender}: http://tyda.se/search/{qarg}
{c}hitta {arg} -> {sender}: www.hitta.se/LargeMap.aspx?var={qarg}
{c}vecka -> #py: '{0}: Vecka {1}'.format(sender, datetime.date.today().isocalendar()[1])
{c}jdn -> #py: '{0}: Nuvarande julian day: {1:.5f}'.format(sender, calendar.timegm(datetime.datetime.utcnow().utctimetuple())/86400.0 + 2440587.5)
{c}list commands -> {sender}: https://github.com/memery/memery-legacy/blob/master/commands
{c}list plugins -> {sender}: https://github.com/memery/memery-legacy/tree/master/plugins
# === HELP TEXTS === #
{c}choose ?> <arg1> | <arg2> | … ?> Svarar med ett slumpvis valt argument.
echo ?> <text> ?> Låt {myname} skriva ut texten.
{c}title ?> ?> nej
{c}list ?> <commands|plugins> ?> Returnera länken till relevant Github-sida.