eslint fix
This commit is contained in:
parent
6ce2faf21b
commit
6983ea58b7
5 changed files with 37 additions and 37 deletions
|
@ -33,9 +33,9 @@ export default {
|
||||||
const body = { type:command, uid: userid, reason: reason };
|
const body = { type:command, uid: userid, reason: reason };
|
||||||
Blacklists.create(body);
|
Blacklists.create(body);
|
||||||
if (command === 'guild') {
|
if (command === 'guild') {
|
||||||
let guildid = userid;
|
const guildid = userid;
|
||||||
await client.guilds.fetch(guildid);
|
await client.guilds.fetch(guildid);
|
||||||
const guild =client.guilds.resolve(guildid).name;
|
const guild = client.guilds.resolve(guildid).name;
|
||||||
|
|
||||||
return interaction.editReply(`The guild ${guild} (${guildid}) has been blacklisted with the following reason \`${reason}\``);
|
return interaction.editReply(`The guild ${guild} (${guildid}) has been blacklisted with the following reason \`${reason}\``);
|
||||||
|
|
||||||
|
|
|
@ -12,7 +12,7 @@ export default {
|
||||||
const client = interaction.client;
|
const client = interaction.client;
|
||||||
if (interaction.type !== InteractionType.ApplicationCommand) return;
|
if (interaction.type !== InteractionType.ApplicationCommand) return;
|
||||||
|
|
||||||
const globalBlacklist = await db.Blacklists.findOne({ where: { type:'global', uid:interaction.user.id } })
|
const globalBlacklist = await db.Blacklists.findOne({ where: { type:'global', uid:interaction.user.id } });
|
||||||
const commandBlacklist = await db.Blacklists.findOne({ where: { type:interaction.commandName, uid:interaction.user.id } });
|
const commandBlacklist = await db.Blacklists.findOne({ where: { type:interaction.commandName, uid:interaction.user.id } });
|
||||||
|
|
||||||
if (interaction.guild) {
|
if (interaction.guild) {
|
||||||
|
@ -38,10 +38,10 @@ export default {
|
||||||
|
|
||||||
if (!command) return;
|
if (!command) return;
|
||||||
|
|
||||||
const isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });
|
let isOptOut = await db.optout.findOne({ where: { userID: interaction.user.id } });
|
||||||
|
|
||||||
if (commandName === 'optout') {
|
if (commandName === 'optout') {
|
||||||
isOptOut = true
|
isOptOut = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
const timestamp = new Date();
|
const timestamp = new Date();
|
||||||
|
|
|
@ -146,28 +146,28 @@ async function autoCrop(input, output) {
|
||||||
|
|
||||||
execFile('ffprobe',
|
execFile('ffprobe',
|
||||||
['-f', 'lavfi', '-i', `movie=${ffprobeInput},cropdetect`, '-show_entries',
|
['-f', 'lavfi', '-i', `movie=${ffprobeInput},cropdetect`, '-show_entries',
|
||||||
'packet_tags=lavfi.cropdetect.w,lavfi.cropdetect.h,lavfi.cropdetect.x,lavfi.cropdetect.y',
|
'packet_tags=lavfi.cropdetect.w,lavfi.cropdetect.h,lavfi.cropdetect.x,lavfi.cropdetect.y',
|
||||||
'-read_intervals', '%+#10', '-hide_banner', '-print_format', 'json'], async (err, stdout, stderr) => {
|
'-read_intervals', '%+#10', '-hide_banner', '-print_format', 'json'], async (err, stdout, stderr) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
reject(stderr);
|
reject(stderr);
|
||||||
}
|
|
||||||
if (stderr) {
|
|
||||||
console.error(stderr);
|
|
||||||
}
|
|
||||||
const packets = JSON.parse(stdout).packets;
|
|
||||||
|
|
||||||
for (let i = 0; i < packets.length; i++) {
|
|
||||||
const element = packets[i];
|
|
||||||
|
|
||||||
if (element.tags) {
|
|
||||||
const cropdetect = element.tags;
|
|
||||||
await ffmpeg(['-i', input, '-vf', `crop=${cropdetect['lavfi.cropdetect.w']}:${cropdetect['lavfi.cropdetect.h']}:${cropdetect['lavfi.cropdetect.x']}:${cropdetect['lavfi.cropdetect.y']}`, '-vcodec', 'libx264', '-acodec', 'aac', output])
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
if (stderr) {
|
||||||
|
console.error(stderr);
|
||||||
|
}
|
||||||
|
const packets = JSON.parse(stdout).packets;
|
||||||
|
|
||||||
console.log(NODE_ENV === 'development' ? stdout : null);
|
for (let i = 0; i < packets.length; i++) {
|
||||||
resolve();
|
const element = packets[i];
|
||||||
});
|
|
||||||
|
if (element.tags) {
|
||||||
|
const cropdetect = element.tags;
|
||||||
|
await ffmpeg(['-i', input, '-vf', `crop=${cropdetect['lavfi.cropdetect.w']}:${cropdetect['lavfi.cropdetect.h']}:${cropdetect['lavfi.cropdetect.x']}:${cropdetect['lavfi.cropdetect.y']}`, '-vcodec', 'libx264', '-acodec', 'aac', output]);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(NODE_ENV === 'development' ? stdout : null);
|
||||||
|
resolve();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue