Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Telegram client refactor for bot info availability #308

Merged
merged 2 commits into from
Nov 14, 2024

Conversation

ropresearch
Copy link
Collaborator

Relates to:

TELEGRAM CLIENT NOT WORKING ISSUE [RESOLVED WITH THIS PR]

Risks

Medium Risk: Uses some functionality directly from TelegrafJS source code to grab bot information to listen for new messages.

Background

PR changes the telegram client and index of the telegram client so that bot info is actually made available to the message listener and the agent can reply to users.

As stated above.

Many users including myself were not able to get the telegram bot to actually respond despite it logging the client as running/working.

Documentation changes needed?

Testing

image

The image above shows us that we are receiving all bot information and propagating it to the message handler.

["◎ 📱 Constructing new TelegramClient..."]

["◎ ✅ TelegramClient constructor completed"]

["◎ 🚀 Starting Telegram bot..."]

["◎ ✨ Telegram bot successfully launched and is running!"]

Server running at http://localhost:3000/
Bot username test: @ropAIrito_bot
Bot username: @ropAIrito_bot
message manager bot info: @[object Object]
["◎ Setting up message handler..."]

["✓ ✅ Telegram client successfully started for character ropAIrito"]

telegramClient TelegramClient {
bot: Telegraf {
handler: [Function (anonymous)],
context: {},
webhookFilter: [Function (anonymous)],
handleError: [Function (anonymous)],
options: {
telegram: {},
handlerTimeout: 90000,
contextType: [class Context]
},
telegram: Telegram {
token: [REDACTED],
response: undefined,
options: [Object]
},
botInfo: {
id: 7775236789,
is_bot: true,
first_name: '$ROPIRITO',
username: 'ropAIrito_bot',
can_join_groups: true,
can_read_all_group_messages: false,
supports_inline_queries: true,
can_connect_to_business: false,
has_main_web_app: false
}
}

@ropresearch ropresearch marked this pull request as ready for review November 14, 2024 04:58
@lalalune lalalune merged commit e235713 into main Nov 14, 2024
1 check passed
@lalalune lalalune deleted the telegram-client-fixes branch November 14, 2024 07:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants