2018-09-26 17:27:17 +00:00
|
|
|
from src import ModuleManager, Utils
|
2018-08-28 14:33:56 +00:00
|
|
|
|
2018-09-26 17:27:17 +00:00
|
|
|
class Module(ModuleManager.BaseModule):
|
2018-08-28 14:33:56 +00:00
|
|
|
_name = "IDs"
|
|
|
|
|
2018-09-26 17:27:17 +00:00
|
|
|
@Utils.hook("received.command.myid")
|
2018-08-28 14:33:56 +00:00
|
|
|
def my_id(self, event):
|
2018-09-26 17:27:17 +00:00
|
|
|
"""
|
|
|
|
Show your user ID
|
|
|
|
"""
|
2018-08-28 14:33:56 +00:00
|
|
|
event["stdout"].write("%s: %d" % (event["user"].nickname,
|
2018-09-05 11:58:12 +00:00
|
|
|
event["user"].get_id()))
|
2018-08-28 14:33:56 +00:00
|
|
|
|
2018-09-26 17:27:17 +00:00
|
|
|
@Utils.hook("received.command.channelid", channel_only=True)
|
2018-08-28 14:33:56 +00:00
|
|
|
def channel_id(self, event):
|
2018-09-26 17:27:17 +00:00
|
|
|
"""
|
|
|
|
Show the current channel's ID
|
|
|
|
"""
|
2018-08-28 14:33:56 +00:00
|
|
|
event["stdout"].write("%s: %d" % (event["target"].name,
|
|
|
|
event["target"].id))
|