forked from httyd/dragonskills
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathexample.py
More file actions
36 lines (20 loc) · 791 Bytes
/
Copy pathexample.py
File metadata and controls
36 lines (20 loc) · 791 Bytes
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
from dragonbot import Skill, command, match
class ExampleSkill(Skill):
def __init__(self, bot):
self.bot = bot
self.dragon_count = 0
self.last_dragon = None
@command("name")
def name(self, message, args):
message.reply("Your name is " + message.nick + ".")
@command("admin", admin = True)
def admin(self, message, args):
message.reply("/me bows down to " + message.nick + ".")
@match("dragon(?! stats)")
def dragons(self, message):
self.dragon_count += 1
self.last_dragon = message
@command("dragon stats")
def dragon_stats(self, message, args):
message.reply("Dragon count: " + str(self.dragon_count) + "\n" +
"Last dragon: " + repr(self.last_dragon))