Massive dependencies bump

This commit is contained in:
Natsu Kagami 2022-06-11 15:48:43 -04:00
parent dd1867e222
commit 8632f0e99c
Signed by: nki
GPG key ID: 7306B3D3C3AD6E51
24 changed files with 744 additions and 841 deletions

View file

@ -2,20 +2,20 @@
name = "youmubot-core"
version = "0.1.0"
authors = ["Natsu Kagami <natsukagami@gmail.com>"]
edition = "2018"
edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
serenity = { version = "0.10", features = ["collector"] }
rand = "0.7"
serde = { version = "1", features = ["derive"] }
chrono = "0.4"
static_assertions = "1.1"
futures-util = "0.3"
tokio = { version = "1", features = ["time"] }
flume = "0.10"
dashmap = "4"
serenity = { version = "0.11.2", features = ["collector"] }
rand = "0.8.5"
serde = { version = "1.0.137", features = ["derive"] }
chrono = "0.4.19"
static_assertions = "1.1.0"
futures-util = "0.3.21"
tokio = { version = "1.19.2", features = ["time"] }
flume = "0.10.13"
dashmap = "5.3.4"
youmubot-db = { path = "../youmubot-db" }
youmubot-prelude = { path = "../youmubot-prelude" }

View file

@ -36,7 +36,7 @@ async fn clean(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let channel = msg.channel_id.to_channel(&ctx).await?;
match &channel {
Channel::Private(_) => {
let self_id = ctx.http.get_current_application_info().await?.id;
let self_id = ctx.http.get_current_user().await?.id;
messages
.into_iter()
.filter(|v| v.author.id == self_id)

View file

@ -85,7 +85,7 @@ pub async fn soft_ban(ctx: &Context, msg: &Message, mut args: Args) -> CommandRe
pub async fn soft_ban_init(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
let role_id = args.single::<RoleId>()?;
let data = ctx.data.read().await;
let guild = msg.guild(&ctx).await.unwrap();
let guild = msg.guild(&ctx).unwrap();
// Check whether the role_id is the one we wanted
if !guild.roles.contains_key(&role_id) {
return Err(Error::msg(format!("{} is not a role in this server.", role_id)).into());

View file

@ -62,7 +62,7 @@ pub async fn choose(ctx: &Context, m: &Message, mut args: Args) -> CommandResult
let online_only = !flags.contains("everyone");
let users: Result<Vec<_>, Error> = {
let guild = m.guild(&ctx).await.unwrap();
let guild = m.guild(&ctx).unwrap();
let presences = &guild.presences;
let channel = m.channel_id.to_channel(&ctx).await?;
if let Channel::Guild(channel) = channel {

View file

@ -85,7 +85,7 @@ pub async fn vote(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult
let channel = msg.channel_id;
let author = msg.author.clone();
let asked = msg.timestamp;
let until = asked + (chrono::Duration::from_std(*duration).unwrap());
let until = *asked + (chrono::Duration::from_std(*duration).unwrap());
let panel = channel.send_message(&ctx, |c| {
c.content("@here").embed(|e| {
e.author(|au| {
@ -119,7 +119,7 @@ pub async fn vote(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult
.await_reactions(&ctx)
.removed(true)
.timeout(*duration)
.await
.build()
.fold(user_reactions, |mut set, reaction| async move {
let (reaction, is_add) = match &*reaction {
ReactionAction::Added(r) => (r, true),

View file

@ -172,7 +172,7 @@ async fn name(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
};
// Rule out a couple of cases
if user_id == ctx.http.get_current_application_info().await?.id {
if user_id == ctx.http.get_current_user().await?.id {
// This is my own user_id
msg.reply(&ctx, "😠 My name is **Youmu Konpaku**!").await?;
return Ok(());

View file

@ -51,6 +51,6 @@ pub async fn help(
groups: &[&'static CommandGroup],
owners: HashSet<UserId>,
) -> CommandResult {
help_commands::with_embeds(context, msg, args, help_options, groups, owners).await;
help_commands::with_embeds(context, msg, args, help_options, groups, owners).await?;
Ok(())
}