Skip to content

Commit 2c19549

Browse files
committed
Merge pull request #42 from webvictim/upstream
Actually fix .grabrandom support in heralds this time
2 parents 1b0e2b5 + 51bf303 commit 2c19549

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

plugins/herald.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
from cloudbot.event import EventType
44
from plugins import grab
55

6+
import random
7+
68
db_ready = []
79

810

@@ -59,7 +61,8 @@ def welcome(nick, action, message, chan, event, db, conn):
5961
if greet.lower().split(' ')[0] == ".grabrandom":
6062
text = ""
6163
if len(greet.split(' ')) >= 2:
62-
text = greet.lower().split(' ')[1]
64+
candidates = greet.lower().split(' ')[1:]
65+
text = random.choice(candidates)
6366
out = grab.grabrandom(text, chan, message)
6467
message(out, chan)
6568
else:

0 commit comments

Comments
 (0)