send anonymous tweets
This commit is contained in:
2 files changed
+20
-7
No files matched your search
+19
-6
@@ -18,6 +18,14 @@ module.exports = {
|
||||
type: 3,
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "use_vpn",
|
||||
description: "Tweet from an anonymous account",
|
||||
value: "use_vpn",
|
||||
type: 3,
|
||||
choices: [{ name: "true", value: "true" }], // this just makes it look like we are enabling it optionally, but all
|
||||
required: false, // we care for is that args[1] exists to send an anonymous tweet.
|
||||
},
|
||||
],
|
||||
SlashCommand: {
|
||||
/**
|
||||
@@ -29,20 +37,25 @@ 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 userID = interaction.member.user.id;
|
||||
let avatar = interaction.member.user.avatar;
|
||||
const userID = interaction.member.user.id;
|
||||
const avatar = interaction.member.user.avatar;
|
||||
|
||||
const tweetEmbed = new EmbedBuilder()
|
||||
let tweetEmbed = new EmbedBuilder()
|
||||
.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(args[1])) {
|
||||
tweetEmbed.setAuthor({ name: 'Anonymous', iconURL: 'https://www.pngkey.com/png/detail/230-2301779_best-classified-apps-default-user-profile.png' })
|
||||
} else {
|
||||
tweetEmbed.setAuthor({ name: `${interaction.member.user.username}`, iconURL: `https://cdn.discordapp.com/avatars/${userID}/${avatar}.png` })
|
||||
}
|
||||
|
||||
if (client.exists(GuildDB.tweetChannel)) {
|
||||
const channel = interaction.guild.channels.cache.find(channel => channel.id === GuildDB.tweetChannel);
|
||||
if (!channel) {
|
||||
@@ -55,7 +68,7 @@ module.exports = {
|
||||
try {
|
||||
channel.send({ embeds: [tweetEmbed] });
|
||||
} 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({ content: 'Tweeted!' });
|
||||
} else {
|
||||
|
||||
Reference in new issue
Block a user