-
Notifications
You must be signed in to change notification settings - Fork 2
/
RollBot.py
42 lines (31 loc) · 1.01 KB
/
RollBot.py
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
import random
from plugin import Plugin
class RollBot(Plugin):
command_description = "RollBot Usage:\n" \
"!roll"
priority = 20
def __init__(self):
return
# self.database = None
# self.prefix = ""
# self.userinfos = dict()
def weixin_enabled(self):
return True
def load_data(self, data_path="", redis_pool=None, **kwargs):
# self.prefix = "http://{}/openqq".format(webqq)
# self.database = redis.StrictRedis(connection_pool=redis_pool)
return
def supported_commands(self):
return ['!roll']
def command_received(self, command, content, messageInfo):
if command == '!roll':
point = random.randint(0, 100)
return "{} roll 了 {} 点".format(messageInfo['sender'], point)
return 'received'
def message_received(self, message):
return ''
def group_info_changed(self, info):
print(info)
return
def exit(self):
return