2019-05-25 20:40:06 +00:00
|
|
|
#--depends-on commands
|
|
|
|
|
2018-10-03 12:22:37 +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-10-03 12:22:37 +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
|
|
|
"""
|
2018-09-30 16:29:09 +00:00
|
|
|
:help: Show your user ID
|
2018-09-26 17:27:17 +00:00
|
|
|
"""
|
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()))
|
2019-09-17 14:15:54 +00:00
|
|
|
@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,
|
2019-11-22 11:48:29 +00:00
|
|
|
self.exports.get_one("account-name")(event["user"])))
|
2018-08-28 14:33:56 +00:00
|
|
|
|
2018-10-03 12:22:37 +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
|
|
|
"""
|
2018-09-30 16:29:09 +00:00
|
|
|
:help: Show the current channel's ID
|
2018-09-26 17:27:17 +00:00
|
|
|
"""
|
2018-08-28 14:33:56 +00:00
|
|
|
event["stdout"].write("%s: %d" % (event["target"].name,
|
|
|
|
event["target"].id))
|