7583763067:AAHNu2yy_ZsSgYzj0Y1XV38NK0q2CE1XrlM
Why you didn't work perfectly? First time error, now I click on button Start captcha so Didn't work edit message. And remember Don't repeat emoji anytime any user. I need all the all emoji of emojis. Also add back button inline when start captcha, when user click then Edit message and do back so start.
Give me all edit button they command don't include in @, and also found error:
if message.text.startswith("/img"):
prompt = message.text[4:].strip()
if prompt:
bot.sendChatAction(
chat_id=message.chat.id,
action="typing"
)
api_url = f"https://botfather.cloud/Apis/ImgGen/client.php?inputText={prompt}"
try:
response = HTTP.get(api_url, proxy=True)
if response.status_code == 200:
truncated_prompt = (prompt[:60] + '...') if len(prompt) > 60 else prompt
caption = f"<b>🖼️ Generated: </b><i>{truncated_prompt}</i>"
bot.sendChatAction(
chat_id=message.chat.id,
action="upload_photo"
)
bot.sendPhoto(
chat_id=message.chat.id,
photo=response.content,
reply_to_message_id=message.message_id,
caption=caption,
parse_mode="HTML"
)
else:
bot.sendMessage(
chat_id=message.chat.id,
text="⚠️ <b>Service unavailable</b>",
parse_mode="HTML",
reply_to_message_id=message.message_id
)
except Exception as e:
bot.sendMessage(
chat_id=message.chat.id,
text="⚠️ <b>Processing error</b>",
parse_mode="HTML",
reply_to_message_id=message.message_id
)
else:
bot.sendMessage(
chat_id=message.chat.id,
text="✏️ <b>Please provide a prompt</b>\nExample: <code>/img cute cat</code>",
parse_mode="HTML",
reply_to_message_id=message.message_id
)
Comments
Post a Comment