def comment(bot, update):
    log_username(update)

    def send(message):
        bot.send_message(chat_id=update.message.chat_id, text=message)

    match = re.match(r'^\/comment\s(([a-z]+\s)*[a-z]+)$', update.message.text, re.IGNORECASE)

    if not match:
        send('send "/comment" followed by a search term. Example:\n\n/comment big dick')
        return

    send('Searching... Hang on!')

    search_term = match.group(1).replace(' ', '+')

    try:
        author, content, title = choose_random_porn_comment(search_term)
        send(f'Comment by {author}:\n{content}\n\nI saw it in the video:\n{title}')
    except XvideosException as ex:
        logging.error(f'{ex}')
        send(f'There was an error!\n\n{ex}')
    except Exception as ex:
        logging.error(f'{ex}')
        send('There was an error! Contact @GabrielBlank on Telegram')
def comentario(bot, update):
    def send(message):
        bot.send_message(chat_id=update.message.chat_id, text=message)

    send('Vou procurar um comentário aqui, perae...')
    comment = choose_random_porn_comment()
    send(comment_to_str(comment))
async def mensagem(ctx):
    await ctx.send('**Buscando...\n**')
    try:
        author, content, title, url = choose_random_porn_comment()
        await ctx.send(format_comment(author, content, title, url))
        await ctx.send('https://xvideos.com' + url)
    except Exception:
        await ctx.send('Houve uma falha na busca. Tente novamente.')

    await discord.Message.delete(ctx.message)
def comentario(bot, update):
    def send(message):
        bot.send_message(chat_id=update.message.chat_id, text=message)

    send('Vou procurar um comentario aqui, perae...')

    try:
        comment = choose_random_porn_comment()
        send(format_comment(*comment))
    except Exception:
        send('Houve um erro! Entre em contato com @GabrielBlank via Telegram')
async def telemensagem(ctx):
    await ctx.send('Buscando...')
    try:
        author, comment, title, url = choose_random_porn_comment()
        author = '**O ' + author + '  comentou o seguinte:**\n'
        title = '**vi isso no video:**\n`' + title + '`'
        await ctx.send(author)
        await ctx.send(comment, tts=True)
        await ctx.send(title)
        await ctx.send('https://xvideos.com' + url)
    except Exception:
        await ctx.send('Houve uma falha na busca. Tente novamente.')

    await discord.Message.delete(ctx.message)
def comentario(bot, update):
    log_username(update)

    def send(message):
        bot.send_message(chat_id=update.message.chat_id, text=message)

    send('Vou procurar um comentario aqui, perae...')

    try:
        author, content, title = choose_random_porn_comment()
        send(f'{author} comentou o seguinte:\n{content}\n\nVi isso no video:\n{title}')
    except XvideosException as ex:
        send(f'Erro!\n\n{ex}')
        logging.error(f'{ex}')
    except Exception as ex:
        logging.error(f'{ex}')
        send('Houve um erro! Entre em contato com @GabrielBlank no Telegram')
Exemplo n.º 7
0
def comment(bot, update):
    def send(message):
        bot.send_message(chat_id=update.message.chat_id, text=message)

    match = re.match(r'^\/comment\s(([a-z]+\s)*[a-z]+)$', update.message.text, re.IGNORECASE)

    search_term = None

    if match:
        search_term = match.group(1).replace(' ', '+')

    send('Searching... Hang on!')

    try:
        comment = choose_random_porn_comment(search_term)
        message = f'{comment.author} from {comment.country} commented {comment.datediff} with a score of {comment.score}:\n{comment.content}'
        send(message)
    except XvideosException as ex:
        logging.error(f'{ex}')
        send(f'There was an error:\n\n{ex}')
    except Exception as ex:
        logging.error(f'{ex}')
        send('There was an unknown error! Contact @GabrielBlank on Telegram')