bitbot-3.11-fork/modules/ids.py

28 lines
886 B
Python
Raw Normal View History

#--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()))
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,
2020-03-08 14:14:00 +00:00
self.exports.get("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))