Compare commits

..

2 commits

Author SHA1 Message Date
4c5d879650 add autocrop 2024-07-08 23:50:28 +02:00
fe641132da enable invite when user installed 2024-07-08 23:50:20 +02:00
2 changed files with 13 additions and 1 deletions

View file

@ -8,6 +8,7 @@ export default {
.setDescription('The bot you want to make an invite link for.') .setDescription('The bot you want to make an invite link for.')
.setRequired(false)), .setRequired(false)),
category: 'utility', category: 'utility',
integration_types: [0, 1],
async execute(interaction, args, client) { async execute(interaction, args, client) {
if (args.bot) { if (args.bot) {
if (args.bot.user.bot) { if (args.bot.user.bot) {

View file

@ -23,6 +23,10 @@ export default {
option.setName('fps') option.setName('fps')
.setDescription('Change the speed at which the gif play at. Default 20. Number between 1 and 100.') .setDescription('Change the speed at which the gif play at. Default 20. Number between 1 and 100.')
.setRequired(false)) .setRequired(false))
.addBooleanOption(option =>
option.setName('autocrop')
.setDescription('Autocrop borders on gif.')
.setRequired(false))
.addBooleanOption(option => .addBooleanOption(option =>
option.setName('noloop') option.setName('noloop')
.setDescription('Stop the gif from looping') .setDescription('Stop the gif from looping')
@ -62,7 +66,14 @@ export default {
utils.downloadVideo(url, interaction.id) utils.downloadVideo(url, interaction.id)
.then(async () => { .then(async () => {
const file = fs.readdirSync(os.tmpdir()).filter(fn => fn.startsWith(interaction.id)); const file = fs.readdirSync(os.tmpdir()).filter(fn => fn.startsWith(interaction.id));
const output = `${os.tmpdir()}/${file}`; let output = `${os.tmpdir()}/${file}`;
if (args.autocrop) {
const oldOutput = output;
output = `${os.tmpdir()}/autocrop${file}`;
await utils.autoCrop(oldOutput, output);
}
const gifskiOutput = output.replace(path.extname(output), '.gif'); const gifskiOutput = output.replace(path.extname(output), '.gif');
const gifsicleOutput = output.replace(path.extname(output), 'gifsicle.gif'); const gifsicleOutput = output.replace(path.extname(output), 'gifsicle.gif');