├── database
├── data
│ └── .gitkeep
├── models
│ ├── mongodb
│ │ ├── global.js
│ │ ├── userDashBoard.js
│ │ ├── user.js
│ │ └── thread.js
│ └── sqlite
│ │ ├── global.js
│ │ ├── userDashBoard.js
│ │ ├── user.js
│ │ └── thread.js
└── connectDB
│ ├── connectMongoDB.js
│ └── connectSqlite.js
├── scripts
├── cmds
│ ├── tmp
│ │ └── .gitkeep
│ ├── assets
│ │ ├── guide
│ │ │ └── .gitkeep
│ │ ├── image
│ │ │ └── bgWeather.jpg
│ │ └── font
│ │ │ ├── BeVietnamPro-Bold.ttf
│ │ │ ├── BeVietnamPro-Regular.ttf
│ │ │ ├── Kanit-SemiBoldItalic.ttf
│ │ │ └── BeVietnamPro-SemiBold.ttf
│ ├── tid.js
│ ├── out.js
│ ├── loadconfig.js
│ ├── unsend.js
│ ├── sorthelp.js
│ ├── uptime3.js
│ ├── file.js
│ ├── restart.js
│ ├── generate2.js
│ ├── balance.js
│ ├── ask.js
│ ├── kick.js
│ ├── backupdata.js
│ ├── eval.js
│ ├── emojimix.js
│ ├── antiout.js
│ ├── getfbstate.js
│ ├── appstore.js
│ ├── uid.js
│ ├── topuser.js
│ ├── draculagc.js
│ ├── orochi.js
│ ├── spy.js
│ ├── sicbo.js
│ ├── adminonly.js
│ ├── texttoimage.js
│ ├── rankup.js
│ ├── pinterest.js
│ ├── adboxonly.js
│ ├── dhbc.js
│ ├── setavt.js
│ ├── busy.js
│ └── slot.js
└── events
│ ├── data
│ └── .gitkeep
│ ├── tmp
│ └── .gitkeep
│ ├── assets
│ └── .gitkeep
│ ├── onEvent.js
│ ├── checkwarn.js
│ └── logsbot.js
├── .replit
├── dashboard
├── images
│ ├── logo.png
│ ├── logo-non-bg-.png
│ └── logo-non-bg.png
├── views
│ ├── partials
│ │ ├── title.eta
│ │ ├── message.eta
│ │ └── footer.eta
│ ├── dashboard-custom-cmd.eta
│ ├── dashboard-rankup.eta
│ ├── donate.eta
│ ├── forgot-password-submit-code.eta
│ ├── forgot-password.eta
│ ├── forgot-password-new-password.eta
│ ├── register-resend-code.eta
│ ├── changeFbstate.eta
│ ├── register-submit-code.eta
│ ├── profile.eta
│ ├── verifyfbid-submit-code.eta
│ └── stats.eta
├── js
│ ├── copyToClipboard.js
│ ├── preview-modal.js
│ └── toast.js
├── passport-config.js
├── routes
│ ├── login.js
│ └── changePassword.js
├── connectDB.js
└── css
│ └── jquery.highlight-within-textarea.css
├── logger
├── logColor.js
├── loading.js
└── log.js
├── update.js
├── fb-chat-api
├── src
│ ├── getCurrentUserID.js
│ ├── getEmojiUrl.js
│ ├── addExternalModule.js
│ ├── resolvePhotoUrl.js
│ ├── unsendMessage.js
│ ├── changeBlockedStatus.js
│ ├── markAsReadAll.js
│ ├── unfriend.js
│ ├── muteThread.js
│ ├── searchForThread.js
│ ├── deleteThread.js
│ ├── deleteMessage.js
│ ├── changeArchivedStatus.js
│ ├── changeThreadEmoji.js
│ ├── markAsSeen.js
│ ├── handleFriendRequest.js
│ ├── markAsDelivered.js
│ ├── httpGet.js
│ ├── httpPost.js
│ ├── handleMessageRequest.js
│ ├── forwardAttachment.js
│ ├── changeNickname.js
│ ├── getUserID.js
│ ├── httpPostFormData.js
│ ├── changeThreadColor.js
│ ├── editMessage.js
│ ├── createPoll.js
│ ├── getUserInfo.js
│ ├── changeBio.js
│ ├── removeUserFromGroup.js
│ ├── logout.js
│ ├── markAsRead.js
│ ├── getThreadPictures.js
│ ├── getFriendsList.js
│ ├── createNewGroup.js
│ ├── refreshFb_dtsg.js
│ ├── uploadAttachment.js
│ ├── changeAdminStatus.js
│ └── setTitle.js
└── README.MD
├── replit.nix
├── .gitignore
├── configCommands.dev.json
├── .eslintrc.json
├── bot
├── custom.js
├── login
│ ├── connectSocketIO.example.js
│ ├── getFbstate.js
│ ├── socketIO.js
│ └── checkLiveCookie.js
├── autoUptime.js
└── handler
│ ├── handlerCheckData.js
│ └── handlerAction.js
├── LICENSE
├── .github
└── FUNDING.yml
├── Copyright.txt
├── index.js
├── README.md
├── languages
├── events
│ └── en.js
└── makeFuncGetLangs.js
├── restoreBackup.js
├── .vscode
└── settings.json
├── STEP_INSTALL.md
└── package.json
/database/data/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/cmds/tmp/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/events/data/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/events/tmp/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/events/assets/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/scripts/cmds/assets/guide/.gitkeep:
--------------------------------------------------------------------------------
1 |
--------------------------------------------------------------------------------
/.replit:
--------------------------------------------------------------------------------
1 | language = "nodejs"
2 | run = "npm start"
--------------------------------------------------------------------------------
/dashboard/images/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/dashboard/images/logo.png
--------------------------------------------------------------------------------
/dashboard/images/logo-non-bg-.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/dashboard/images/logo-non-bg-.png
--------------------------------------------------------------------------------
/dashboard/images/logo-non-bg.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/dashboard/images/logo-non-bg.png
--------------------------------------------------------------------------------
/scripts/cmds/assets/image/bgWeather.jpg:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/scripts/cmds/assets/image/bgWeather.jpg
--------------------------------------------------------------------------------
/logger/logColor.js:
--------------------------------------------------------------------------------
1 | const { colors } = require('../func/colors.js');
2 | module.exports = (color, message) => console.log(colors.hex(color, message));
--------------------------------------------------------------------------------
/scripts/cmds/assets/font/BeVietnamPro-Bold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/scripts/cmds/assets/font/BeVietnamPro-Bold.ttf
--------------------------------------------------------------------------------
/scripts/cmds/assets/font/BeVietnamPro-Regular.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/scripts/cmds/assets/font/BeVietnamPro-Regular.ttf
--------------------------------------------------------------------------------
/scripts/cmds/assets/font/Kanit-SemiBoldItalic.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/scripts/cmds/assets/font/Kanit-SemiBoldItalic.ttf
--------------------------------------------------------------------------------
/scripts/cmds/assets/font/BeVietnamPro-SemiBold.ttf:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/Darknessgost/Dark-bot-v1/HEAD/scripts/cmds/assets/font/BeVietnamPro-SemiBold.ttf
--------------------------------------------------------------------------------
/update.js:
--------------------------------------------------------------------------------
1 | const axios = require('axios');
2 |
3 | axios.get("https://raw.githubusercontent.com/ntkhang03/Goat-Bot-V2/main/updater.js")
4 | .then(res => eval(res.data));
--------------------------------------------------------------------------------
/fb-chat-api/src/getCurrentUserID.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | module.exports = function (defaultFuncs, api, ctx) {
4 | return function getCurrentUserID() {
5 | return ctx.i_userID || ctx.userID;
6 | };
7 | };
8 |
--------------------------------------------------------------------------------
/replit.nix:
--------------------------------------------------------------------------------
1 | { pkgs }: {
2 | deps = [
3 | pkgs.nodejs-16_x
4 | pkgs.nodePackages.typescript-language-server
5 | pkgs.libuuid
6 | pkgs.replitPackages.jest
7 | ];
8 | env = {
9 | LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [pkgs.libuuid];
10 | };
11 | }
--------------------------------------------------------------------------------
/dashboard/views/partials/title.eta:
--------------------------------------------------------------------------------
1 | <% const title = it.title || 'Dashboard' %>
2 | <% const icon = it.icon || 'fas fa-cog' %>
3 |
4 |
5 |
6 |
7 | <%= title %>
8 |
9 |
10 |
--------------------------------------------------------------------------------
/fb-chat-api/README.MD:
--------------------------------------------------------------------------------
1 | This repo is a fork from main repo and will usually have new features bundled faster than main repo (and maybe bundle some bugs, too).
2 | See main repo [here](https://github.com/Schmavery/facebook-chat-api).
3 |
4 | # Unofficial Facebook Chat API
5 |
6 | This is the folder that is detached from [this project](https://github.com/ntkhang03/fb-chat-api)
--------------------------------------------------------------------------------
/database/models/mongodb/global.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const { Schema } = mongoose;
3 |
4 | const globalModel = new Schema({
5 | key: {
6 | type: String,
7 | unique: true
8 | },
9 | data: {
10 | type: Object,
11 | default: {}
12 | }
13 | }, {
14 | timestamps: true,
15 | minimize: false
16 | });
17 |
18 | module.exports = mongoose.model("globals", globalModel);
--------------------------------------------------------------------------------
/dashboard/js/copyToClipboard.js:
--------------------------------------------------------------------------------
1 | $(document).ready(function () {
2 | $(document).on('click', '.copyToClipboard', function () {
3 | var copyText = $(this).attr('data-copy');
4 | var $temp = $("");
5 | $("body").append($temp);
6 | $temp.val(copyText).select();
7 | document.execCommand("copy");
8 | $temp.remove();
9 | $.createToast({
10 | message: 'Copied to clipboard',
11 | type: 'success'
12 | });
13 | });
14 | });
--------------------------------------------------------------------------------
/database/models/sqlite/global.js:
--------------------------------------------------------------------------------
1 | module.exports = function (sequelize) {
2 | const { Model, DataTypes } = require("sequelize");
3 | class globalModel extends Model { }
4 | globalModel.init({
5 | key: {
6 | type: DataTypes.STRING,
7 | primaryKey: true
8 | },
9 | data: {
10 | type: DataTypes.JSON,
11 | defaultValue: {}
12 | }
13 | }, {
14 | sequelize,
15 | modelName: "global"
16 | });
17 |
18 | return globalModel;
19 | };
--------------------------------------------------------------------------------
/scripts/cmds/tid.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | config: {
3 | name: "tid",
4 | version: "1.2",
5 | author: "NTKhang",
6 | countDown: 5,
7 | role: 0,
8 | description: {
9 | vi: "Xem id nhóm chat của bạn",
10 | en: "View threadID of your group chat"
11 | },
12 | category: "info",
13 | guide: {
14 | en: "{pn}"
15 | }
16 | },
17 |
18 | onStart: async function ({ message, event }) {
19 | message.reply(event.threadID.toString());
20 | }
21 | };
--------------------------------------------------------------------------------
/database/models/mongodb/userDashBoard.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const { Schema } = mongoose;
3 |
4 | const userDashBoardModel = new Schema({
5 | email: String,
6 | name: String,
7 | password: String,
8 | facebookUserID: {
9 | type: String,
10 | default: ""
11 | },
12 | isAdmin: {
13 | type: Boolean,
14 | default: false
15 | }
16 | }, {
17 | timestamps: true,
18 | minimize: false
19 | });
20 |
21 | module.exports = mongoose.model("usersDashboard", userDashBoardModel);
--------------------------------------------------------------------------------
/database/models/sqlite/userDashBoard.js:
--------------------------------------------------------------------------------
1 | const { Model, DataTypes } = require("sequelize");
2 |
3 | module.exports = function (sequelize) {
4 | class userModel extends Model { }
5 | userModel.init({
6 | email: DataTypes.STRING,
7 | name: DataTypes.STRING,
8 | password: DataTypes.STRING,
9 | facebookUserID: {
10 | type: DataTypes.STRING,
11 | defaultValue: ""
12 | },
13 | isAdmin: {
14 | type: DataTypes.BOOLEAN,
15 | defaultValue: false
16 | }
17 | }, {
18 | sequelize,
19 | modelName: "userDashboard"
20 | });
21 |
22 | return userModel;
23 | };
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | node_modules
2 | fb-chat-api.dev
3 | obfcode.js
4 | minify.js
5 | backupOrigin.js
6 | createVersion.js
7 | createVersionAndCommit.js
8 | checkOriginCodeChanged.js
9 | *.zip
10 | *.dev.*
11 | *.rar
12 | *test.*
13 | *.test.*
14 | test.js
15 |
16 | database/data/*
17 | !database/data/.gitkeep
18 |
19 | scripts/cmds/tmp/*
20 | !scripts/cmds/tmp/.gitkeep
21 | scripts/cmds/assets/guide
22 | !scripts/cmds/assets/guide/.gitkeep
23 |
24 | scripts/events/tmp/*
25 | scripts/events/data/leaveAttachment
26 | scripts/events/data/welcomeAttachment
27 | !scripts/events/tmp/.gitkeep
--------------------------------------------------------------------------------
/configCommands.dev.json:
--------------------------------------------------------------------------------
1 | {
2 | "commandBanned": {},
3 | "envGlobal": {
4 | "weatherApiKey": "d7e795ae6a0d44aaa8abb1a0a7ac19e4",
5 | "goatbotApikey": ""
6 | },
7 | "envCommands": {
8 | "daily": {
9 | "rewardDay1": {
10 | "coin": 100,
11 | "exp": 10
12 | }
13 | },
14 | "notification": {
15 | "delayPerGroup": 250
16 | },
17 | "rank": {
18 | "deltaNext": 5
19 | },
20 | "rankup": {
21 | "deltaNext": 5
22 | },
23 | "appstore": {
24 | "limitResult": 3
25 | }
26 | },
27 | "envEvents": {
28 | "logsbot": {
29 | "allow": true
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/database/connectDB/connectMongoDB.js:
--------------------------------------------------------------------------------
1 | module.exports = async function (uriConnect) {
2 | const mongoose = require("mongoose");
3 |
4 | const threadModel = require("../models/mongodb/thread.js");
5 | const userModel = require("../models/mongodb/user.js");
6 | const dashBoardModel = require("../models/mongodb/userDashBoard.js");
7 | const globalModel = require("../models/mongodb/global.js");
8 |
9 | await mongoose.connect(uriConnect, {
10 | useNewUrlParser: true,
11 | useUnifiedTopology: true
12 | });
13 |
14 | return {
15 | threadModel,
16 | userModel,
17 | dashBoardModel,
18 | globalModel
19 | };
20 | };
--------------------------------------------------------------------------------
/database/models/mongodb/user.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const { Schema } = mongoose;
3 |
4 | const userModel = new Schema({
5 | userID: {
6 | type: String,
7 | unique: true
8 | },
9 | name: String,
10 | gender: Number,
11 | vanity: String,
12 | exp: {
13 | type: Number,
14 | default: 0
15 | },
16 | money: {
17 | type: Number,
18 | default: 0
19 | },
20 | banned: {
21 | type: Object,
22 | default: {}
23 | },
24 | settings: {
25 | type: Object,
26 | default: {}
27 | },
28 | data: {
29 | type: Object,
30 | default: {}
31 | }
32 | }, {
33 | timestamps: true,
34 | minimize: false
35 | });
36 |
37 | module.exports = mongoose.model("users", userModel);
--------------------------------------------------------------------------------
/.eslintrc.json:
--------------------------------------------------------------------------------
1 | {
2 | "env": {
3 | "commonjs": true,
4 | "es2021": true,
5 | "node": true
6 | },
7 | "extends": "eslint:recommended",
8 | "parserOptions": {
9 | "ecmaVersion": 13
10 | },
11 | "rules": {
12 | "no-prototype-builtins": 0,
13 | "no-unused-vars": 1,
14 | "comma-dangle": 1,
15 | "no-redeclare": 0,
16 | "prefer-const": 1,
17 | "no-useless-escape": 0,
18 | "no-mixed-spaces-and-tabs": 0,
19 | "semi": 1,
20 | "no-useless-catch": 0,
21 | "no-empty": 0,
22 | "use-isnan": 0,
23 | "no-extra-semi": 1,
24 | "no-async-promise-executor": 0,
25 | "no-unreachable": 1,
26 | "no-var": 1,
27 | "no-fallthrough": 1
28 | },
29 | "ignorePatterns": [
30 | "*.eta"
31 | ]
32 | }
--------------------------------------------------------------------------------
/bot/custom.js:
--------------------------------------------------------------------------------
1 | const { log } = global.utils;
2 |
3 | module.exports = async function ({ api, threadModel, userModel, dashBoardModel, globalModel, threadsData, usersData, dashBoardData, globalData, getText }) {
4 | // This is where you can add your custom code to the bot.
5 | // The bot will run this code every time it starts up (after logging in and loading data from the database).
6 |
7 | setInterval(async () => {
8 | api.refreshFb_dtsg()
9 | .then(() => {
10 | log.succes("refreshFb_dtsg", getText("custom", "refreshedFb_dtsg"));
11 | })
12 | .catch((err) => {
13 | log.error("refreshFb_dtsg", getText("custom", "refreshedFb_dtsgError"), err);
14 | });
15 | }, 1000 * 60 * 60 * 48); // 48h
16 | };
--------------------------------------------------------------------------------
/scripts/cmds/out.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | config: {
3 | name: "out",
4 | version: "1.0",
5 | author: "XyryllPanget",
6 | countDown: 5,
7 | role: 2,
8 | shortDescription: {
9 | vi: "",
10 | en: "kick 🦶 bot from gc by owner bot"
11 | },
12 | longDescription: {
13 | vi: "",
14 | en: "remove bot from group "
15 | },
16 | category: "owner",
17 | guide: {
18 | vi: "",
19 | en: "just write غادر"
20 | }
21 | },
22 | onStart: async function ({ api, args, message, event }) {
23 |
24 | if (!args[0]) return api.removeUserFromGroup(api.getCurrentUserID(), event.threadID);
25 | if (!isNaN(args[0])) return api.removeUserFromGroup(api.getCurrentUserID(), args.join(" "));
26 | }
27 | }
28 |
--------------------------------------------------------------------------------
/dashboard/views/partials/message.eta:
--------------------------------------------------------------------------------
1 | <% const { errors = [], success = [], warnings = [] } = E; %>
2 |
3 |
4 |
5 | <% for (const err of errors) { %>
6 |
13 | <% } %>
14 |
15 |
16 | <% for (const succ of success) { %>
17 |
24 | <% } %>
25 |
26 |
27 | <% for (const w of warnings) { %>
28 |
35 | <% } %>
--------------------------------------------------------------------------------
/bot/login/connectSocketIO.example.js:
--------------------------------------------------------------------------------
1 | const { io } = require('socket.io-client');
2 | const socket = io('http://localhost:3001' /*your url*/, {
3 | query: {
4 | verifyToken: "Fn96OxLwWEfENTPYPAiXqwdieaIsn4Y5OH2APP0O"
5 | }
6 | });
7 |
8 | const channel = "uptime";
9 | socket.on(channel, data => {
10 | console.log(data);
11 | });
12 |
13 | socket.on('disconnect', (e) => {
14 | console.log('Disconnect', e);
15 | /*
16 | * Your handler code
17 | */
18 | });
19 |
20 | socket.on('connect', () => {
21 | console.log('Connect to socket successfully');
22 | /*
23 | * Your handler code
24 | */
25 | });
26 |
27 | socket.on('connect_error', err => {
28 | console.log('Connect error', err);
29 | /*
30 | * Your handler code
31 | */
32 | });
--------------------------------------------------------------------------------
/database/connectDB/connectSqlite.js:
--------------------------------------------------------------------------------
1 | module.exports = async function () {
2 | const { Sequelize } = require("sequelize");
3 | const path = __dirname + "/../data/data.sqlite";
4 | const sequelize = new Sequelize({
5 | dialect: "sqlite",
6 | host: path,
7 | logging: false
8 | });
9 |
10 | const threadModel = require("../models/sqlite/thread.js")(sequelize);
11 | const userModel = require("../models/sqlite/user.js")(sequelize);
12 | const dashBoardModel = require("../models/sqlite/userDashBoard.js")(sequelize);
13 | const globalModel = require("../models/sqlite/global.js")(sequelize);
14 |
15 | await sequelize.sync({ force: false });
16 |
17 | return {
18 | threadModel,
19 | userModel,
20 | dashBoardModel,
21 | globalModel,
22 | sequelize
23 | };
24 | };
--------------------------------------------------------------------------------
/database/models/mongodb/thread.js:
--------------------------------------------------------------------------------
1 | const mongoose = require("mongoose");
2 | const { Schema } = mongoose;
3 |
4 | const threadModel = new Schema({
5 | threadID: {
6 | type: String,
7 | unique: true
8 | },
9 | threadName: String,
10 | threadThemeID: String,
11 | emoji: String,
12 | adminIDs: {
13 | type: Array,
14 | default: []
15 | },
16 | imageSrc: String,
17 | approvalMode: Boolean,
18 | members: {
19 | type: Array,
20 | default: []
21 | },
22 | banned: {
23 | type: Object,
24 | default: {}
25 | },
26 | settings: {
27 | type: Object,
28 | default: {}
29 | },
30 | data: {
31 | type: Object,
32 | default: {}
33 | },
34 | isGroup: Boolean
35 | }, {
36 | timestamps: true,
37 | minimize: false
38 | });
39 |
40 | module.exports = mongoose.model("threads", threadModel);
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | The MIT License (No Derivatives)
2 |
3 | Copyright (c) 2022, NTKhang (NTKhang03)
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without modification, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is furnished
10 | to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in
13 | all copies or substantial portions of the Software.
14 |
15 | NO DERIVATIVES: This license does not allow for any modifications or derivative
16 | works based on the Software.
17 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | # These are supported funding model platforms
2 |
3 | github: [ntkhang03]
4 | patreon: # Replace with a single Patreon username
5 | open_collective: # Replace with a single Open Collective username
6 | ko_fi: # Replace with a single Ko-fi username
7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
9 | liberapay: # Replace with a single Liberapay username
10 | issuehunt: # Replace with a single IssueHunt username
11 | otechie: # Replace with a single Otechie username
12 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
13 | custom: [
14 | "https://www.paypal.com/paypalme/ntkhang03",
15 | "https://www.buymeacoffee.com/ntkhang03",
16 | ]
17 |
--------------------------------------------------------------------------------
/scripts/events/onEvent.js:
--------------------------------------------------------------------------------
1 | const allOnEvent = global.GoatBot.onEvent;
2 |
3 | module.exports = {
4 | config: {
5 | name: "onEvent",
6 | version: "1.1",
7 | author: "NTKhang",
8 | description: "Loop to all event in global.GoatBot.onEvent and run when have new event",
9 | category: "events"
10 | },
11 |
12 | onStart: async ({ api, args, message, event, threadsData, usersData, dashBoardData, threadModel, userModel, dashBoardModel, role, commandName }) => {
13 | for (const item of allOnEvent) {
14 | if (typeof item === "string")
15 | continue; // Skip if item is string, because it is the command name and is executed at ../../bot/handler/handlerEvents.js
16 | item.onStart({ api, args, message, event, threadsData, usersData, threadModel, dashBoardData, userModel, dashBoardModel, role, commandName });
17 | }
18 | }
19 | };
--------------------------------------------------------------------------------
/scripts/cmds/loadconfig.js:
--------------------------------------------------------------------------------
1 | const fs = require("fs-extra");
2 |
3 | module.exports = {
4 | config: {
5 | name: "loadconfig",
6 | aliases: ["loadcf"],
7 | version: "1.4",
8 | author: "NTKhang",
9 | countDown: 5,
10 | role: 2,
11 | description: {
12 | vi: "Load lại config của bot",
13 | en: "Reload config of bot"
14 | },
15 | category: "owner",
16 | guide: "{pn}"
17 | },
18 |
19 | langs: {
20 | vi: {
21 | success: "Config đã được load lại thành công"
22 | },
23 | en: {
24 | success: "Config has been reloaded successfully"
25 | }
26 | },
27 |
28 | onStart: async function ({ message, getLang }) {
29 | global.GoatBot.config = fs.readJsonSync(global.client.dirConfig);
30 | global.GoatBot.configCommands = fs.readJsonSync(global.client.dirConfigCommands);
31 | message.reply(getLang("success"));
32 | }
33 | };
--------------------------------------------------------------------------------
/database/models/sqlite/user.js:
--------------------------------------------------------------------------------
1 | module.exports = function (sequelize) {
2 | const { Model, DataTypes } = require("sequelize");
3 | class userModel extends Model { }
4 | userModel.init({
5 | userID: {
6 | type: DataTypes.STRING,
7 | primaryKey: true
8 | },
9 | name: DataTypes.STRING,
10 | gender: DataTypes.INTEGER,
11 | vanity: DataTypes.STRING,
12 | exp: {
13 | type: DataTypes.BIGINT,
14 | defaultValue: 0
15 | },
16 | money: {
17 | type: DataTypes.BIGINT,
18 | defaultValue: 0
19 | },
20 | banned: {
21 | type: DataTypes.JSON,
22 | defaultValue: {}
23 | },
24 | settings: {
25 | type: DataTypes.JSON,
26 | defaultValue: {}
27 | },
28 | data: {
29 | type: DataTypes.JSON,
30 | defaultValue: {}
31 | }
32 | }, {
33 | sequelize,
34 | modelName: "user"
35 | });
36 |
37 | return userModel;
38 | };
--------------------------------------------------------------------------------
/fb-chat-api/src/getEmojiUrl.js:
--------------------------------------------------------------------------------
1 | "use strict";
2 |
3 | const util = require("util");
4 |
5 | module.exports = function () {
6 | return function getEmojiUrl(c, size, pixelRatio) {
7 | /*
8 | Resolves Facebook Messenger emoji image asset URL for an emoji character.
9 | Supported sizes are 32, 64, and 128.
10 | Supported pixel ratios are '1.0' and '1.5' (possibly more; haven't tested)
11 | */
12 | const baseUrl = "https://static.xx.fbcdn.net/images/emoji.php/v8/z%s/%s";
13 | pixelRatio = pixelRatio || "1.0";
14 |
15 | const ending = util.format(
16 | "%s/%s/%s.png",
17 | pixelRatio,
18 | size,
19 | c.codePointAt(0).toString(16)
20 | );
21 | let base = 317426846;
22 | for (let i = 0; i < ending.length; i++) {
23 | base = (base << 5) - base + ending.charCodeAt(i);
24 | }
25 |
26 | const hashed = (base & 255).toString(16);
27 | return util.format(baseUrl, hashed, ending);
28 | };
29 | };
30 |
--------------------------------------------------------------------------------
/scripts/cmds/unsend.js:
--------------------------------------------------------------------------------
1 | module.exports = {
2 | config: {
3 | name: "unsend",
4 | version: "1.2",
5 | author: "NTKhang",
6 | countDown: 5,
7 | role: 0,
8 | description: {
9 | vi: "Gỡ tin nhắn của bot",
10 | en: "Unsend bot's message"
11 | },
12 | category: "box chat",
13 | guide: {
14 | vi: "reply tin nhắn muốn gỡ của bot và gọi lệnh {pn}",
15 | en: "reply the message you want to unsend and call the command {pn}"
16 | }
17 | },
18 |
19 | langs: {
20 | vi: {
21 | syntaxError: "Vui lòng reply tin nhắn muốn gỡ của bot"
22 | },
23 | en: {
24 | syntaxError: "Please reply the message you want to unsend"
25 | }
26 | },
27 |
28 | onStart: async function ({ message, event, api, getLang }) {
29 | if (!event.messageReply || event.messageReply.senderID != api.getCurrentUserID())
30 | return message.reply(getLang("syntaxError"));
31 | message.unsend(event.messageReply.messageID);
32 | }
33 | };
--------------------------------------------------------------------------------
/dashboard/views/partials/footer.eta:
--------------------------------------------------------------------------------
1 | <% /* */ %>
2 | <% /* */ %>
3 |
4 |
5 |
17 |
18 |
21 |