This repository has been archived on 2021-04-24. You can view files and clone it, but cannot push or open issues or pull requests.
Mikubot-2/plugins/me.lua
topkecleon 725261fcf7 Version 3.8
Relicense to AGPLv3, with consent of contributors.
bindings.lua completely rewritten. Shift to multipart-post.
Updated readme.
New plugins: bing.lua, channel.lua.
Removed plugins: floodcontrol.lua, librefm.lua.
luarun.lua: Will now serialize returned tables. Aliased "/return" to "/lua return".
2016-05-29 13:08:39 -04:00

30 lines
677 B
Lua

local me = {}
local utilities = require('utilities')
function me:init()
me.triggers = utilities.triggers(self.info.username):t('me', true).table
end
function me:action(msg)
local target = self.database.users[msg.from.id_str]
if msg.from.id == self.config.admin and (msg.reply_to_message or utilities.input(msg.text)) then
target = utilities.user_from_message(self, msg, true)
if target.err then
utilities.send_reply(self, msg, target.err)
return
end
end
local output = ''
for k,v in pairs(target) do
output = output .. '*' .. k .. ':* `' .. tostring(v) .. '`\n'
end
utilities.send_message(self, msg.chat.id, output, true, nil, true)
end
return me