Added !dice command
This commit is contained in:
parent
9921d067ff
commit
903076de54
4 changed files with 57 additions and 6 deletions
|
@ -1,3 +1,5 @@
|
|||
import dice
|
||||
|
||||
from butterrobot.plugins import Plugin
|
||||
from butterrobot.objects import Message
|
||||
|
||||
|
@ -9,3 +11,13 @@ class LoquitoPlugin(Plugin):
|
|||
async def on_message(cls, message):
|
||||
if "lo quito" in message.text.lower():
|
||||
yield Message(chat=message.chat, reply_to=message.id, text="Loquito tu.",)
|
||||
|
||||
|
||||
class DicePlugin(Plugin):
|
||||
id = "contrib/fun/dice"
|
||||
|
||||
@classmethod
|
||||
async def on_message(cls, message: Message):
|
||||
if message.text.startswith("!dice"):
|
||||
roll = int(dice.roll(message.text.replace("!dice ", "")))
|
||||
yield Message(chat=message.chat, reply_to=message.id, text=roll)
|
Loading…
Add table
Add a link
Reference in a new issue