Changed some hex to replace and added an alias

Signed-off-by: loicbersier <loic.bersier1@gmail.com>
This commit is contained in:
loicbersier 2020-07-28 16:03:21 +02:00
parent acfe0010a5
commit be1db47633

View file

@ -9,7 +9,7 @@ const downloader = require('../../utils/download');
class cursesCommand extends Command {
constructor() {
super('curses', {
aliases: ['curses'],
aliases: ['curses', 'curse'],
category: 'fun',
clientPermissions: ['SEND_MESSAGES', 'ATTACH_FILES'],
args: [
@ -43,7 +43,8 @@ class cursesCommand extends Command {
link = await attachment(message);
let ext = path.extname(link.toLowerCase());
if (ext !== '.webm' || ext !== '.mp4')
console.log(ext);
if (ext !== '.webm' && ext !== '.mp4')
ext = '.mp4';
@ -60,14 +61,14 @@ class cursesCommand extends Command {
let file = fs.readFileSync(output).toString('hex');
let searchHex = '6d766864';
let replaceHex = '0000017FFFFFFF';
let replaceHex = '0000180FFFFFF7F';
let skipByte = 34;
let endResult;
if (ext === '.webm') {
searchHex = '2ad7b1';
replaceHex = '00000000';
replaceHex = '42FFB060';
skipByte = 8;
endResult = replaceAt(file, file.indexOf(searchHex) + file.substring(file.indexOf(searchHex)).indexOf('4489') + skipByte, replaceHex);