part 2
This commit is contained in:
parent
2286c9af3f
commit
6641778578
1 changed files with 7 additions and 1 deletions
|
@ -137,7 +137,7 @@ export class ChannelsManager extends BaseManager<ChannelPayload, Channel> {
|
||||||
async editMessage(
|
async editMessage(
|
||||||
channel: string | TextChannel,
|
channel: string | TextChannel,
|
||||||
message: Message | string,
|
message: Message | string,
|
||||||
text?: string,
|
text?: string | MessageOptions,
|
||||||
option?: MessageOptions
|
option?: MessageOptions
|
||||||
): Promise<Message> {
|
): Promise<Message> {
|
||||||
const channelID = typeof channel === 'string' ? channel : channel.id
|
const channelID = typeof channel === 'string' ? channel : channel.id
|
||||||
|
@ -150,6 +150,12 @@ export class ChannelsManager extends BaseManager<ChannelPayload, Channel> {
|
||||||
throw new Error('Client user has not initialized.')
|
throw new Error('Client user has not initialized.')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (typeof text === 'object') {
|
||||||
|
if (typeof option === 'object') Object.assign(option, text)
|
||||||
|
else option = text
|
||||||
|
text = undefined
|
||||||
|
}
|
||||||
|
|
||||||
const newMsg = await this.client.rest.api.channels[channelID].messages[
|
const newMsg = await this.client.rest.api.channels[channelID].messages[
|
||||||
typeof message === 'string' ? message : message.id
|
typeof message === 'string' ? message : message.id
|
||||||
].patch({
|
].patch({
|
||||||
|
|
Loading…
Reference in a new issue