better looking code

This commit is contained in:
Mylloon 2021-08-04 19:40:03 +02:00
parent 5f060f9e24
commit c406d1c1d1

16
main.py
View file

@ -130,17 +130,13 @@ if __name__ == '__main__':
""" """
errorMessage = "Une erreur survient !" # error message errorMessage = "Une erreur survient !" # error message
# words to detect # words to detect in lowercase
base = { base = {
"quoi": ["quoi", "koi", "quoient", "q u o i"], "quoi": ["quoi", "koi", "quoient"],
"oui": ["oui", "ui"], "oui": ["oui", "ui"],
"non": ["non", "nn"], "non": ["non", "nn"],
"nan": ["nan"] "nan": ["nan"]
} }
universalBase = createBaseTrigger(list(base.values()))
# creation of the list with all alternatives (upper/lower case)
triggerWords = permute(universalBase)
# creation of answers # creation of answers
answers = { answers = {
@ -153,7 +149,13 @@ if __name__ == '__main__':
"non": createBaseAnswers("bril"), "non": createBaseAnswers("bril"),
"nan": createBaseAnswers("cy") "nan": createBaseAnswers("cy")
} }
# creation of a list of all the words (only lowercase)
universalBase = createBaseTrigger(list(base.values()))
# creation of a list of all the words (upper and lower case)
triggerWords = permute(universalBase)
# loading environment variables and launching the bot # loading environment variables and launching the bot
keys = load(["TOKEN", "TOKEN_SECRET", "CONSUMER_KEY", "CONSUMER_SECRET", "PSEUDOS"]) keys = load(["TOKEN", "TOKEN_SECRET", "CONSUMER_KEY", "CONSUMER_SECRET", "PSEUDOS"])
main(keys["TOKEN"], keys["TOKEN_SECRET"], keys["CONSUMER_KEY"], keys["CONSUMER_SECRET"], keys["PSEUDOS"]) main(keys["TOKEN"], keys["TOKEN_SECRET"], keys["CONSUMER_KEY"], keys["CONSUMER_SECRET"], keys["PSEUDOS"])