Allow users to see their internal IDs and channel IDs
This commit is contained in:
parent
f8a6aa087b
commit
4922ee8f4a
1 changed files with 18 additions and 0 deletions
18
modules/ids.py
Normal file
18
modules/ids.py
Normal file
|
@ -0,0 +1,18 @@
|
||||||
|
|
||||||
|
|
||||||
|
class Module(object):
|
||||||
|
_name = "IDs"
|
||||||
|
def __init__(self, bot):
|
||||||
|
bot.events.on("received.command.myid").hook(self.my_id,
|
||||||
|
help="Show your user ID")
|
||||||
|
bot.events.on("received.command.channelid").hook(
|
||||||
|
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))
|
Loading…
Reference in a new issue