Fixing decidee lgoic and shortening excuse logic
This commit is contained in:
parent
530bfc506c
commit
fcf39f1ed8
@ -1,11 +1,11 @@
|
||||
import random
|
||||
import help_methods
|
||||
|
||||
def get_decide_choice(decide):
|
||||
choices = decide.replace('!decide', '' ).lstrip().split(' or ')
|
||||
if len(choices) > 1:
|
||||
return random.choice(choices)
|
||||
elif '' in choices:
|
||||
def decide(message):
|
||||
choices = message.replace('!decide', '' ).lstrip().split(' or ')
|
||||
if '' in choices:
|
||||
return help_methods.get_help_message('decide')
|
||||
elif len(choices) > 1:
|
||||
return random.choice(choices)
|
||||
else:
|
||||
return random.choice(["yes", "no"])
|
||||
|
@ -175,10 +175,13 @@ async def on_message(message):
|
||||
# await client.send_message(message.channel, 'Deleted {} message(s)'.format(len(deleted)))
|
||||
|
||||
if message.content.startswith('!decide'):
|
||||
await client.send_message(message.channel,
|
||||
"{} {}".format(message.author.mention,
|
||||
decide_method.get_decide_choice(message.content)))
|
||||
|
||||
await client.send_message(
|
||||
message.channel,
|
||||
"{} {}".format(
|
||||
message.author.mention,
|
||||
decide.decide(message.content)
|
||||
)
|
||||
)
|
||||
|
||||
|
||||
if message.content.startswith('!cleanup') and message.author.id == '144986109804412928':
|
||||
|
@ -1,7 +1,6 @@
|
||||
import random, requests
|
||||
|
||||
def get_excuse():
|
||||
excuses = requests.get(
|
||||
'https://gist.githubusercontent.com/AndrewBrinker/6763cdd5d79d6e3eaa3f/raw/624b946ebcca71ac76b74afa5ea41280540c1b97/excuses.txt'
|
||||
).text.split("\n")
|
||||
return random.choice(excuses)
|
||||
url = ("https://gist.githubusercontent.com/AndrewBrinker/6763cdd5d79d6e" \
|
||||
"3eaa3f/raw/624b946ebcca71ac76b74afa5ea41280540c1b97/excuses.txt")
|
||||
return random.choice(requests.get(url).text.split("\n"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user