Skip to content

Comments

Changed Menu to only require UserId and ChannelId#8

Open
andersgaustad wants to merge 1 commit intonextonesfaster:currentfrom
andersgaustad:new_from_ids
Open

Changed Menu to only require UserId and ChannelId#8
andersgaustad wants to merge 1 commit intonextonesfaster:currentfrom
andersgaustad:new_from_ids

Conversation

@andersgaustad
Copy link

Makes it possible to create a new menu exclusively from UserId and ChannelId without requiring a message.
Especially useful for creating a Menu object as a response to a slash command (as no Message object exists in this context, but the ids do).

For example:

pub async fn run(ctx: &Context, command_interaction: &ApplicationCommandInteraction) {

     ... code here ...

    let pages = create_pages();
    let menu = Menu::new_from_ids(ctx, &command_interaction.user.id, &command_interaction.channel_id, &pages, MenuOptions::default());

     ... more code here ...

}

Makes it possible to create a new menu exclusively from UserId and ChannelId without needing a message.
Especially useful for creating a Menu object as a response to a slash command (as no Message object exists in this context, but the ids do)
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.

1 participant