mirror of
https://github.com/tiramisulabs/seyfert.git
synced 2025-07-01 20:46:08 +00:00
fix: shorters
This commit is contained in:
parent
f58be61f98
commit
74159ac1da
@ -2,7 +2,7 @@ import type { BaseImageURLOptions } from '../api';
|
||||
import type { BaseClient } from '../client/base';
|
||||
import type {
|
||||
APIEmoji,
|
||||
GuildShorter,
|
||||
EmojiShorter,
|
||||
MethodContext,
|
||||
ObjectToLower,
|
||||
RESTPatchAPIChannelJSONBody,
|
||||
@ -27,15 +27,15 @@ export class GuildEmoji extends DiscordBase {
|
||||
}
|
||||
|
||||
edit(body: RESTPatchAPIChannelJSONBody, reason?: string) {
|
||||
return this.client.guilds.emojis.edit(this.guildId, this.id, body, reason);
|
||||
return this.client.emojis.edit(this.guildId, this.id, body, reason);
|
||||
}
|
||||
|
||||
delete(reason?: string) {
|
||||
return this.client.guilds.emojis.delete(this.guildId, this.id, reason);
|
||||
return this.client.emojis.delete(this.guildId, this.id, reason);
|
||||
}
|
||||
|
||||
fetch(force = false) {
|
||||
return this.client.guilds.emojis.fetch(this.guildId, this.id, force);
|
||||
return this.client.emojis.fetch(this.guildId, this.id, force);
|
||||
}
|
||||
|
||||
url(options?: BaseImageURLOptions) {
|
||||
@ -57,10 +57,10 @@ export class GuildEmoji extends DiscordBase {
|
||||
static methods({ client, guildId }: MethodContext<{ guildId: string }>) {
|
||||
return {
|
||||
edit: (emojiId: string, body: RESTPatchAPIGuildEmojiJSONBody, reason?: string) =>
|
||||
client.guilds.emojis.edit(guildId, emojiId, body, reason),
|
||||
create: (body: Parameters<GuildShorter['emojis']['create']>[1]) => client.guilds.emojis.create(guildId, body),
|
||||
fetch: (emojiId: string, force = false) => client.guilds.emojis.fetch(guildId, emojiId, force),
|
||||
list: (force = false) => client.guilds.emojis.list(guildId, force),
|
||||
client.emojis.edit(guildId, emojiId, body, reason),
|
||||
create: (body: Parameters<EmojiShorter['create']>[1]) => client.emojis.create(guildId, body),
|
||||
fetch: (emojiId: string, force = false) => client.emojis.fetch(guildId, emojiId, force),
|
||||
list: (force = false) => client.emojis.list(guildId, force),
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -96,8 +96,8 @@ export class BaseGuildMember extends DiscordBase {
|
||||
get roles() {
|
||||
return {
|
||||
values: Object.freeze(this._roles),
|
||||
add: (id: string) => this.client.members.roles.add(this.guildId, this.id, id),
|
||||
remove: (id: string) => this.client.members.roles.remove(this.guildId, this.id, id),
|
||||
add: (id: string) => this.client.members.addRole(this.guildId, this.id, id),
|
||||
remove: (id: string) => this.client.members.removeRole(this.guildId, this.id, id),
|
||||
permissions: async () =>
|
||||
new PermissionsBitField(
|
||||
((await this.cache.roles?.bulk(this.roles.values as string[])) ?? [])
|
||||
|
@ -326,7 +326,7 @@ export class Interaction<
|
||||
Type extends APIInteraction = APIInteraction,
|
||||
> extends BaseInteraction<FromGuild, Type> {
|
||||
fetchMessage(messageId: string) {
|
||||
return this.client.webhooks.messages.fetch(this.applicationId, this.token, messageId);
|
||||
return this.client.webhooks.fetchMessage(this.applicationId, this.token, messageId);
|
||||
}
|
||||
|
||||
fetchResponse() {
|
||||
|
@ -64,7 +64,7 @@ export class BaseMessage extends DiscordBase {
|
||||
}
|
||||
|
||||
react(emoji: EmojiResolvable) {
|
||||
return this.client.messages.reactions.add(this.id, this.channelId, emoji);
|
||||
return this.client.reactions.add(this.id, this.channelId, emoji);
|
||||
}
|
||||
|
||||
private patch(data: MessageData) {
|
||||
@ -170,14 +170,14 @@ export class WebhookMessage extends BaseMessage {
|
||||
}
|
||||
|
||||
edit(body: EditMessageWebhook) {
|
||||
return this.client.webhooks.messages.edit(this.webhookId, this.webhookToken, { ...body, messageId: this.id });
|
||||
return this.client.webhooks.editMessage(this.webhookId, this.webhookToken, { ...body, messageId: this.id });
|
||||
}
|
||||
|
||||
write(body: WriteMessageWebhook) {
|
||||
return this.client.webhooks.messages.write(this.webhookId, this.webhookToken, body);
|
||||
return this.client.webhooks.writeMessage(this.webhookId, this.webhookToken, body);
|
||||
}
|
||||
|
||||
delete(reason?: string) {
|
||||
return this.client.webhooks.messages.delete(this.webhookId, this.webhookToken, this.id, reason);
|
||||
return this.client.webhooks.deleteMessage(this.webhookId, this.webhookToken, this.id, reason);
|
||||
}
|
||||
}
|
||||
|
@ -71,11 +71,10 @@ export class Webhook extends DiscordBase {
|
||||
static messages({ client, webhookId, webhookToken }: MethodContext<{ webhookId: string; webhookToken: string }>) {
|
||||
return {
|
||||
write: (payload: MessageWebhookMethodWriteParams) =>
|
||||
client.webhooks.messages.write(webhookId, webhookToken, payload),
|
||||
edit: (payload: MessageWebhookMethodEditParams) =>
|
||||
client.webhooks.messages.edit(webhookId, webhookToken, payload),
|
||||
client.webhooks.writeMessage(webhookId, webhookToken, payload),
|
||||
edit: (payload: MessageWebhookMethodEditParams) => client.webhooks.editMessage(webhookId, webhookToken, payload),
|
||||
delete: (messageId: string, reason?: string) =>
|
||||
client.webhooks.messages.delete(webhookId, webhookToken, messageId, reason),
|
||||
client.webhooks.deleteMessage(webhookId, webhookToken, messageId, reason),
|
||||
};
|
||||
}
|
||||
|
||||
|
@ -176,15 +176,15 @@ export class BaseGuildChannel extends BaseChannel<ChannelType> {
|
||||
};
|
||||
|
||||
memberPermissions(member: GuildMember, checkAdmin = true) {
|
||||
return this.client.channels.overwrites.memberPermissions(this.id, member, checkAdmin);
|
||||
return this.client.channels.memberPermissions(this.id, member, checkAdmin);
|
||||
}
|
||||
|
||||
rolePermissions(role: GuildRole, checkAdmin = true) {
|
||||
return this.client.channels.overwrites.rolePermissions(this.id, role, checkAdmin);
|
||||
return this.client.channels.rolePermissions(this.id, role, checkAdmin);
|
||||
}
|
||||
|
||||
overwritesFor(member: GuildMember) {
|
||||
return this.client.channels.overwrites.overwritesFor(this.id, member);
|
||||
return this.client.channels.overwritesFor(this.id, member);
|
||||
}
|
||||
|
||||
guild(force = false) {
|
||||
@ -233,21 +233,20 @@ export class MessagesMethods extends DiscordBase {
|
||||
|
||||
static reactions(ctx: MethodContext<{ channelId: string }>) {
|
||||
return {
|
||||
add: (messageId: string, emoji: EmojiResolvable) =>
|
||||
ctx.client.messages.reactions.add(messageId, ctx.channelId, emoji),
|
||||
add: (messageId: string, emoji: EmojiResolvable) => ctx.client.reactions.add(messageId, ctx.channelId, emoji),
|
||||
delete: (messageId: string, emoji: EmojiResolvable, userId = '@me') =>
|
||||
ctx.client.messages.reactions.delete(messageId, ctx.channelId, emoji, userId),
|
||||
ctx.client.reactions.delete(messageId, ctx.channelId, emoji, userId),
|
||||
fetch: (messageId: string, emoji: EmojiResolvable, query?: RESTGetAPIChannelMessageReactionUsersQuery) =>
|
||||
ctx.client.messages.reactions.fetch(messageId, ctx.channelId, emoji, query),
|
||||
ctx.client.reactions.fetch(messageId, ctx.channelId, emoji, query),
|
||||
purge: (messageId: string, emoji?: EmojiResolvable) =>
|
||||
ctx.client.messages.reactions.purge(messageId, ctx.channelId, emoji),
|
||||
ctx.client.reactions.purge(messageId, ctx.channelId, emoji),
|
||||
};
|
||||
}
|
||||
static pins(ctx: MethodContext<{ channelId: string }>) {
|
||||
return {
|
||||
fetch: () => ctx.client.channels.pins.fetch(ctx.channelId),
|
||||
set: (messageId: string, reason?: string) => ctx.client.channels.pins.set(messageId, ctx.channelId, reason),
|
||||
delete: (messageId: string, reason?: string) => ctx.client.channels.pins.delete(messageId, ctx.channelId, reason),
|
||||
fetch: () => ctx.client.channels.pins(ctx.channelId),
|
||||
set: (messageId: string, reason?: string) => ctx.client.channels.setPin(messageId, ctx.channelId, reason),
|
||||
delete: (messageId: string, reason?: string) => ctx.client.channels.deletePin(messageId, ctx.channelId, reason),
|
||||
};
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user