This repository has been archived by the owner on Nov 7, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Showing
9 changed files
with
162 additions
and
109 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 |
---|---|---|
@@ -1,31 +1,35 @@ | ||
# project-orion [![Project Orion CI](https://github.com/mrepol742/project-orion/actions/workflows/npm.yml/badge.svg)](https://github.com/mrepol742/project-orion/actions/workflows/npm.yml) | ||
|
||
<img src="https://mrepol742.github.io/images/orion-banner.png" align="right" width="500px"/> | ||
<img src="https://mrepol742.github.io/images/orion-banner.png" align="right" width="300px"/> | ||
|
||
Meet my lightning-fast Facebook Messenger chatbot, seamlessly managing multiple accounts with access to 271 commands. With distinct privileges for admins, owners, roots, and users, it's the lightweight solution for efficient and personalized interactions. | ||
Meet the lightning-fast Facebook Messenger chatbot, seamlessly managing multiple accounts with access to 271 commands and more. | ||
|
||
## Pre-requisites | ||
- Install [Node.js](https://nodejs.org/en/) version 20.x.x | ||
|
||
## Getting started | ||
- Fork the repository | ||
Click https://github.com/mrepol742/project-orion/fork | ||
- Fork the repository <br> | ||
https://github.com/mrepol742/project-orion/fork | ||
- Clone fork the repository | ||
``` | ||
_> using https | ||
git clone https://github.com/<your-username>/project-orion | ||
_> using ssh | ||
git clone [email protected]:<your-username>/project-orion | ||
``` | ||
``` | ||
# using https | ||
git clone https://github.com/<your-username>/project-orion | ||
# using ssh | ||
git clone [email protected]:<your-username>/project-orion | ||
``` | ||
- Install dependencies | ||
``` | ||
cd project-orion && npm i | ||
``` | ||
``` | ||
cd project-orion && npm i | ||
``` | ||
- Run the project | ||
``` | ||
npm run start | ||
``` | ||
``` | ||
npm run start | ||
``` | ||
|
||
|
||
## Contribute | ||
Code contributions are welcome! Please commit any pull requests against the master branch. Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. | ||
|
||
## License | ||
``` | ||
|
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
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
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,46 @@ | ||
/* | ||
* | ||
* This file is part of Project Orion. | ||
* Copyright (c) 2022 Melvin Jones | ||
* | ||
* Orion is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3 of the License | ||
* | ||
* Orion is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with Orion. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
const fs = require("fs"); | ||
|
||
module.exports = (fileUrl, outputLocationPath) => { | ||
const writer = fs.createWriteStream(outputLocationPath); | ||
return axios({ | ||
method: "get", | ||
url: fileUrl, | ||
responseType: "stream", | ||
}) | ||
.then((response) => { | ||
return new Promise((resolve, reject) => { | ||
response.data.pipe(writer); | ||
let error = null; | ||
writer.on("error", (err) => { | ||
error = err; | ||
writer.close(); | ||
reject(err); | ||
}); | ||
writer.on("close", () => { | ||
if (!error) { | ||
resolve(true); | ||
} | ||
}); | ||
}); | ||
}) | ||
.catch(function (err) { | ||
return err; | ||
}); | ||
} |
Empty file.
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,87 @@ | ||
/* | ||
* | ||
* This file is part of Project Orion. | ||
* Copyright (c) 2022 Melvin Jones | ||
* | ||
* Orion is free software: you can redistribute it and/or modify it | ||
* under the terms of the GNU General Public License as published by | ||
* the Free Software Foundation, version 3 of the License | ||
* | ||
* Orion is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; | ||
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
* See the GNU General Public License for more details. | ||
* | ||
* You should have received a copy of the GNU General Public License along with Orion. If not, see <https://www.gnu.org/licenses/>. | ||
* | ||
*/ | ||
|
||
const canvasGif = require("canvas-gif"); | ||
const Canvas = require("canvas"); | ||
const fs = require("fs"); | ||
const utils = require("./redfox/utils"); | ||
|
||
module.exports = (pictureFile, name, group, member) => { | ||
return new Promise((resolve, reject) => { | ||
try { | ||
name = name.normalize("NFKC").replace(/[^a-z0-9\s]/gi, '') | ||
group = group.normalize("NFKC").replace(/[^a-z0-9\s]/gi, '') | ||
|
||
if (name.length > 26) { | ||
name = name.substring(0, 26) + "..."; | ||
} | ||
if (group.length > 26) { | ||
group = group.substring(0, 26) + "..."; | ||
} | ||
|
||
const callBack = (ctx, width, height, totalFrames, currentFrame) => { | ||
ctx.fillStyle = "#fff"; | ||
ctx.textAlign = "center"; | ||
ctx.font = 'bold 60px "Operator Mono"'; | ||
ctx.fillText(name, width * 0.5, height * 0.7); | ||
ctx.font = '28px "Operator Mono"'; | ||
ctx.fillText(group, width * 0.5, height * 0.77); | ||
ctx.font = '25px "Operator Mono"'; | ||
ctx.fillText(member, width * 0.5, height * 0.82); | ||
|
||
let x = width / 2; | ||
let y = height / 3; | ||
let radius = 130; | ||
ctx.save(); | ||
ctx.beginPath(); | ||
ctx.arc(x, y, radius, 0, 2 * Math.PI); | ||
|
||
ctx.strokeStyle = "#fff"; | ||
ctx.stroke(); | ||
ctx.clip(); | ||
let img = fs.readFileSync(pictureFile); | ||
let img1 = new Canvas.Image(); | ||
img1.src = img; | ||
ctx.drawImage(img1, x - radius, y - radius, radius * 3, radius * 3); | ||
ctx.restore(); | ||
ctx.stroke(); | ||
}; | ||
|
||
let options = { | ||
coalesce: false, | ||
delay: 0, | ||
repeat: 0, | ||
algorithm: "neuquant", | ||
optimiser: true, | ||
fps: 40, | ||
quality: 50, | ||
}; | ||
|
||
canvasGif("./assets/welcome/" + (Math.floor(Math.random() * 5) + 1) + ".gif", callBack, options) | ||
.then((buffer) => { | ||
let timesta = utils.getTimestamp(); | ||
fs.writeFileSync("./cache/welcome_" + timesta + ".gif", buffer); | ||
resolve("./cache/welcome_" + timesta + ".gif"); | ||
}) | ||
.catch((err) => { | ||
reject(err); | ||
}); | ||
} catch (err) { | ||
reject(err); | ||
} | ||
}); | ||
} |
This file was deleted.
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
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,3 @@ | ||
const generatePoster = require("./src/generatePoster"); | ||
|
||
generatePoster("null", "null", "null") |