fix bot crash on bot response with only text

This commit is contained in:
SowinskiBraeden committed 2022-09-24 10:41:30 -07:00
1 parent 8fbe602597
commit 7fbbd2d70f
15 files changed
+20 -20

No files matched your search

+2 -2
View File
@@ -54,7 +54,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
const missing = !GuildDB.dispatchChannel && !GuildDB.dispatcherRole
@@ -112,7 +112,7 @@ module.exports = {
} catch (err) {
return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `)
}
return interaction.send('A report has been sent via 311.');
return interaction.send({ content: 'A report has been sent via 311.' });
},
},
}
+3 -3
View File
@@ -54,7 +54,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
const missing = !GuildDB.dispatchChannel && !GuildDB.dispatcherRole
@@ -110,9 +110,9 @@ module.exports = {
try {
channel.send({ content: `<@&${GuildDB.dispatcherRole}> New 911 call!`, embeds: [embed911], components: [opt] });
} catch (err) {
return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `)
return interaction.send({ content: `<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required.` })
}
return interaction.send('911 Alerted!');
return interaction.send({ content: '911 Alerted!' });
},
},
}
+1 -1
View File
@@ -111,7 +111,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
let banking = await client.dbo.collection("banks").findOne({"banking.userID": interaction.member.user.id}).then(banking => banking);
+1 -1
View File
@@ -38,7 +38,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
if (!GuildDB.officerRole) {
+1 -1
View File
@@ -151,7 +151,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
let inventory = await client.dbo.collection("inventories").findOne({"inventory.userID": interaction.member.user.id}).then(inventory => inventory);
+3 -3
View File
@@ -29,7 +29,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
const actionEmbed = new EmbedBuilder()
@@ -50,9 +50,9 @@ module.exports = {
try {
channel.send({ embeds: [actionEmbed] });
} catch (err) {
return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `)
return interaction.send({ content: `<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required.` })
}
return interaction.send('Action performed');
return interaction.send({ content: 'Action performed' });
} else {
return interaction.send({ content: 'Action performed', embeds: [actionEmbed] });
}
+1 -1
View File
@@ -52,7 +52,7 @@ module.exports = {
if (permissions.includes("MANAGE_GUILD")) canUseCommand = true;
if (client.exists(GuildDB.botAdmin) && interaction.member.roles.includes(GuildDB.botAdmin)) canUseCommand = true;
if (!canUseCommand) return interaction.send('You don\'t have the permissions to use this command.');
if (!canUseCommand) return interaction.send({ content: 'You don\'t have the permissions to use this command.' });
const targetUserID = args[2].value.replace('<@!', '').replace('>', '');
let banking = await client.dbo.collection("banks").findOne({"banking.userID": targetUserID}).then(banking => banking);
+1 -1
View File
@@ -33,7 +33,7 @@ module.exports = {
if (permissions.includes("MANAGE_GUILD")) canUseCommand = true;
if (client.exists(GuildDB.botAdmin) && interaction.member.roles.includes(GuildDB.botAdmin)) canUseCommand = true;
if (!canUseCommand) return interaction.send('You don\'t have the permissions to use this command.');
if (!canUseCommand) return interaction.send({ content: 'You don\'t have the permissions to use this command.' });
const targetUserID = args[0].value.replace('<@!', '').replace('>', '');
+1 -1
View File
@@ -37,7 +37,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
let targetUserID = args[0].value.replace('<@!', '').replace('>', '');
+1 -1
View File
@@ -379,7 +379,7 @@ module.exports = {
if (permissions.includes("MANAGE_GUILD")) canUseCommand = true;
if (client.exists(GuildDB.botAdmin) && interaction.member.roles.includes(GuildDB.botAdmin)) canUseCommand = true;
if (!canUseCommand) return interaction.send('You don\'t have the permissions to use this command.');
if (!canUseCommand) return interaction.send({ content: 'You don\'t have the permissions to use this command.' });
if (args[0].name == 'allowed_channels') {
const channelid = args[0].options[0].options[0].value;
+1 -1
View File
@@ -57,7 +57,7 @@ module.exports = {
} catch (err) {
return interaction.send(`<@${client.user.id}> Does not have permissions to send to the channel.\nMake sure your admins give <@${client.user.id}> access to all channels required. `)
}
return interaction.send('Tweeted!');
return interaction.send({ content: 'Tweeted!' });
} else {
return interaction.send({ content: 'Tweeted!', embeds: [tweetEmbed] });
}
+1 -1
View File
@@ -54,7 +54,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
let inventory = await client.dbo.collection("inventories").findOne({"inventory.userID": interaction.member.user.id}).then(inventory => inventory);
+1 -1
View File
@@ -21,7 +21,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
if (GuildDB.incomeRoleStatus) {
+1 -1
View File
@@ -23,7 +23,7 @@ module.exports = {
*/
run: async (client, interaction, args, { GuildDB }) => {
if (GuildDB.customChannelStatus==true&&!GuildDB.allowedChannels.includes(interaction.channel_id)) {
return interaction.send(`You are not allowed to use the bot in this channel.`);
return interaction.send({ content: `You are not allowed to use the bot in this channel.` });
}
const hasWorkRole = GuildDB.incomeRoles.some(data => {