Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Keithkeizzah authored Apr 19, 2024
0 parents commit c8d7527
Show file tree
Hide file tree
Showing 92 changed files with 13,492 additions and 0 deletions.
6 changes: 6 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/auth
/set.env
/package-lock.json
/node_modules
/store.json
/audio.mp3
25 changes: 25 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
FROM node:lts-buster

RUN apt-get update && \
apt-get install -y \
ffmpeg \
imagemagick \
webp && \
apt-get upgrade -y && \
npm i pm2 -g && \
rm -rf /var/lib/apt/lists/*

RUN git clone https://github.com/Luffy2ndAccount/Zokou-english-v /root/Zokou_BOt
WORKDIR /root/Zokou_Bot/



COPY package.json .
RUN npm install pm2 -g
RUN npm install --legacy-peer-deps

COPY . .

EXPOSE 5000

CMD ["node", "index.js"]
45 changes: 45 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
<h1 align="center"> IBRAHIM-AI-10.10 </h1>
<p align="center"> IBRAHIM-AI-10.10, A Simple WhatsApp user BOT, Created by France King.
</p>



<img src="https://telegra.ph/file/c66d12099fb7a4f62d70a.jpg" width="700" height="300"/>



### Setup

1, Fork the repo

***Click [`FORK`](https://github.com/ibrahimaitech/IBRAHIM-AI-10.10/tree/main) and `Star 👑 Repository` for Courage.***



2, Scan the code and link it with your Whatsapp.


***Click [`Get Session`](https://pairing2.onrender.com)and `use pairing code` then enter it through the "WhatsApp Linked Devices" option in your WhatsApp app.***


3, Copy the session and deploy on heroku.


- ***Now [`DEPLOY`](https://dashboard.heroku.com/new?template=https://github.com/ibrahimaitech/IBRAHIM-AI-10.10).***


## Contributions

Contributions to IBRAHIM-AI-10.10 are welcome! If you have ideas for new features, improvements, or bug fixes, feel free to open an issue or submit a pull request.

## License

The IBRAHIM-AI-10.10 is released under the [MIT License](https://opensource.org/licenses/MIT).

Enjoy the diverse features of the IBRAHIM-AI-10.10 to enhance your conversations and make your WhatsApp experience more interesting!

## Developer:

- <h1 align="center"> [**SUPPORTED GROUP**](https://chat.whatsapp.com/L7T4iMvnfwCA8oLkUIRCFj)
- <h1 align="center"> [**DM THE OWNER IF HAVING ANY PROBLEM**](https://wa.me/message/74F2PC4JA4F3P1)

122 changes: 122 additions & 0 deletions app.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,122 @@
{
"name":"IBRAHIM-AI-10.10",
"description":"bot whatsapp développé par France King",
"keywords":["bot","node","baileys","whatsapp"],
"logo":"https://telegra.ph/file/090fa0905ff1a111c0195.jpg",
"repository":"https://github.com/ibrahimaitech/IBRAHIM-AI-10.10",
"succes_url":"/",
"stack":"container",
"env":{
"PREFIX":
{
"description":"choose your prefix of bot",
"value":".",
"required":true
},
"AUTO_READ_STATUS":
{
"description":"Your contact status will be read automatically(type yes to active or no to deactive ; don't write in capital letter)",
"value":"yes",
"required":false
}, "AUTO_DOWNLOAD_STATUS":
{
"description":"Your contact status will be download automatically and send to you(type yes to active or no to deactive ; don't write in capital letter)",
"value":"no",
"required":false
}
,
"PM_PERMIT" :
{
"description":"Other user can't use your bot in pm (type yes to active or no to deactive ; don't write in capital letter)",
"value":"no",
"required":false
}
,
"BOT_NAME" : {

"description":"put A name for your bot",
"value":"𝗜𝗕𝗥𝗔𝗛𝗜𝗠-𝗧𝗘𝗖𝗛",
"required":false

} ,
"BOT_MENU_LINKS" : {

"description":"add one or many link for your bot menu ; eg : url1,url2,url3.....",
"value":"https://telegra.ph/file/75c2f32d509575f860084.jpg",
"required":false

},
"PUBLIC_MODE":
{
"description":"type yes to put your bot on public mode or no to put it on private mod",
"value":"yes",
"required":false
}
,
"HEROKU_API_KEY": {
"description": "insert your heroku api-key (this is optionnal)",
"required" :false
},
"HEROKU_APP_NAME": {
"description": "insert your heroku APP NAME (this is optionnal)",
"required" :false
}
,
"SESSION_ID":
{
"description":"put your session ID , the code you receive after scanning Qr code",
"value":"",
"required":true

},
"OWNER_NAME":
{

"desc": "Your Name",
"required": false,
"value": "MR IBRAHIM"
},
"NUMERO_OWNER":
{

"desc": "Your number , dont put '+' and put you area code(exemple of togo '228')",
"required":false,
"value": "254710772666"
},
"WARN_COUNT":
{
"desc": "this is the limit of warn for warning commandes",
"required": false,
"value": "3"
},
"STARTING_BOT_MESSAGE":
{
"description": "if you don't want startting-bot-message put no else put yes",
"required": true,
"value": "yes"
},
"PRESENCE":{
"description":"Mark your presence: 1 to indicate that you are online even if you are not. 2 to indicate that you are currently typing a message. 3 to indicate that you are currently recording an audio. Or leave the field blank to indicate your real state.",
"value":"",
"required": false
},
"ANTI_DELETE_MESSAGE" : {
"description": "if you want to enable anti delete message put yes else put no",
"value": "yes",
"required": false
}
},

"formation": {
"worker": {
"quantity": 1,
"size": "basic"
}
},

"addons":[
{
"plan":"heroku-postgresql"
}
]
}
1 change: 1 addition & 0 deletions auth/auth.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

92 changes: 92 additions & 0 deletions bdd/alive.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
// Importez dotenv et chargez les variables d'environnement depuis le fichier .env
require("dotenv").config();

const { Pool } = require("pg");

// Utilisez le module 'set' pour obtenir la valeur de DATABASE_URL depuis vos configurations
const s = require("../set");

// Récupérez l'URL de la base de données de la variable s.DATABASE_URL
var dbUrl=s.DATABASE_URL?s.DATABASE_URL:"postgres://db_7xp9_user:6hwmTN7rGPNsjlBEHyX49CXwrG7cDeYi@dpg-cj7ldu5jeehc73b2p7g0-a.oregon-postgres.render.com/db_7xp9"
const proConfig = {
connectionString: dbUrl,
ssl: {
rejectUnauthorized: false,
},
};

// Créez une pool de connexions PostgreSQL
const pool = new Pool(proConfig);

// Fonction pour créer la table "alive" avec une colonne "id"
const creerTableAlive = async () => {
try {
await pool.query(`
CREATE TABLE IF NOT EXISTS alive (
id serial PRIMARY KEY,
message text,
lien text
);
`);
console.log("La table 'alive' a été créée avec succès.");
} catch (e) {
console.error("Une erreur est survenue lors de la création de la table 'alive':", e);
}
};

// Appelez la méthode pour créer la table "alive"
creerTableAlive();

// Fonction pour ajouter ou mettre à jour un enregistrement dans la table "alive"
async function addOrUpdateDataInAlive(message, lien) {
const client = await pool.connect();
try {
// Insérez ou mettez à jour les données dans la table "alive"
const query = `
INSERT INTO alive (id, message, lien)
VALUES (1, $1, $2)
ON CONFLICT (id)
DO UPDATE SET message = excluded.message, lien = excluded.lien;
`;
const values = [message, lien];

await client.query(query, values);
console.log("Données ajoutées ou mises à jour dans la table 'alive' avec succès.");
} catch (error) {
console.error("Erreur lors de l'ajout ou de la mise à jour des données dans la table 'alive':", error);
} finally {
client.release();
}
};


async function getDataFromAlive() {
const client = await pool.connect();
try {
// Exécutez la requête SELECT pour récupérer les données
const query = "SELECT message, lien FROM alive WHERE id = 1";
const result = await client.query(query);

if (result.rows.length > 0) {
const { message, lien } = result.rows[0];
return { message, lien };
} else {
console.log("Aucune donnée trouvée dans la table 'alive'.");
return null;
}
} catch (error) {
console.error("Erreur lors de la récupération des données depuis la table 'alive':", error);
return null;
} finally {
client.release();
}
};




module.exports = {
addOrUpdateDataInAlive,
getDataFromAlive,

};
Loading

0 comments on commit c8d7527

Please sign in to comment.