fix bugs/add tweet command
This commit is contained in:
4 files changed
+63
-7
No files matched your search
@@ -8,7 +8,6 @@ module.exports = {
|
|||||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||||
member: [],
|
member: [],
|
||||||
},
|
},
|
||||||
aliases: ["command", "commands", "cmd"],
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {require("../structures/LinesPoliceCadBot")} client
|
* @param {require("../structures/LinesPoliceCadBot")} client
|
||||||
|
|||||||
+3
-3
@@ -8,7 +8,6 @@ module.exports = {
|
|||||||
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||||
member: [],
|
member: [],
|
||||||
},
|
},
|
||||||
aliases: ["action", "do"],
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @param {require("../structures/LinesPoliceCadBot")} client
|
* @param {require("../structures/LinesPoliceCadBot")} client
|
||||||
@@ -46,9 +45,10 @@ module.exports = {
|
|||||||
|
|
||||||
if (client.exists(GuildDB.actionChannel)) {
|
if (client.exists(GuildDB.actionChannel)) {
|
||||||
const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.actionChannel);
|
const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.actionChannel);
|
||||||
return channel.send({ embeds: [actionEmbed] });
|
channel.send({ embeds: [actionEmbed] });
|
||||||
|
return interaction.send('Action performed');
|
||||||
} else {
|
} else {
|
||||||
return interaction.send({ embeds: [actionEmbed] });
|
return interaction.send({ content: 'Action performed', embeds: [actionEmbed] });
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -0,0 +1,60 @@
|
|||||||
|
const { MessageEmbed } = require('discord.js');
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
name: "tweet",
|
||||||
|
description: "Tweet your thoughts to the local twitter page",
|
||||||
|
usage: "[message]",
|
||||||
|
permissions: {
|
||||||
|
channel: ["VIEW_CHANNEL", "SEND_MESSAGES", "EMBED_LINKS"],
|
||||||
|
member: [],
|
||||||
|
},
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {require("../structures/LinesPoliceCadBot")} client
|
||||||
|
* @param {import("discord.js").MessageCreate} message
|
||||||
|
* @param {string[]} args
|
||||||
|
* @param {*} param3
|
||||||
|
*/
|
||||||
|
SlashCommand: {
|
||||||
|
options: [
|
||||||
|
{
|
||||||
|
name: "message",
|
||||||
|
description: "Your message to tweet",
|
||||||
|
value: "message",
|
||||||
|
type: 3,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @param {require("../structures/LinesPoliceCadBot")} client
|
||||||
|
* @param {import("discord.js").MessageCreate} message
|
||||||
|
* @param {string[]} args
|
||||||
|
* @param {*} param3
|
||||||
|
*/
|
||||||
|
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.`);
|
||||||
|
}
|
||||||
|
|
||||||
|
let userID = interaction.member.user.id;
|
||||||
|
let avatar = interaction.member.user.avatar;
|
||||||
|
|
||||||
|
const tweetEmbed = new MessageEmbed()
|
||||||
|
.setColor('#0099ff')
|
||||||
|
.setTitle('New Twitter Notifciation')
|
||||||
|
.setThumbnail('https://static.vecteezy.com/system/resources/previews/002/534/045/original/social-media-twitter-logo-blue-isolated-free-vector.jpg')
|
||||||
|
.setAuthor({ name: `${interaction.member.user.username}`, iconURL: `https://cdn.discordapp.com/avatars/${userID}/${avatar}.png` })
|
||||||
|
.setDescription(args[0].value)
|
||||||
|
.setTimestamp()
|
||||||
|
|
||||||
|
if (client.exists(GuildDB.tweetChannel)) {
|
||||||
|
const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.tweetChannel);
|
||||||
|
channel.send({ embeds: [tweetEmbed] });
|
||||||
|
return interaction.send('Tweeted!');
|
||||||
|
} else {
|
||||||
|
return interaction.send({ content: 'Tweeted!', embeds: [tweetEmbed] });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
@@ -30,9 +30,6 @@ class QuarksBot extends Client {
|
|||||||
client.log("Interaction")
|
client.log("Interaction")
|
||||||
let GuildDB = await this.GetGuild(interaction.guild_id);
|
let GuildDB = await this.GetGuild(interaction.guild_id);
|
||||||
|
|
||||||
if (interaction.type==3) return;
|
|
||||||
|
|
||||||
|
|
||||||
const command = interaction.data.name.toLowerCase();
|
const command = interaction.data.name.toLowerCase();
|
||||||
const args = interaction.data.options;
|
const args = interaction.data.options;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user