Skip to content

Commit

Permalink
🐞 Bugs fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Maseshi committed May 3, 2024
1 parent 90f03f7 commit 01d3288
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions source/commands/messages/message.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,12 +132,12 @@ module.exports = {
if (!inputChannel) {
await interaction.channel.send({
content: inputContent,
files: [inputAttachment],
files: inputAttachment ? [inputAttachment] : [],
})
} else {
await inputChannel.send({
content: inputContent,
files: [inputAttachment],
files: inputAttachment ? [inputAttachment] : [],
})
}

Expand All @@ -150,7 +150,7 @@ module.exports = {
break
case 'reply':
try {
const message = await interaction.channel.message.fetch(inputID)
const message = await interaction.channel.messages.fetch(inputID)

if (!message)
return await interaction.reply({
Expand All @@ -162,7 +162,7 @@ module.exports = {

await message.reply({
content: inputContent,
files: [inputAttachment],
files: inputAttachment ? [inputAttachment] : [],
})
} catch (error) {
catchError(
Expand All @@ -180,7 +180,7 @@ module.exports = {
break
case 'edit':
try {
const message = await interaction.channel.message.fetch(inputID)
const message = await interaction.channel.messages.fetch(inputID)

if (!message)
return await interaction.reply({
Expand All @@ -199,7 +199,7 @@ module.exports = {

await message.edit({
content: inputContent,
files: [inputAttachment],
files: inputAttachment ? [inputAttachment] : [],
})
} catch (error) {
catchError(
Expand Down
2 changes: 1 addition & 1 deletion source/utils/consoleUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ const catchError = async (client, message, name, error, silent = false) => {
if (message.channel) await message.channel.reply(contents)
else await message.reply(contents)
}
} finally {
} catch {
if (!silent) {
if (message.channel) await message.channel.send(contents)
else await message.send(contents)
Expand Down

0 comments on commit 01d3288

Please sign in to comment.