Skip to content
Snippets Groups Projects
Commit 40379dd5 authored by Bruce Cowan's avatar Bruce Cowan
Browse files

Make it start with instigator

Closes #1
parent e02dd3ea
No related branches found
No related tags found
No related merge requests found
# Copyright © 2016 Bruce Cowan <bruce@bcowan.eu>
# Copyright © 2016, 2018 Bruce Cowan <bruce@bcowan.eu>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -13,7 +13,7 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
from random import choice
import random
from errbot import BotPlugin, botcmd
......@@ -38,11 +38,12 @@ class Lart(BotPlugin):
return "**Usage**: !lart <target>"
try:
lart = choice(self.larts)
return lart.format(args)
lart = random.choice(self.larts)
except IndexError:
return "**Error**: There are no larts in the database"
return "{} {}".format(message.frm.nick, lart.format(args))
@botcmd
def lart_add(self, message, args):
"""Add a lart, requires a part '{}' which will be replaced with target"""
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment