The !id command returns the user ID of the current thread. Useful for
getting the user ID on mobile.
master
Dragory 2018-04-21 15:41:03 +03:00
parent e5b29a235e
commit 319f6571bc
2 changed files with 12 additions and 0 deletions

View File

@ -19,6 +19,7 @@ const greeting = require('./modules/greeting');
const typingProxy = require('./modules/typingProxy'); const typingProxy = require('./modules/typingProxy');
const version = require('./modules/version'); const version = require('./modules/version');
const newthread = require('./modules/newthread'); const newthread = require('./modules/newthread');
const idModule = require('./modules/id');
const attachments = require("./data/attachments"); const attachments = require("./data/attachments");
const {ACCIDENTAL_THREAD_MESSAGES} = require('./data/constants'); const {ACCIDENTAL_THREAD_MESSAGES} = require('./data/constants');
@ -172,6 +173,7 @@ module.exports = {
await typingProxy(bot); await typingProxy(bot);
await version(bot); await version(bot);
await newthread(bot); await newthread(bot);
await idModule(bot);
// Connect to Discord // Connect to Discord
console.log('Connecting to Discord...'); console.log('Connecting to Discord...');

10
src/modules/id.js Normal file
View File

@ -0,0 +1,10 @@
const threadUtils = require("../threadUtils");
module.exports = bot => {
const addInboxServerCommand = (...args) => threadUtils.addInboxServerCommand(bot, ...args);
addInboxServerCommand('id', async (msg, args, thread) => {
if (! thread) return;
thread.postSystemMessage(thread.user_id);
});
};