aboutsummaryrefslogtreecommitdiff
path: root/modules/ids.py
blob: 8a71c7f559341906dbbe0d1a966d07c5a48db685 (about) (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
from src import ModuleManager, Utils

class Module(ModuleManager.BaseModule):
    _name = "IDs"

    @Utils.hook("received.command.myid")
    def my_id(self, event):
        """
        :help: Show your user ID
        """
        event["stdout"].write("%s: %d" % (event["user"].nickname,
            event["user"].get_id()))

    @Utils.hook("received.command.channelid", channel_only=True)
    def channel_id(self, event):
        """
        :help: Show the current channel's ID
        """
        event["stdout"].write("%s: %d" % (event["target"].name,
            event["target"].id))