mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-03 05:26:07 +00:00
feat: TextChannel.sendMessage/editMessage
This commit is contained in:
parent
37f4071da6
commit
3f714eb295
@ -44,8 +44,7 @@ export interface Embed {
|
|||||||
provider?: {
|
provider?: {
|
||||||
url?: string;
|
url?: string;
|
||||||
name?: string;
|
name?: string;
|
||||||
}
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export function embed(data: Embed): DiscordEmbed {
|
export function embed(data: Embed): DiscordEmbed {
|
||||||
|
@ -1,7 +1,13 @@
|
|||||||
import type { Model } from "./Base.ts";
|
import type { Model } from "./Base.ts";
|
||||||
import type { Snowflake } from "../util/Snowflake.ts";
|
import type { Snowflake } from "../util/Snowflake.ts";
|
||||||
import type { Session } from "../session/Session.ts";
|
import type { Session } from "../session/Session.ts";
|
||||||
import type { AllowedMentionsTypes, DiscordEmbed, DiscordMessage, DiscordUser, FileContent } from "../vendor/external.ts";
|
import type {
|
||||||
|
AllowedMentionsTypes,
|
||||||
|
DiscordEmbed,
|
||||||
|
DiscordMessage,
|
||||||
|
DiscordUser,
|
||||||
|
FileContent,
|
||||||
|
} from "../vendor/external.ts";
|
||||||
import type { GetReactions } from "../util/Routes.ts";
|
import type { GetReactions } from "../util/Routes.ts";
|
||||||
import { MessageFlags } from "../util/shared/flags.ts";
|
import { MessageFlags } from "../util/shared/flags.ts";
|
||||||
import User from "./User.ts";
|
import User from "./User.ts";
|
||||||
|
@ -2,7 +2,7 @@ import type { Session } from "../session/Session.ts";
|
|||||||
import type { Snowflake } from "../util/Snowflake.ts";
|
import type { Snowflake } from "../util/Snowflake.ts";
|
||||||
import type { GetMessagesOptions, GetReactions } from "../util/Routes.ts";
|
import type { GetMessagesOptions, GetReactions } from "../util/Routes.ts";
|
||||||
import type { DiscordChannel, DiscordInvite, DiscordMessage, TargetTypes } from "../vendor/external.ts";
|
import type { DiscordChannel, DiscordInvite, DiscordMessage, TargetTypes } from "../vendor/external.ts";
|
||||||
import type { ReactionResolvable } from "./Message.ts";
|
import type { CreateMessage, EditMessage, ReactionResolvable } from "./Message.ts";
|
||||||
import GuildChannel from "./GuildChannel.ts";
|
import GuildChannel from "./GuildChannel.ts";
|
||||||
import ThreadChannel from "./ThreadChannel.ts";
|
import ThreadChannel from "./ThreadChannel.ts";
|
||||||
import Message from "./Message.ts";
|
import Message from "./Message.ts";
|
||||||
@ -151,6 +151,14 @@ export class TextChannel extends GuildChannel {
|
|||||||
|
|
||||||
return users;
|
return users;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sendMessage(options: CreateMessage) {
|
||||||
|
return Message.prototype.reply.call({ channelId: this.id, session: this.session }, options);
|
||||||
|
}
|
||||||
|
|
||||||
|
editMessage(messageId: Snowflake, options: EditMessage) {
|
||||||
|
return Message.prototype.edit.call({ channelId: this.id, id: messageId, session: this.session }, options);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default TextChannel;
|
export default TextChannel;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user