aboutsummaryrefslogtreecommitdiff
path: root/commands
diff options
context:
space:
mode:
authorAndrew Lee <andrew@alee14.me>2025-02-25 23:13:39 -0500
committerAndrew Lee <andrew@alee14.me>2025-02-25 23:13:39 -0500
commit5777f96394444dab18a81d6f085ac81df3e62008 (patch)
tree47dc895e50fa95b52a894bf0806e1a6c1edc8818 /commands
parentde5ee661cad7b1fef0f319cbaccd888cb75a1dd4 (diff)
downloadAleeBot-5777f96394444dab18a81d6f085ac81df3e62008.tar.gz
AleeBot-5777f96394444dab18a81d6f085ac81df3e62008.tar.bz2
AleeBot-5777f96394444dab18a81d6f085ac81df3e62008.zip
2.13 Release (finally); Added more API entries; Proper loggingv2.13.0
Diffstat (limited to 'commands')
-rw-r--r--commands/addquote.js4
-rw-r--r--commands/quote.js3
-rw-r--r--commands/setlogchannel.js25
3 files changed, 20 insertions, 12 deletions
diff --git a/commands/addquote.js b/commands/addquote.js
index cedee4d..6eae015 100644
--- a/commands/addquote.js
+++ b/commands/addquote.js
@@ -85,7 +85,7 @@ module.exports.run = async (client, message) => {
return;
}
} else if (msg.content.startsWith('http') && (msg.content.endsWith('.jpg') || msg.content.endsWith('.jpeg') || msg.content.endsWith('.png'))) {
- newAuthorImage = message.content;
+ newAuthorImage = msg.content;
} else {
await dmChannel.send('Invalid input. Please provide an image URL or attach an image file.');
collector.stop();
@@ -157,7 +157,7 @@ module.exports.run = async (client, message) => {
await dmChannel.send('Invalid file type. Please attach a .jpg or .png image.');
}
} else if (imageResponse.first().content.startsWith('http') && (imageResponse.first().content.endsWith('.jpg') || imageResponse.first().content.endsWith('.jpeg') || imageResponse.first().content.endsWith('.png'))) {
- newAuthorImage = message.content;
+ newAuthorImage = imageResponse.first().content;
} else {
await dmChannel.send('Invalid input. Please provide an image URL or attach an image file.');
}
diff --git a/commands/quote.js b/commands/quote.js
index 02699cd..f19675f 100644
--- a/commands/quote.js
+++ b/commands/quote.js
@@ -30,13 +30,12 @@ module.exports.run = async (client, message, args) => {
const quote = await quoteDB.findOne({ where: { id: quoteID } })
-
if (quote) {
const quoteEmbed = new MessageEmbed()
.setAuthor({ name: quote.author, iconURL: quote.authorImage })
.setDescription(quote.quote)
.setColor('#1fd619')
- .setFooter('- ' + quote.year);
+ .setFooter(`- ${quote.year}\nSubmitted by ${quote.submitter}`);
await message.reply({ embeds: [quoteEmbed] })
} else {
diff --git a/commands/setlogchannel.js b/commands/setlogchannel.js
index c04e926..d989f8b 100644
--- a/commands/setlogchannel.js
+++ b/commands/setlogchannel.js
@@ -17,21 +17,30 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* *************************************/
-const guildDB = require ('../models/guild-settings')
-module.exports.run = async (client, message) => {
+const { guildSettings } = require ('../models/guild-settings')
+module.exports.run = async (client, message, args) => {
//This will be replaced in the future possibly
if (!message.member.permissions.has('MANAGE_GUILD')) return message.reply('It looks like that you can\'t manage this server.');
- const channel = await message.mentions.channels.first().id;
- const [ guild ] = await guildDB.findOrCreate({ where: { id: message.guild.id } } )
+
+ let channel;
+
+ if (message.mentions.channels.first()) {
+ channel = message.mentions.channels.first().id;
+ } else if (args[0] && message.guild.channels.cache.has(args[0])) {
+ channel = args[0];
+ } else {
+ return await message.reply('Please enter a valid channel ID.')
+ }
+
+ const [ guild ] = await guildSettings.findOrCreate({ where: { guildID: message.guild.id } } )
if (!channel) {
message.reply('No channel has been set, disabling the logging channel feature...');
- await guild.update({ channelId: null } );
+ await guild.update({ logChannelID: null } );
} else {
- await guild.update({ channelId: message.guild.id } ) ;
+ await guild.update({ logChannelID: channel } );
+ await message.reply(`Logging channel has been set to <#${channel}>`);
}
-
- await message.reply(`Logging channel has been set to <#${channel}>`);
};
exports.conf = {