fca-mrking-official-bot 0.0.0-stage → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,26 @@
1
+ name: Publish to NPM
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ - master
8
+
9
+ jobs:
10
+ publish:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - name: Checkout Code
14
+ uses: actions/checkout@v4
15
+
16
+ - name: Setup Node.js
17
+ uses: actions/setup-node@v4
18
+ with:
19
+ node-version: '20'
20
+ registry-url: 'https://registry.npmjs.org'
21
+
22
+ - name: Publish Package
23
+ run: npm publish --access public
24
+ env:
25
+ NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
26
+
package/README.md CHANGED
@@ -1,3 +1 @@
1
- # Temporary Holding Version
2
-
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
1
+ # fca-mr-king
package/index.js ADDED
@@ -0,0 +1,95 @@
1
+ const originFca = require("fb-chat-support");
2
+ const axios = require("axios");
3
+
4
+ // Downloader Module built inside FCA by Roni_Mr.king
5
+ const Downloader = {
6
+ // TikTok Video Downloader
7
+ async tiktok(url) {
8
+ try {
9
+ const res = await axios.post("https://tikwm.com/api/", { url: url });
10
+ if (res.data && res.data.data) {
11
+ return {
12
+ status: true,
13
+ author: "Roni_Mr.king",
14
+ title: res.data.data.title,
15
+ play: res.data.data.play, // Direct Video URL
16
+ music: res.data.data.music // Audio URL
17
+ };
18
+ }
19
+ throw new Error("Invalid TikTok API response");
20
+ } catch (e) {
21
+ return { status: false, error: e.message };
22
+ }
23
+ },
24
+
25
+ // Facebook Video Downloader
26
+ async facebook(url) {
27
+ try {
28
+ const res = await axios.get(`https://api.vytal.workers.dev/fb?url=${encodeURIComponent(url)}`);
29
+ return {
30
+ status: true,
31
+ author: "Roni_Mr.king",
32
+ hd: res.data.hd,
33
+ sd: res.data.sd
34
+ };
35
+ } catch (e) {
36
+ return { status: false, error: "Failed to fetch Facebook video" };
37
+ }
38
+ },
39
+
40
+ // YouTube Direct Downloader
41
+ async youtube(url) {
42
+ try {
43
+ const res = await axios.get(`https://api.cobalt.tools/api/json`, {
44
+ headers: { "Accept": "application/json", "Content-Type": "application/json" },
45
+ data: { url: url }
46
+ });
47
+ return { status: true, author: "Roni_Mr.king", url: res.data.url };
48
+ } catch (e) {
49
+ return { status: false, error: "Failed to process YouTube link" };
50
+ }
51
+ }
52
+ };
53
+
54
+ // Main FCA Login Wrapper
55
+ function login(credentials, options, callback) {
56
+ if (typeof options === "function") {
57
+ callback = options;
58
+ options = {};
59
+ }
60
+
61
+ return originFca(credentials, options, (err, api) => {
62
+ if (err) return callback(err);
63
+
64
+ // Custom Metadata & Author Info
65
+ api.fcaInfo = {
66
+ author: "Roni_Mr.king",
67
+ packageName: "fca-mrking-official-bot",
68
+ version: "1.0.0"
69
+ };
70
+
71
+ // Attach Built-in Downloader Utility directly to API
72
+ api.downloader = Downloader;
73
+
74
+ // Direct Media Attachment Helper
75
+ api.sendAttachmentFromUrl = async (url, threadID, body = "", messageID = null) => {
76
+ try {
77
+ const stream = (await axios.get(url, { responseType: "stream" })).data;
78
+ return api.sendMessage({ body: body, attachment: stream }, threadID, messageID);
79
+ } catch (err) {
80
+ return api.sendMessage("Failed to send attachment from URL", threadID, messageID);
81
+ }
82
+ };
83
+
84
+ console.log("==================================================");
85
+ console.log("[ FCA-MRKING ] Connected successfully!");
86
+ console.log("[ FCA-MRKING ] Package: fca-mrking-official-bot");
87
+ console.log("[ FCA-MRKING ] Author: Roni_Mr.king");
88
+ console.log("==================================================");
89
+
90
+ return callback(null, api);
91
+ });
92
+ }
93
+
94
+ module.exports = login;
95
+
package/package.json CHANGED
@@ -1,6 +1,40 @@
1
1
  {
2
2
  "name": "fca-mrking-official-bot",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "1.0.0",
4
+ "description": "High-performance custom FCA package with built-in media downloaders & safety features for GoatBot by Roni_Mr.king",
5
+ "main": "index.js",
6
+ "scripts": {
7
+ "test": "echo \"Error: no test specified\" && exit 1"
8
+ },
9
+ "keywords": [
10
+ "fca",
11
+ "goatbot",
12
+ "facebook-chat-api",
13
+ "downloader",
14
+ "mrking",
15
+ "messenger-bot"
16
+ ],
17
+ "author": "Roni_Mr.king",
18
+ "license": "MIT",
19
+ "dependencies": {
20
+ "@napi-rs/canvas": "^0.1.52",
21
+ "axios": "^1.7.0",
22
+ "canvas": "^2.11.2",
23
+ "chalk": "^4.1.2",
24
+ "cheerio": "^1.0.0-rc.12",
25
+ "crypto-js": "^4.2.0",
26
+ "express": "^4.19.0",
27
+ "fb-chat-support": "latest",
28
+ "fluent-ffmpeg": "^2.1.2",
29
+ "form-data": "^4.0.0",
30
+ "fs-extra": "^11.2.0",
31
+ "jimp": "^0.22.12",
32
+ "moment-timezone": "^0.5.45",
33
+ "mongoose": "^8.2.0",
34
+ "mqtt": "^5.3.0",
35
+ "npmlog": "^7.0.1",
36
+ "request": "^2.88.2",
37
+ "totp-generator": "^0.0.14",
38
+ "websocket-stream": "^5.5.2"
39
+ }
40
+ }