#🔒 Telebot title and description not showing

32 messages · Page 1 of 1 (latest)

last masonBOT
#

@autumn sorrel

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

#

Hey @autumn sorrel!

It looks like you pasted Python code without syntax highlighting.

Please use syntax highlighting to improve the legibility of your code and make it easier for us to help you.

To do this, use the following method:
```py
print('Hello, world!')
```

This will result in the following:

print('Hello, world!')```
You can **edit your original message** to correct your code block.
marsh cedar
#

You message was deleted because you leaked the TOKEN

autumn sorrel
#

oh, sorry

#

1 second

marsh cedar
#

Please reset your TOKEN and paste without the token.

#

You need to invalidate that TOKEN completely, it's no good anymore.

autumn sorrel
#

im using telebot to make telegram inline bot that sends a photo but when u type in bot name it doesnt show title and description, it only shows the photo thats being sent

code:

#
from telebot import types
from random import randint

TOKEN = "TOKEN"
bot = telebot.TeleBot(TOKEN)


@bot.inline_handler(lambda query: query.query == '')
def default_query(inline_query):
    try:
        r4 = types.InlineQueryResultPhoto(4,
                                          title='Дмитрий Уткин',
                                          description='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН',
                                          photo_url='https://myspeaker.ru/wp-content/uploads/2023/05/%D0%90%D1%80%D1%82%D0%B5%D0%BC%D0%B8%D0%B9-%D0%9B%D0%B5%D0%B1%D0%B5%D0%B4%D0%B5%D0%B2.jpg',
                                          thumbnail_url='https://avatars.mds.yandex.net/get-kinopoisk-image/1777765/e1a15dc7-527a-4a12-adff-aacbc0f60797/220x330',
                                          caption='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН')
        bot.answer_inline_query(inline_query.id, [r4])
    except Exception as ex:
        print(ex)


bot.infinity_polling()
frail iron
# autumn sorrel ```import telebot from telebot import types from random import randint TOKEN = ...
import telebot
from telebot import types
from random import randint

TOKEN = "TOKEN"
bot = telebot.TeleBot(TOKEN)


@bot.inline_handler(lambda query: query.query == '')
def default_query(inline_query):
    try:
        r4 = types.InlineQueryResultPhoto(4,
                                          title='Дмитрий Уткин',
                                          description='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН',
                                          photo_url='https://myspeaker.ru/wp-content/uploads/2023/05/%D0%90%D1%80%D1%82%D0%B5%D0%BC%D0%B8%D0%B9-%D0%9B%D0%B5%D0%B1%D0%B5%D0%B4%D0%B5%D0%B2.jpg',
                                          thumbnail_url='https://avatars.mds.yandex.net/get-kinopoisk-image/1777765/e1a15dc7-527a-4a12-adff-aacbc0f60797/220x330',
                                          caption='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН')
        bot.answer_inline_query(inline_query.id, [r4])
    except Exception as ex:
        print(ex)


bot.infinity_polling()
#

put it in py thats better

frail iron
#

```py
code

#

thats how i put it

autumn sorrel
#

oh

#

got it

#

never used this thing in discord before

#

ty

marsh cedar
#

You leaked token again

autumn sorrel
#
import telebot
from telebot import types
from random import randint

TOKEN = "TOKEN"
bot = telebot.TeleBot(TOKEN)


@bot.inline_handler(lambda query: query.query == '')
def default_query(inline_query):
    try:
        r4 = types.InlineQueryResultPhoto(4,
                                          title='Дмитрий Уткин',
                                          description='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН',
                                          photo_url='https://myspeaker.ru/wp-content/uploads/2023/05/%D0%90%D1%80%D1%82%D0%B5%D0%BC%D0%B8%D0%B9-%D0%9B%D0%B5%D0%B1%D0%B5%D0%B4%D0%B5%D0%B2.jpg',
                                          thumbnail_url='https://avatars.mds.yandex.net/get-kinopoisk-image/1777765/e1a15dc7-527a-4a12-adff-aacbc0f60797/220x330',
                                          caption='ТЕКСТ НАПИСАЛ ДМИТРИЙ УТКИН')
        bot.answer_inline_query(inline_query.id, [r4])
    except Exception as ex:
        print(ex)


bot.infinity_polling()
marsh cedar
#

Maybe show screenshot or traceback if there's an error

#

!trace

last masonBOT
#
Traceback

Please provide the full traceback for your exception in order to help us identify your issue.
While the last line of the error message tells us what kind of error you got,
the full traceback will tell us which line, and other critical information to solve your problem.
Please avoid screenshots so we can copy and paste parts of the message.

A full traceback could look like:

Traceback (most recent call last):
  File "my_file.py", line 5, in <module>
    add_three("6")
  File "my_file.py", line 2, in add_three
    a = num + 3
        ~~~~^~~
TypeError: can only concatenate str (not "int") to str

If the traceback is long, use our pastebin.

autumn sorrel
#

title just doesnt show up

#

just a photo

#

1 second

last masonBOT
#
Python help channel closed

This help channel has been closed and it's no longer possible to send messages here. If your question wasn't answered, feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.