mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
22 lines
819 B
TypeScript
22 lines
819 B
TypeScript
import { Channel } from "./Channel.ts";
|
|
//import { User } from "./User.ts";
|
|
import { Session, DiscordChannel, Snowflake, Routes } from "../mod.ts";
|
|
|
|
export class DMChannel extends Channel {
|
|
constructor(session: Session, data: DiscordChannel) {
|
|
super(session, data);
|
|
data.last_message_id ? this.lastMessageId = data.last_message_id : undefined;
|
|
// Waiting for implementation of botId in session
|
|
//this.user = new User(this.session, data.recipents!.find((r) => r.id !== this.session.botId));
|
|
}
|
|
lastMessageId?: Snowflake;
|
|
|
|
async close() {
|
|
const channel = await this.session.rest.runMethod<DiscordChannel>(
|
|
this.session.rest,
|
|
"DELETE",
|
|
Routes.CHANNEL(this.id)
|
|
)
|
|
return new DMChannel(this.session, channel);
|
|
}
|
|
} |