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

Changed Menu to only require UserId and ChannelId #8

Open
wants to merge 1 commit into
base: current
Choose a base branch
from

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.

None yet

1 participant