| Conditions | 3 |
| Total Lines | 15 |
| Code Lines | 15 |
| Lines | 15 |
| Ratio | 100 % |
| Changes | 0 | ||
| 1 | #!/usr/bin/python |
||
| 16 | View Code Duplication | @logging_decorator("yandere") |
|
|
|
|||
| 17 | def yandere_search(bot, update, args): |
||
| 18 | update.message.chat.send_action(ChatAction.UPLOAD_PHOTO) |
||
| 19 | query = " ".join(args) |
||
| 20 | try: |
||
| 21 | direct_link, page_link = get_image(query) |
||
| 22 | except: |
||
| 23 | update.message.reply_text("Sorry, something went wrong!") |
||
| 24 | return |
||
| 25 | if direct_link is None: |
||
| 26 | update.message.reply_text("Nothing found!") |
||
| 27 | return |
||
| 28 | msg_text = "[Image]({})".format(direct_link) + "\n" + "[View post]({})".format(page_link) |
||
| 29 | update.message.reply_text(msg_text, parse_mode="Markdown") |
||
| 30 | return query |
||
| 31 | |||
| 43 | return direct_link, page_link |