This commit is contained in:
DjDeveloperr 2021-03-19 16:51:25 +05:30
parent 2286c9af3f
commit 6641778578
1 changed files with 7 additions and 1 deletions

View File

@ -137,7 +137,7 @@ export class ChannelsManager extends BaseManager<ChannelPayload, Channel> {
async editMessage(
channel: string | TextChannel,
message: Message | string,
text?: string,
text?: string | MessageOptions,
option?: MessageOptions
): Promise<Message> {
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.')
}
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[
typeof message === 'string' ? message : message.id
].patch({