Skip to content

Commit

Permalink
Remove impl AsRef to match serenity@next
Browse files Browse the repository at this point in the history
  • Loading branch information
GnomedDev committed Mar 1, 2024
1 parent 25a61c9 commit 258ae5f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
3 changes: 2 additions & 1 deletion examples/basic_structure/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,8 @@ async fn main() {
.setup(move |ctx, _ready, framework| {
Box::pin(async move {
println!("Logged in as {}", _ready.user.name);
poise::builtins::register_globally(ctx, &framework.options().commands).await?;
let commands = &framework.options().commands;
poise::builtins::register_globally(&ctx.http, commands).await?;
Ok(Data {
votes: Mutex::new(HashMap::new()),
})
Expand Down
4 changes: 2 additions & 2 deletions src/builtins/register.rs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ pub fn create_application_commands<U, E>(
/// Thin wrapper around [`create_application_commands`] that funnels the returned builder into
/// [`serenity::Command::set_global_commands`].
pub async fn register_globally<U, E>(
http: impl AsRef<serenity::Http>,
http: &serenity::Http,
commands: &[crate::Command<U, E>],
) -> Result<(), serenity::Error> {
let builder = create_application_commands(commands);
Expand All @@ -63,7 +63,7 @@ pub async fn register_globally<U, E>(
/// Thin wrapper around [`create_application_commands`] that funnels the returned builder into
/// [`serenity::GuildId::set_commands`].
pub async fn register_in_guild<U, E>(
http: impl AsRef<serenity::Http>,
http: &serenity::Http,
commands: &[crate::Command<U, E>],
guild_id: serenity::GuildId,
) -> Result<(), serenity::Error> {
Expand Down
6 changes: 3 additions & 3 deletions src/modal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,14 +120,14 @@ pub async fn execute_modal<U: Send + Sync, E, M: Modal>(
/// If you need more specialized behavior, you can copy paste the implementation of this function
/// and adjust to your needs. The code of this function is just a starting point.
pub async fn execute_modal_on_component_interaction<M: Modal>(
ctx: impl AsRef<serenity::Context>,
ctx: &serenity::Context,
interaction: serenity::ComponentInteraction,
defaults: Option<M>,
timeout: Option<std::time::Duration>,
) -> Result<Option<M>, serenity::Error> {
execute_modal_generic(
ctx.as_ref(),
|resp| interaction.create_response(ctx.as_ref(), resp),
ctx,
|resp| interaction.create_response(ctx, resp),
interaction.id.to_string(),
defaults,
timeout,
Expand Down

0 comments on commit 258ae5f

Please sign in to comment.