update poise
This commit is contained in:
@ -31,11 +31,12 @@ pub trait CtxData {
|
||||
#[async_trait]
|
||||
impl CtxData for Context<'_> {
|
||||
async fn user_data<U: Into<UserId> + Send>(&self, user_id: U) -> Result<UserData, Error> {
|
||||
UserData::from_user(user_id, &self.discord(), &self.data().database).await
|
||||
UserData::from_user(user_id, &self.serenity_context(), &self.data().database).await
|
||||
}
|
||||
|
||||
async fn author_data(&self) -> Result<UserData, Error> {
|
||||
UserData::from_user(&self.author().id, &self.discord(), &self.data().database).await
|
||||
UserData::from_user(&self.author().id, &self.serenity_context(), &self.data().database)
|
||||
.await
|
||||
}
|
||||
|
||||
async fn guild_data(&self) -> Option<Result<GuildData, Error>> {
|
||||
@ -52,18 +53,18 @@ impl CtxData for Context<'_> {
|
||||
|
||||
async fn channel_data(&self) -> Result<ChannelData, Box<dyn std::error::Error + Sync + Send>> {
|
||||
// If we're in a thread, get the parent channel.
|
||||
let recv_channel = self.channel_id().to_channel(&self.discord()).await?;
|
||||
let recv_channel = self.channel_id().to_channel(&self).await?;
|
||||
|
||||
let channel = match recv_channel.guild() {
|
||||
Some(guild_channel) => {
|
||||
if guild_channel.kind == ChannelType::PublicThread {
|
||||
guild_channel.parent_id.unwrap().to_channel_cached(&self.discord()).unwrap()
|
||||
guild_channel.parent_id.unwrap().to_channel_cached(&self).unwrap()
|
||||
} else {
|
||||
self.channel_id().to_channel_cached(&self.discord()).unwrap()
|
||||
self.channel_id().to_channel_cached(&self).unwrap()
|
||||
}
|
||||
}
|
||||
|
||||
None => self.channel_id().to_channel_cached(&self.discord()).unwrap(),
|
||||
None => self.channel_id().to_channel_cached(&self).unwrap(),
|
||||
};
|
||||
|
||||
ChannelData::from_channel(&channel, &self.data().database).await
|
||||
|
Reference in New Issue
Block a user