forked from elrebelde21/LoliBot-MD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
90215ea
commit 85bea7b
Showing
18 changed files
with
5,109 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
FROM node:lts-buster | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y \ | ||
ffmpeg \ | ||
imagemagick \ | ||
webp && \ | ||
apt-get upgrade -y && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
COPY package.json . | ||
|
||
RUN npm install && npm install qrcode-terminal | ||
|
||
COPY . . | ||
|
||
EXPOSE 5000 | ||
|
||
CMD ["node", "index.js"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
web: node . --server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
{ | ||
"name": "The-LoliBot-MD", | ||
"description": "Super Bot WhatsApp", | ||
"repository": "https://github.com/elrebelde21/The-LoliBot-MD", | ||
"logo": "https://i.imgur.com/8fK4h6F.jpg", | ||
"keywords": ["java", "bot", "whatsapp-bot", "whatsapp-automation"], | ||
"buildpacks": [ | ||
{ | ||
"url": "heroku/nodejs" | ||
}, | ||
{ | ||
"url": "https://github.com/jonathanong/heroku-buildpack-ffmpeg-latest" | ||
}, | ||
{ | ||
"url": "https://github.com/bogini/heroku-buildpack-graphicsmagick" | ||
} | ||
] | ||
} |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,69 @@ | ||
console.log('Iniciando 🚀🚀🚀') | ||
import { join, dirname } from "path"; | ||
import { createRequire } from "module"; | ||
import { fileURLToPath } from "url"; | ||
import { setupMaster, fork } from "cluster"; | ||
import { watchFile, unwatchFile } from "fs"; | ||
import cfonts from "cfonts"; | ||
import chalk from "chalk"; | ||
import { createInterface } from "readline"; | ||
import yargs from "yargs"; | ||
const __dirname = dirname(fileURLToPath(import.meta.url)); | ||
const require = createRequire(__dirname); | ||
const { name, author } = require(join(__dirname, "./package.json")); | ||
const { say } = cfonts; | ||
const rl = createInterface(process.stdin, process.stdout); | ||
|
||
say('The Loli\nBot\nMD', { | ||
font: 'chrome', | ||
align: 'center', | ||
gradient: ['red', 'magenta']}) | ||
say(`Por LoliBot`, { | ||
font: 'console', | ||
align: 'center', | ||
gradient: ['red', 'magenta']}); | ||
|
||
var isRunning = false; | ||
/** | ||
* Start a js file | ||
* @param {String} file `path/to/file` | ||
*/ | ||
function start(file) { | ||
if (isRunning) return | ||
isRunning = true; | ||
let args = [join(__dirname, file), ...process.argv.slice(2)] | ||
|
||
setupMaster({ | ||
exec: args[0], | ||
args: args.slice(1), | ||
}) | ||
let p = fork() | ||
p.on('message', data => { | ||
console.log('╭--------- - - - ✓\n┆ ✅ TIEMPO DE ACTIVIDAD ACTUALIZADA\n╰-------------------- - - -', data) | ||
switch (data) { | ||
case 'reset': | ||
p.process.kill() | ||
isRunning = false | ||
start.apply(this, arguments) | ||
break | ||
case 'uptime': | ||
p.send(process.uptime()) | ||
break | ||
}}) | ||
p.on('exit', (_, code) => { | ||
isRunning = false | ||
console.error('⚠️ Error Inesperado ⚠️', code) | ||
if (code === 0) return | ||
watchFile(args[0], () => { | ||
unwatchFile(args[0]) | ||
start(file) | ||
}) | ||
}) | ||
let opts = new Object(yargs(process.argv.slice(2)).exitProcess(false).parse()) | ||
if (!opts['test']) | ||
if (!rl.listenerCount()) rl.on('line', line => { | ||
p.emit('message', line.trim()) | ||
}) | ||
//console.log(p) | ||
} | ||
start('main.js') |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM fedora:37 | ||
|
||
RUN sudo dnf -y update &&\ | ||
sudo dnf install -y https://mirrors.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm https://mirrors.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm &&\ | ||
sudo dnf install -y git ffmpeg ImageMagick nodejs yarnpkg libwebp &&\ | ||
sudo dnf clean all -y | ||
|
||
RUN git clone https://github.com/elrebelde21/The-LoliBot-MD | ||
|
||
WORKDIR /root/The-LoliBot-MD | ||
|
||
COPY ./root/The-LoliBot-MD | ||
|
||
RUN yarn install | ||
|
||
CMD ["node", "index.js"] |
Oops, something went wrong.