update poise
This commit is contained in:
@ -230,17 +230,17 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
let thread_id = None;
|
||||
let db_channel_id = match scope {
|
||||
ReminderScope::User(user_id) => {
|
||||
if let Ok(user) = UserId(user_id).to_user(&self.ctx.discord()).await {
|
||||
if let Ok(user) = UserId(user_id).to_user(&self.ctx).await {
|
||||
let user_data = UserData::from_user(
|
||||
&user,
|
||||
&self.ctx.discord(),
|
||||
&self.ctx.serenity_context(),
|
||||
&self.ctx.data().database,
|
||||
)
|
||||
.await
|
||||
.unwrap();
|
||||
|
||||
if let Some(guild_id) = self.guild_id {
|
||||
if guild_id.member(&self.ctx.discord(), user).await.is_err() {
|
||||
if guild_id.member(&self.ctx, user).await.is_err() {
|
||||
Err(ReminderError::InvalidTag)
|
||||
} else if self.set_by.map_or(true, |i| i != user_data.id)
|
||||
&& !user_data.allowed_dm
|
||||
@ -257,8 +257,7 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
}
|
||||
}
|
||||
ReminderScope::Channel(channel_id) => {
|
||||
let channel =
|
||||
ChannelId(channel_id).to_channel(&self.ctx.discord()).await.unwrap();
|
||||
let channel = ChannelId(channel_id).to_channel(&self.ctx).await.unwrap();
|
||||
|
||||
if let Some(mut guild_channel) = channel.clone().guild() {
|
||||
if Some(guild_channel.guild_id) != self.guild_id {
|
||||
@ -271,7 +270,7 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
let parent = guild_channel
|
||||
.parent_id
|
||||
.unwrap()
|
||||
.to_channel(&self.ctx.discord())
|
||||
.to_channel(&self.ctx)
|
||||
.await
|
||||
.unwrap();
|
||||
guild_channel = parent.clone().guild().unwrap();
|
||||
@ -287,12 +286,7 @@ impl<'a> MultiReminderBuilder<'a> {
|
||||
if channel_data.webhook_id.is_none()
|
||||
|| channel_data.webhook_token.is_none()
|
||||
{
|
||||
match create_webhook(
|
||||
&self.ctx.discord(),
|
||||
guild_channel,
|
||||
"Reminder",
|
||||
)
|
||||
.await
|
||||
match create_webhook(&self.ctx, guild_channel, "Reminder").await
|
||||
{
|
||||
Ok(webhook) => {
|
||||
channel_data.webhook_id =
|
||||
|
Reference in New Issue
Block a user