mirror of
https://github.com/natsukagami/youmubot.git
synced 2025-05-24 09:10:49 +00:00
Massive dependencies bump
This commit is contained in:
parent
dd1867e222
commit
8632f0e99c
24 changed files with 744 additions and 841 deletions
|
@ -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)
|
||||
|
|
|
@ -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());
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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),
|
||||
|
|
|
@ -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(());
|
||||
|
|
|
@ -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(())
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue