mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-02 21:16:09 +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. */
|
/** When a thread is created this will be true on that channel payload for the thread. */
|
||||||
newly_created?: boolean;
|
newly_created?: boolean;
|
||||||
/** The recipients of the DM*/
|
/** The recipients of the DM*/
|
||||||
recipents?: DiscordUser[];
|
recipients?: DiscordUser[];
|
||||||
}
|
}
|
||||||
|
|
||||||
/** https://discord.com/developers/docs/topics/gateway#presence-update */
|
/** 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) {
|
constructor(session: Session, data: DiscordChannel) {
|
||||||
super(session, data);
|
super(session, data);
|
||||||
|
|
||||||
if (data.owner_id && data.recipents) {
|
if (data.owner_id && data.recipients) {
|
||||||
this.user = new User(session, data.recipents.find(user => user.id === data.owner_id)!);
|
this.user = new User(session, data.recipients.find(user => user.id === data.owner_id)!);
|
||||||
} else {
|
} 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) {
|
if (data.recipients && data.recipients.length > 1) {
|
||||||
this.group = data.recipents.map(r => new User(this.session, r));
|
this.group = data.recipients.map(r => new User(this.session, r));
|
||||||
}
|
}
|
||||||
|
|
||||||
this.type = data.type as ChannelTypes.GroupDm | ChannelTypes.GroupDm;
|
this.type = data.type as ChannelTypes.GroupDm | ChannelTypes.GroupDm;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user