| Conditions | 4 |
| Total Lines | 16 |
| Code Lines | 15 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/python |
||
| 23 | def rate(bot, update, args): |
||
| 24 | current_time = datetime.strftime(datetime.now(), "%d.%m.%Y %H:%M:%S") |
||
| 25 | if update.message.reply_to_message is not None: |
||
| 26 | if update.message.reply_to_message.text is not None: |
||
| 27 | args = update.message.reply_to_message.text.split(" ") |
||
| 28 | string = " ".join(args).lower() |
||
| 29 | if string == "": |
||
| 30 | seed() |
||
| 31 | else: |
||
| 32 | seed(string) |
||
| 33 | rng = random() * 10 |
||
| 34 | rounded = round(rng * 2) / 2 |
||
| 35 | rating = str(ifint(rounded)) |
||
| 36 | update.message.reply_text("🤔 I rate this "+rating+"/10") |
||
| 37 | print(current_time, ">", "/rate", ">", update.message.from_user.username) |
||
| 38 | log_command(bot, update, current_time, "rate") |
||
| 39 |