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/otouto/plugins/roll.lua
Andreas Bielawski 2118a844d9 - Restrukturierung: "require" wird nun nicht mehr in jedem Plugin benötigt
- Echo: Korrekte Ausgabe in Supergruppen
2016-07-31 21:29:44 +02:00

30 lines
543 B
Lua

local roll = {}
roll.command = 'roll'
function roll:init(config)
roll.triggers = utilities.triggers(self.info.username, config.cmd_pat):t('roll', true).table
roll.doc = [[*
]]..config.cmd_pat..[[roll*: Werfe einen Würfel]]
end
local canroll = {
"1",
"2",
"3",
"4",
"5",
"6"
}
function roll:roll_dice()
local randomroll = math.random(6)
return canroll[randomroll]
end
function roll:action(msg)
utilities.send_reply(self, msg, 'Du hast eine *'..roll:roll_dice()..'* gewürfelt.', true)
end
return roll