mirror of
https://github.com/Cog-Creators/Red-DiscordBot.git
synced 2025-11-08 12:18:54 -05:00
[General] Multi character prefix support for polls (#689)
This commit is contained in:
parent
820f62f94f
commit
3b93bb776a
@ -339,7 +339,7 @@ class General:
|
||||
if "@everyone" in check or "@here" in check:
|
||||
await self.bot.say("Nice try.")
|
||||
return
|
||||
p = NewPoll(message, self)
|
||||
p = NewPoll(message, " ".join(text), self)
|
||||
if p.valid:
|
||||
self.poll_sessions.append(p)
|
||||
await p.start()
|
||||
@ -377,13 +377,12 @@ class General:
|
||||
return user.joined_at
|
||||
|
||||
class NewPoll():
|
||||
def __init__(self, message, main):
|
||||
def __init__(self, message, text, main):
|
||||
self.channel = message.channel
|
||||
self.author = message.author.id
|
||||
self.client = main.bot
|
||||
self.poll_sessions = main.poll_sessions
|
||||
msg = message.content[6:]
|
||||
msg = msg.split(";")
|
||||
msg = [ans.strip() for ans in text.split(";")]
|
||||
if len(msg) < 2: # Needs at least one question and 2 choices
|
||||
self.valid = False
|
||||
return None
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user