minor enhancements / action channel manager

This commit is contained in:
SowinskiBraeden committed 2022-07-03 19:23:09 -07:00
1 parent 527aad0e07
commit 91f60417aa
4 files changed
+109 -6

No files matched your search

+4 -4
View File
@@ -1,7 +1,7 @@
const { MessageEmbed } = require('discord.js');
module.exports = {
name: "settweetchannel",
name: "tweetchannel",
description: "Select a channel to send tweets",
usage: "[channel]",
permissions: {
@@ -12,7 +12,7 @@ module.exports = {
options: [
{
name: "channel",
description: "Channel to add to allowed channles",
description: "Channel to send tweets",
value: "channel",
type: 7,
required: true,
@@ -33,8 +33,8 @@ module.exports = {
let channelid = args[0].value;
let channel = client.channels.cache.get(channelid);
if (!channel) return interaction.send(`Cannot find that channel.`);
if (channel.type=="voice") return interaction.send(`Connot set voice channel to preferred channel.`);
if (channel.deleted) return interaction.send(`Connot set deleted channel to preferred channel.`);
if (channel.type=="voice") return interaction.send(`Connot set voice channel to tweets channel.`);
if (channel.deleted) return interaction.send(`Connot set deleted channel to tweets channel.`);
let guild = await client.dbo.collection("guilds").findOne({"server.serverID":interaction.guild.id}).then(guild => guild);
if (client.exists(guild.server.tweetChannel)&&guild.server.tweetChannel==channelid) return interaction.send(`The channel <#${args[0].value}> has already been set for tweets.`);
client.dbo.collection("guilds").updateOne({"server.serverID":interaction.guild.id},{$set:{"server.tweetChannel":channelid}},function(err, res) {