Changed link to button
This commit is contained in:
@@ -13,7 +13,7 @@ from selenium.webdriver.common.keys import Keys
|
||||
from selenium.webdriver.common.by import By
|
||||
from selenium.webdriver.chrome.options import Options
|
||||
from selenium import webdriver
|
||||
from telegram import Update, ForceReply
|
||||
from telegram import Update, ForceReply, InlineKeyboardButton, InlineKeyboardMarkup
|
||||
from telegram.ext import Updater, CommandHandler, MessageHandler, Filters, CallbackContext
|
||||
|
||||
def get_chrome_options():
|
||||
@@ -96,7 +96,9 @@ def find_amazon_link(update: Update, context: CallbackContext) -> None:
|
||||
if not product_id:
|
||||
product_id = dbhelper.add_product(user['username'], chat['title'], user['id'], chat['id'], msg, referurl, title, price, image)
|
||||
helpers.create_image(product_id, price)
|
||||
context.bot.send_photo(chat_id=update.message.chat_id, photo=open(f"/app/data/images/products/{product_id}_composed.png", 'rb'), caption=f"URL enviada por @{user['username']}: \n\n{title} \n\n{referurl}")
|
||||
keyboard = [[InlineKeyboardButton("Ir a Amazon", url=f"{referurl}")]]
|
||||
markup = InlineKeyboardMarkup(keyboard)
|
||||
context.bot.send_photo(chat_id=update.message.chat_id, photo=open(f"/app/data/images/products/{product_id}_composed.png", 'rb'), caption=f"URL enviada por @{user['username']}: \n\n{title}", reply_markup=markup)
|
||||
|
||||
def main() -> None:
|
||||
dbhelper.setup_db()
|
||||
|
||||
Reference in New Issue
Block a user