| Conditions | 7 |
| Total Lines | 18 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 3 | ||
| Bugs | 0 | Features | 0 |
| 1 | #!/usr/bin/python |
||
| 17 | def leet(bot, update, args): |
||
|
|
|||
| 18 | if update.message.reply_to_message is not None: |
||
| 19 | args = update.message.reply_to_message.text |
||
| 20 | args = args.split(" ") |
||
| 21 | text_leet = " ".join(args).lower() |
||
| 22 | if text_leet == "": |
||
| 23 | return |
||
| 24 | replace_dict = [] |
||
| 25 | with open(leet_dictionary, "r") as file: |
||
| 26 | for i in file.readlines(): |
||
| 27 | tmp = i.split(",") |
||
| 28 | try: |
||
| 29 | replace_dict.append((tmp[0], tmp[1])) |
||
| 30 | except: |
||
| 31 | pass |
||
| 32 | text_leet = reduce(lambda a, kv: a.replace(*kv), replace_dict, text_leet) |
||
| 33 | update.message.reply_text(text_leet) |
||
| 34 | print(datetime.datetime.now(), ">>>", "Done leetspeak", ">>>", update.message.from_user.username) |
||
| 35 |