aboutsummaryrefslogtreecommitdiff
path: root/modules/ids.py
blob: 8e5dc838b24d2da908d40210a52c1686fb1b6e99 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
class Module(object):
    _name = "IDs"
    def __init__(self, bot, events, exports):
        events.on("received.command.myid").hook(self.my_id,
            help="Show your user ID")
        events.on("received.command.channelid").hook(
            self.channel_id, channel_only=True,
            help="Show the current channel's ID")

    def my_id(self, event):
        event["stdout"].write("%s: %d" % (event["user"].nickname,
            event["user"].id))

    def channel_id(self, event):
        event["stdout"].write("%s: %d" % (event["target"].name,
            event["target"].id))