Update dependencies
This commit is contained in:
parent
66f45f11f2
commit
b861f6f093
798
Cargo.lock
generated
798
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -8,7 +8,7 @@ edition = "2018"
|
||||
|
||||
[dependencies]
|
||||
songbird = { version = "0.3", features = ["builtin-queue"] }
|
||||
poise = "0.3"
|
||||
poise = "0.5.5"
|
||||
sqlx = { version = "0.5", default-features = false, features = ["runtime-tokio-rustls", "macros", "mysql", "bigdecimal", "migrate"] }
|
||||
tokio = { version = "1", features = ["fs", "process", "io-util"] }
|
||||
lazy_static = "1.4"
|
||||
@ -22,7 +22,7 @@ serde = "1.0"
|
||||
dotenv = "0.15.0"
|
||||
|
||||
[patch."https://github.com/serenity-rs/serenity"]
|
||||
serenity = { version = "0.11.5" }
|
||||
serenity = { version = "0.11.6" }
|
||||
|
||||
[package.metadata.deb]
|
||||
depends = "$auto, ffmpeg"
|
||||
|
@ -57,7 +57,7 @@ __Advanced Commands__
|
||||
/// Get additional information about the bot
|
||||
#[poise::command(slash_command)]
|
||||
pub async fn info(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let current_user = ctx.discord().cache.current_user();
|
||||
let current_user = ctx.serenity_context().cache.current_user();
|
||||
|
||||
ctx.send(|m| m.ephemeral(true)
|
||||
.embed(|e| e
|
||||
|
@ -52,9 +52,8 @@ pub async fn upload_new_sound(
|
||||
|
||||
// need to check if user is patreon or nah
|
||||
if count >= *MAX_SOUNDS {
|
||||
let patreon_guild_member = GuildId(*PATREON_GUILD)
|
||||
.member(ctx.discord(), ctx.author().id)
|
||||
.await;
|
||||
let patreon_guild_member =
|
||||
GuildId(*PATREON_GUILD).member(ctx, ctx.author().id).await;
|
||||
|
||||
if let Ok(member) = patreon_guild_member {
|
||||
permit_upload = member.roles.contains(&RoleId(*PATREON_ROLE));
|
||||
@ -123,8 +122,8 @@ pub async fn delete_sound(
|
||||
.await?;
|
||||
} else {
|
||||
let has_perms = {
|
||||
if let Ok(member) = ctx.guild_id().unwrap().member(&ctx.discord(), uid).await {
|
||||
if let Ok(perms) = member.permissions(&ctx.discord()) {
|
||||
if let Ok(member) = ctx.guild_id().unwrap().member(&ctx, uid).await {
|
||||
if let Ok(perms) = member.permissions(&ctx) {
|
||||
perms.manage_guild()
|
||||
} else {
|
||||
false
|
||||
|
@ -31,7 +31,7 @@ pub async fn play(
|
||||
} else {
|
||||
ctx.say(
|
||||
play_from_query(
|
||||
&ctx.discord(),
|
||||
&ctx.serenity_context(),
|
||||
&ctx.data(),
|
||||
guild,
|
||||
ctx.author().id,
|
||||
@ -143,7 +143,8 @@ pub async fn queue_play(
|
||||
|
||||
match channel_to_join {
|
||||
Some(user_channel) => {
|
||||
let (call_handler, _) = join_channel(ctx.discord(), guild.clone(), user_channel).await;
|
||||
let (call_handler, _) =
|
||||
join_channel(ctx.serenity_context(), guild.clone(), user_channel).await;
|
||||
|
||||
let guild_data = ctx
|
||||
.data()
|
||||
@ -232,7 +233,7 @@ pub async fn loop_play(
|
||||
|
||||
ctx.say(
|
||||
play_from_query(
|
||||
&ctx.discord(),
|
||||
&ctx.serenity_context(),
|
||||
&ctx.data(),
|
||||
guild,
|
||||
ctx.author().id,
|
||||
|
@ -61,9 +61,7 @@ pub async fn set_guild_greet_sound(
|
||||
) -> Result<(), Error> {
|
||||
if user.id != ctx.author().id {
|
||||
let guild = ctx.guild().unwrap();
|
||||
let permissions = guild
|
||||
.member_permissions(&ctx.discord(), ctx.author().id)
|
||||
.await;
|
||||
let permissions = guild.member_permissions(&ctx, ctx.author().id).await;
|
||||
|
||||
if permissions.map_or(true, |p| !p.manage_guild()) {
|
||||
ctx.send(|b| {
|
||||
@ -110,9 +108,7 @@ pub async fn unset_guild_greet_sound(
|
||||
) -> Result<(), Error> {
|
||||
if user.id != ctx.author().id {
|
||||
let guild = ctx.guild().unwrap();
|
||||
let permissions = guild
|
||||
.member_permissions(&ctx.discord(), ctx.author().id)
|
||||
.await;
|
||||
let permissions = guild.member_permissions(&ctx, ctx.author().id).await;
|
||||
|
||||
if permissions.map_or(true, |p| !p.manage_guild()) {
|
||||
ctx.send(|b| {
|
||||
|
@ -10,7 +10,7 @@ use crate::{Context, Error};
|
||||
guild_only = true
|
||||
)]
|
||||
pub async fn stop_playing(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
||||
let songbird = songbird::get(ctx.serenity_context()).await.unwrap();
|
||||
let call_opt = songbird.get(ctx.guild_id().unwrap());
|
||||
|
||||
if let Some(call) = call_opt {
|
||||
@ -27,7 +27,7 @@ pub async fn stop_playing(ctx: Context<'_>) -> Result<(), Error> {
|
||||
/// Disconnect the bot
|
||||
#[poise::command(slash_command, default_member_permissions = "SPEAK", guild_only = true)]
|
||||
pub async fn disconnect(ctx: Context<'_>) -> Result<(), Error> {
|
||||
let songbird = songbird::get(ctx.discord()).await.unwrap();
|
||||
let songbird = songbird::get(ctx.serenity_context()).await.unwrap();
|
||||
let _ = songbird.leave(ctx.guild_id().unwrap()).await;
|
||||
|
||||
ctx.say("👍").await?;
|
||||
|
@ -124,7 +124,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
},
|
||||
],
|
||||
allowed_mentions: None,
|
||||
listener: |ctx, event, _framework, data| Box::pin(listener(ctx, event, data)),
|
||||
event_handler: |ctx, event, _framework, data| Box::pin(listener(ctx, event, data)),
|
||||
..Default::default()
|
||||
};
|
||||
|
||||
@ -136,7 +136,7 @@ async fn main() -> Result<(), Box<dyn std::error::Error + Send + Sync>> {
|
||||
|
||||
poise::Framework::builder()
|
||||
.token(discord_token)
|
||||
.user_data_setup(move |ctx, _bot, framework| {
|
||||
.setup(move |ctx, _bot, framework| {
|
||||
Box::pin(async move {
|
||||
register_application_commands(ctx, framework, None)
|
||||
.await
|
||||
|
Loading…
Reference in New Issue
Block a user