2018-08-28 14:33:56 +00:00
|
|
|
|
|
|
|
|
|
|
|
class Module(object):
|
|
|
|
_name = "IDs"
|
2018-09-02 18:54:45 +00:00
|
|
|
def __init__(self, bot, events, exports):
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("received.command.myid").hook(self.my_id,
|
2018-08-28 14:33:56 +00:00
|
|
|
help="Show your user ID")
|
2018-08-31 11:55:52 +00:00
|
|
|
events.on("received.command.channelid").hook(
|
2018-08-28 14:33:56 +00:00
|
|
|
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))
|