Skip to content

Commit

Permalink
Add files via upload
Browse files Browse the repository at this point in the history
  • Loading branch information
whiteshadowofficial authored Jan 13, 2024
1 parent c2bbac7 commit 8c3ee01
Show file tree
Hide file tree
Showing 4 changed files with 348 additions and 401 deletions.
2 changes: 1 addition & 1 deletion Procfile
Original file line number Diff line number Diff line change
@@ -1 +1 @@
web: npm start
worker: npm start
1 change: 0 additions & 1 deletion app.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

{
"name": "Jessi-md",
"description": "Basic WhatsApp Bot",
Expand Down
21 changes: 6 additions & 15 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,24 +1,15 @@
console.log('Starting Bot...')

console.log('🐾 Starting...')

import yargs from 'yargs'
import cfonts from 'cfonts'
import { fileURLToPath } from 'url'
import { join, dirname } from 'path'
import { createRequire } from 'module'
import { createInterface } from 'readline'
import { setupMaster, fork } from 'cluster'
import { watchFile, unwatchFile } from 'fs'
import yargs from 'yargs'; import cfonts from 'cfonts'; import { fileURLToPath } from 'url'; import { join, dirname } from 'path'; import { createRequire } from 'module'; import { createInterface } from 'readline'; import { setupMaster, fork } from 'cluster'; import { watchFile, unwatchFile } from 'fs';

// https://stackoverflow.com/a/50052194
const { say } = cfonts
const rl = createInterface(process.stdin, process.stdout)
const __dirname = dirname(fileURLToPath(import.meta.url))
const require = createRequire(__dirname) // Bring in the ability to create the 'require' method
const { name, author } = require(join(__dirname, './package.json')) // https://www.stefanjudis.com/snippets/how-to-import-json-files-in-es-modules-node-js/
const require = createRequire(__dirname)

say('Lightweight\nWhatsApp Bot', { font: 'chrome', align: 'center', gradient: ['red', 'magenta'] })
say(`'${name}' By @${author.name || author}`, { font: 'console', align: 'center', gradient: ['red', 'magenta'] })
say('Jessi\nWhatsApp Bot MD', { font: 'chrome', align: 'center', gradient: ['red', 'magenta'] })
say('Bot created by White Shadow', { font: 'console', align: 'center', gradient: ['red', 'magenta'] })

var isRunning = false
/**
Expand Down Expand Up @@ -47,7 +38,7 @@ function start(file) {
})
p.on('exit', (_, code) => {
isRunning = false
console.error('[❗]Exited with code:', code)
console.error('Exited with code:', code)
if (code !== 0) return start(file)
watchFile(args[0], () => {
unwatchFile(args[0])
Expand Down
Loading

0 comments on commit 8c3ee01

Please sign in to comment.