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

The same message repeated over and over #225

Open
vi opened this issue Dec 9, 2020 · 4 comments
Open

The same message repeated over and over #225

vi opened this issue Dec 9, 2020 · 4 comments

Comments

@vi
Copy link

vi commented Dec 9, 2020

I'm trying to run a simple example that just prints all updates to console:

    while let Some(update) = api.stream().next().await {
        let update  = update?;
        println!("{:?}", update);        
    }

I added the bot to a group, then issued /test command. But now each time when I try to start the bot I get something like this:

Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }
Update { id: 65538971, kind: Message(Message { id: MessageId(4), from: User { id: UserId(redacted), first_name: "redacted", last_name: None, username: Some("redacted"), is_bot: false, language_code: Some("c") }, date: 1607538634, chat: Group(Group { id: GroupId(-redacted), title: "redacted", all_members_are_administrators: true, invite_link: None }), forward: None, reply_to_message: None, edit_date: None, kind: Text { data: "/test", entities: [MessageEntity { offset: 0, length: 5, kind: BotCommand }] } }) }

Lines appear about 4 times per second.

FAQ suggests that that something is wrong with "offset" parameter.

@eastrd
Copy link

eastrd commented Apr 19, 2021

I have encountered the same issue....
Did you end up solve this problem?

@vi
Copy link
Author

vi commented Apr 19, 2021

The bot I was implementing is basically send-only, so I just turned off receiving of the messages unless in debug mode.

@eastrd
Copy link

eastrd commented Apr 21, 2021

The bot I was implementing is basically send-only, so I just turned off receiving of the messages unless in debug mode.

Thank you for the reply. Rip I hope I can find a solution to this

@InAnYan
Copy link

InAnYan commented Jul 25, 2024

I also have this issue with /start command.

I tried to use this create instead of teloxide, because I didn't like its dptree

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

No branches or pull requests

3 participants