hi. im trying to make a custom channel for my bot. I just copied the telegram channel file from rasa core, and tried to add a function for pagination. i tried following this tutorial here: python-telegram-bot-pagination · PyPI
CODE #1 (usage example from api):
from telegram_bot_pagination import InlineKeyboardPaginator
paginator = InlineKeyboardPaginator(
page_count,
current_page=page,
data_pattern='page#{page}'
)
bot.send_message(
chat_id,
text,
reply_markup=paginator.markup,
)
this is how i added it in my cusom_channel.py: (although im also not sure if i did it correctly)
CODE #2 (custom_channel.py)
async def send_paginate(
self, recipient_id: Text, chat_id, list_pages: List, page=1, **kwargs: Any
) -> None:
paginator = InlineKeyboardPaginator(
len(list_pages),
current_page=page,
data_pattern='page#{page}'
)
self.send_message(
chat_id,
list_pages[page-1],
reply_markup=paginator.markup
)
how do i access the chat_id? where can i get this info? so far, it does not give any errors when i run it, but i tried adding in the actions.py:
CODE #3 (actions.py)
dispatcher.utter_message(list_pages=list_pages)
but i checked and it doesnt call the “send_paginate” function, and instead calls the “send_text_message” function (which is already found initially in the telegram.py channel of rasa core)
just to reiterate, my questions are:
1.) am i implementing telegram pagination api (CODE#1), to my custom channel (CODE#2) correctly? is there any error in my code, perhaps syntax wise?
2.) how do i access the needed variable chat_id for the paginate function (CODE#2)?
3.) am i calling the function “send_paginate” correctly in my actions.py (CODE#3)? should i be using a different function to call it? and should i also pass a value for chat_id or is this passed in the custom_channel.py?
im really sorry if im all over the place or if my questions dont make sense (ノAヽ). i really hope someone could help me. thank u so much!