mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: dumb bug on api-types
This commit is contained in:
parent
a4c776ffa4
commit
afe3a38e4b
@ -753,7 +753,7 @@ export interface DiscordChannel {
|
||||
/** When a thread is created this will be true on that channel payload for the thread. */
|
||||
newly_created?: boolean;
|
||||
/** The recipients of the DM*/
|
||||
recipents?: DiscordUser[];
|
||||
recipients?: DiscordUser[];
|
||||
}
|
||||
|
||||
/** https://discord.com/developers/docs/topics/gateway#presence-update */
|
||||
|
@ -719,14 +719,14 @@ export class DMChannel extends BaseChannel implements Model {
|
||||
constructor(session: Session, data: DiscordChannel) {
|
||||
super(session, data);
|
||||
|
||||
if (data.owner_id && data.recipents) {
|
||||
this.user = new User(session, data.recipents.find(user => user.id === data.owner_id)!);
|
||||
if (data.owner_id && data.recipients) {
|
||||
this.user = new User(session, data.recipients.find(user => user.id === data.owner_id)!);
|
||||
} else {
|
||||
this.user = new User(session, data.recipents!.find(user => user.id === this.session.botId)!);
|
||||
this.user = new User(session, data.recipients!.find(user => user.id === this.session.botId)!);
|
||||
}
|
||||
|
||||
if (data.recipents && data.recipents.length > 1) {
|
||||
this.group = data.recipents.map(r => new User(this.session, r));
|
||||
if (data.recipients && data.recipients.length > 1) {
|
||||
this.group = data.recipients.map(r => new User(this.session, r));
|
||||
}
|
||||
|
||||
this.type = data.type as ChannelTypes.GroupDm | ChannelTypes.GroupDm;
|
||||
|
Loading…
x
Reference in New Issue
Block a user