Skip to content

eduardolgfon/Ergon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⭐ Ergon 🤖 ⭐

✨ Ergon is a WhatsApp chat bot with some cool features. ✨

⚠️ » Ergon is still under development, feel free to contribute to this repo and leave a

⚠️ » Disclaimer: WhatsApp is replacing phone numbers by lids, so I'm replacing it on DB to prevent sendind msgs & duplicated users problems. Unfortunately, it would be just hard and slow to migrate all users. So you should truncate users and msgs tables.


🤔 What do you mean by "cool features"?:

  • Talk to Gemini AI with searching, memories and alarms;
  • Translate text;
  • Speak in 5 languages;
  • Reveal view once messages;
  • Change its prefix just for you;
  • Remove background from stickers;
  • Rank members by sent msgs count;
  • Create stickers with photos and videos;
  • Mass delete group msgs for all members;
  • Mention all users in a group in a single msg;
  • Run code in multiple programming languages;
  • Download videos and audios from many websites;

and more.

🤔 How to install?

1 - 🛠️ Install runtimes and tools:

🪧 » Recommended version: 24 or higher

OPTIONAL TOOLS

🪧 » Recommended version: 16 or higher

⚠️ » You may notice some auth creds/keys storing issues if you don't set a DB, but Ergon will still work well. Also, some cmds may require a database to work (e.g. rank/alarm) or setting user-level language/prefix permanently.

  • FFMPEG (for video stickers)

🪧 » Run sudo apt install ffmpeg to install it on Debian/Ubuntu

🪧 » Recommended version: 3.12 or higher

  • You can also use these languages/runtimes inside Ergon or eval. But it's not required for any base features. only install them if you want to use them.

2 - 📁 Download or clone the repository:

# Click on "Code" > "Download ZIP" > Extract

# or
# Clone this repo
git clone https://github.com/Sunf3r/Ergon # You need to have git installed to run this cmd

3 - 🌿 Preparing the environment:

  • .env (conf/.env.example)

💡 » Set sensitive keys and rename ".env.example" to ".env". if you have a database, remove the # before DATABASE_URL and fill the URL.

DATABASE_URL="postgresql://role:password@host:port/db"
DEVS="number01|number02|number03"
GEMINI="get a key on https://aistudio.google.com/app/apikey"

You can also set default configuration:

  • defaults.json (conf/defaults.json)
{
	"lang": "pt", // bot default language
	"prefix": ".", // bot default prefix
	"timezone": "America/Sao_Paulo", // logs timezone
	"cache": {
		"users": 200, // max users in cache
		"groups": 200, // max groups in cache
		"dmMsgs": 10, // max msgs per DM chat
		"groupMsgs": 200 // max msgs per group
	}
}

3 - 🧰 Installing dependencies and starting 🚀:

💡 » Open the folder in terminal

cd Ergon

# This script will do everything to prepare the bot for
# **the first time**, *but you need to do steps 1~3 first*
# You DO NOT need to run setup EVERY TIME you want to start the bot.
npm run setup
# It will: install tsc/pm2/prisma as global modules,
# install node modules,
# generate prisma schema, build source,
# create python virtual environment,
# install python dependencies,
# and >start the bot< with pm2

# if you have a database, run this one after setup. it will also push db schema 
npm run setup:full

# To stop Ergon:
npm run stop

# To start it again:
npm start
# yea, you don't need "run" for start.
# Just "npm start" instead of "npm run start"

4 - 🔐 Log in:

  • Just scan the QR Code that will appear on terminal and then it's ready!

⚠️ » All logs and QR codes will appear on conf/log.txt.

Also, read the important notes bellow

-1. 🗒️ Important Notes:

Using Download cmd

  • For using download cmd you should provide session cookies for YouTube, X (Twitter), TikTok, Instagram, etc.
  • export your cookies.txt using a browser extension and place it at conf/cookies.txt.

Random delays

  • Random Delays are implemented on several places to prevent Ergon from being flagged as a Bot by Meta anti-bot detectors.
  • I don't recommend removing it.

Updating:

# Stopping services
npm run stop

# You can update everything just running:
npm run update
# It will: pull commits from repository,
# update node modules, update deno and bun,
# update python dependencies, generate prisma schema,
# and rebuild source.

# 'update' won't start services.

# Starting services
npm start

⚠️ » None of these scripts will update Python, LuaJIT, PostgreSQL, G++ or GIT. You still need to do it by yourself

Reset

  • I recommend you to reset and log out WhatsApp Web sometimes to fix decrypt bugs
npm run stop # Stopping services

npm run reset # Cleaning auth, cache and temp

npm start # Starting all services
# Scan QR Code

Extras:

  • Experiencing bugs? Open a issue with your problem or make a pull request with the solution.

  • I will try to fix it as soon as possible.

  • If you need help, feel free to ask me on Discord (it's in my profile).

  • This bot was made to run on Linux, but you can run it on Windows just changing script or using WSL.

I hope you like it :)

About

an useful WhatsApp chat bot with some really cool features

Topics

Resources

License

Stars

Watchers

Forks

Contributors 3

  •  
  •  
  •  

Languages