-
Notifications
You must be signed in to change notification settings - Fork 1
/
-kurisu.sk
33 lines (17 loc) · 1.01 KB
/
-kurisu.sk
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
options:
cmd-prefix: ku!
bot-tag: @Kurisu
token: MjgyMTY2MDMzNzQ0Mzk2Mjg4.DX-TXA.Do4n84noKiKR7RLRbc3oYOK__is
on script load:
register pattern with id "command" using regex "(?:{@cmd-prefix}\s*|{@bot-tag}\s+)([\w\S]+)\s+([\s\S]+)?"
login to "{@token}" using the name "Kurisu"
on guild message received:
if event-string matching pattern "command":
set {_command} to group 1 from last regex match
set {_arguments::*} to regex split group 2 from last regex match using "\s"
loop {kurisu-bot::regex::pattern::command::*}:
if {_command} matching loop-value:
broadcast "test"
call custom event "kurisu %loop-index%" to details event-bot, event-channel, event-user and event-guild arguments {_arguments::*}
log "[Kurisu-bot] [%now%] %event-user% (%id of event-user%) executed command '%event-string%' (%id of event-message%) in the channel %event-channel% (%id of event-channel%) at the guild %event-guild% (%id of event-guild%)" to "Kurisu.log"
exit loop