mirror of
https://github.com/RussellChamp/tilde-projects.git
synced 2026-10-28 08:32:32 +00:00
tildebot | Accept alternative correct anagrams
Since this means there's multiple possible answers, I made it so that the answer can now be a function, and that gets run with the guess. This may open the door to other puzzle ideas that have been ignored due to having more than one correct answer.
This commit is contained in:
1 parent
f883cda857
commit
888b3e871a
2 files changed
+13
-2
No files matched your search
@@ -146,7 +146,7 @@ def challenge_response(channel, user, name, time, msg):
|
||||
print(msg);
|
||||
if(challenges.has_key(user)):
|
||||
answer, bonus = challenges[user]
|
||||
if(msg.lower() == str(answer).lower() or msg == p.number_to_words(answer)):
|
||||
if((callable(answer) and answer(msg.lower())) or (msg.lower() == str(answer).lower() or msg == p.number_to_words(answer))):
|
||||
give_tilde(channel, user, name, time, True, bonus);
|
||||
else:
|
||||
give_tilde(channel, user, name, time, False, 0);
|
||||
|
||||
Reference in new issue
Block a user