aboutsummaryrefslogtreecommitdiff
path: root/modules/ids.py
diff options
context:
space:
mode:
authorGravatar jesopo2018-08-28 15:33:56 +0100
committerGravatar jesopo2018-08-28 15:33:56 +0100
commit4922ee8f4ab7501029716e8a3e6478386ec13fc8 (patch)
tree5c8a5b85b1ba844ba531d9ce03629d1d2be32fb8 /modules/ids.py
parentSave when a user sends their "first" words (won't be correct for old users) (diff)
signature
Allow users to see their internal IDs and channel IDs
Diffstat (limited to 'modules/ids.py')
-rw-r--r--modules/ids.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/modules/ids.py b/modules/ids.py
new file mode 100644
index 00000000..c8bd8042
--- /dev/null
+++ b/modules/ids.py
@@ -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))