Compare commits

..

No commits in common. "633f0a6fec5b84ffd26913101e9519281a86aef3" and "408176cc9d704c513862ff8019c500263645f669" have entirely different histories.

3 changed files with 4 additions and 35 deletions

View file

@ -28,7 +28,6 @@ export default {
category: 'fun', category: 'fun',
ratelimit: 3, ratelimit: 3,
cooldown: 86400, cooldown: 86400,
guildOnly: true,
async execute(interaction, args, client) { async execute(interaction, args, client) {
const content = args.content; const content = args.content;
const attachment = args.image; const attachment = args.image;
@ -40,31 +39,13 @@ export default {
await interaction.deferReply({ ephemeral: false }); await interaction.deferReply({ ephemeral: false });
let tweet = content; let tweet = content;
const date = new Date(); const date = new Date();
// If guild is less than 1 month old don't accept the tweet
if (interaction.guild.createdAt > date.setMonth(date.getMonth() - 1)) {
await interaction.editReply({ content: 'The server need to be 1 month old to be able to use this command!' });
return;
}
// Reset the date for the next check
date.setTime(Date.now());
// If the bot has been in the guild for less than 1 week don't accept the tweet.
if (interaction.guild.createdAt > date.setDate(date.getDate() - 7)) {
await interaction.editReply({ content: 'I need to be in this server for a week to be able to use this command!' });
}
// Reset the date for the next check
date.setTime(Date.now());
// If account is less than 6 months old don't accept the tweet ( alt prevention ) // If account is less than 6 months old don't accept the tweet ( alt prevention )
if (interaction.user.createdAt > date.setMonth(date.getMonth() - 6)) { if (interaction.user.createdAt > date.setMonth(date.getMonth() - 6)) {
await interaction.editReply({ content: 'Your account is too new to be able to use this command!' }); await interaction.editReply({ content: 'Your account is too new to be able to use this command!' });
return; return;
} }
// Reset the date for the next check // Reset the current date so it checks correctly for the 1 year requirement.
date.setTime(Date.now()); date.setTime(Date.now());
// If account is less than 1 year old don't accept attachment // If account is less than 1 year old don't accept attachment
@ -73,14 +54,12 @@ export default {
return; return;
} }
// remove zero width space
if (tweet) { if (tweet) {
// remove zero width space
tweet = tweet.replace('', ''); tweet = tweet.replace('', '');
// This should only happen if someone tweets a zero width space }
if (tweet.length === 0) {
return interaction.reply({ content: 'Uh oh! You are missing any content for me to tweet!', ephemeral: true });
}
if (tweet) {
wordToCensor.forEach(async word => { wordToCensor.forEach(async word => {
if (tweet.toLowerCase().includes(word.toLowerCase())) { if (tweet.toLowerCase().includes(word.toLowerCase())) {
const body = { type:'tweet', uid: interaction.user.id, reason: 'Automatic ban from banned word.' }; const body = { type:'tweet', uid: interaction.user.id, reason: 'Automatic ban from banned word.' };

View file

@ -42,11 +42,6 @@ export default {
return interaction.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true }); return interaction.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true });
} }
// Guild only check
if (command.guildOnly && !interaction.guild) {
return interaction.reply({ content: '❌ This command only work in a server!', ephemeral: true });
}
// Check if the bot has the needed permissions // Check if the bot has the needed permissions
if (command.default_permission) { if (command.default_permission) {
const clientMember = await interaction.guild.members.fetch(client.user.id); const clientMember = await interaction.guild.members.fetch(client.user.id);

View file

@ -307,11 +307,6 @@ export default {
return message.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true }); return message.reply({ content: '❌ This command is reserved for the owner!', ephemeral: true });
} }
// Guild only check
if (command.guildOnly && !message.guild) {
return message.reply({ content: '❌ This command only work in a server!', ephemeral: true });
}
// Check if the bot has the needed permissions // Check if the bot has the needed permissions
if (command.clientPermissions) { if (command.clientPermissions) {
const clientMember = await message.guild.members.fetch(client.user.id); const clientMember = await message.guild.members.fetch(client.user.id);