I made a telegram bot with python which requests some data from user(like directory), then user_data will send to admin to confirm or reject user_data to publish in a telegram channel.
I have a problem in this part,when admin confirmed, user_data won’t send to channel and empty message sends to channel.
I think I might use callback_query but I don’t know how!
I have problem with inlinebuttonkeyboard callback:
here is the code which user_data sent to admin:
buttons = (
(
InlineKeyboardButton(text='تایید',url= 'https://t.me/kasraproject_bot?start=CONFIRMATION'),
InlineKeyboardButton(text='رد',url='https://t.me/kasraproject_bot?start=REJECT'),
),
)
admin_keyboard = InlineKeyboardMarkup(buttons)
bot.send_photo(
chat_id='145032913',photo=open('madrak.jpg','rb'),
caption='جزئیات در زیر ذکر شده استn{}'
.format(facts_to_str(user_data))+
'n برای اطلاعات بیشتر با ارسال کننده در ارتباط باشید {}'
.format(user.name),reply_markup=admin_keyboard
)
next step after admin confirmed:
if text =='/start CONFIRMATION':
del user_data('شماره موبایل')
del user_data('مدرک تحصیلی')
buttons = (
(
InlineKeyboardButton(text='ارسال پیشنهاد', url='https://t.me/kasraproject_bot?start=offer'),
InlineKeyboardButton(text='مشاهده پیشنهادات ارسالی', url='https://t.me/kasraproject_bot?start=sent_offers'),
InlineKeyboardButton(text='تعداد متقاضی',url='https://t.me/kasraproject_bot?start=offer'),
)
)
offer_keyboard = InlineKeyboardMarkup(buttons)
bot.send_message(
chat_id=chat_id,
text='جزئیات در زیر ذکر شده استn{}'
.format(facts_to_str(user_data))+
'n برای اطلاعات بیشتر با ارسال کننده در ارتباط باشید {}'
.format(user.name),reply_markup=offer_keyboard
)
offer_keyboard is for channel members to offer the user which sent his own data to send requests for contacting to him.