aboutsummaryrefslogtreecommitdiff
path: root/modules/ids.py
blob: 1738c5496b0b36e74406fe189161286744ed066b (about) (plain) (blame)
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
#--depends-on commands

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.myaccount")
    @utils.kwarg("help", "Show what I think your account name is")
    def account(self, event):
        event["stdout"].write("%s: %s" % (event["user"].nickname,
            self.exports.get_one("account-name")(event["user"])))

    @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))