Skip to content

Feature Request: Support Throttle and DefaultParseMode adaptors in MockBot #25

@janwytze

Description

@janwytze

Is your feature request related to a problem? Please describe.

When a handler needs to support a bot that for example throttling, the handler cannot be tested anymore using MockBot, since that initializes a Bot without any adapters.

Describe the solution you'd like
An easy way to enable Throttle and ParseMode on a MockBot.

Describe alternatives you've considered

This does seem to fix my test, but it is not very pretty.

let bot = MockBot::new(msg, handler_tree());

let adaptor_bot = bot
    .bot
    .clone()
    .throttle(Limits::default())
    .parse_mode(ParseMode::MarkdownV2)
    .clone();

bot.dependencies(dptree::deps![adaptor_bot]);

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions