Merge branch 'dev' into dev
This commit is contained in:
commit
dec900ae29
12 changed files with 190 additions and 140 deletions
16
.deepsource.toml
Normal file
16
.deepsource.toml
Normal file
|
@ -0,0 +1,16 @@
|
|||
version = 1
|
||||
|
||||
[[analyzers]]
|
||||
name = "javascript"
|
||||
enabled = true
|
||||
|
||||
[[analyzers]]
|
||||
name = "shell"
|
||||
enabled = true
|
||||
|
||||
[[transformers]]
|
||||
name = "standardjs"
|
||||
enabled = true
|
||||
|
||||
[[transformers]]
|
||||
name = "prettier"
|
104
.vscode/extensions.json
vendored
104
.vscode/extensions.json
vendored
|
@ -1,52 +1,52 @@
|
|||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
|
||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||
// List of extensions which should be recommended for users of this workspace.
|
||||
"recommendations": [
|
||||
"abrahamwilliam007.es7-javascript-class-snippets",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"christian-kohler.path-intellisense",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"donjayamanne.githistory",
|
||||
"eamodio.gitlens",
|
||||
"esbenp.prettier-vscode",
|
||||
"github.github-vscode-theme",
|
||||
"irongeek.vscode-env",
|
||||
"xabikos.javascriptsnippets",
|
||||
"wix.vscode-import-cost",
|
||||
"vscode-icons-team.vscode-icons",
|
||||
"visualstudioexptteam.vscodeintellicode",
|
||||
"teledemic.branch-warnings",
|
||||
"tabnine.tabnine-vscode",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"seatonjiang.gitmoji-vscode",
|
||||
"sburg.vscode-javascript-booster",
|
||||
"kisstkondoros.vscode-codemetrics",
|
||||
"mgmcdermott.vscode-language-babel",
|
||||
"mhutchie.git-graph",
|
||||
"mikestead.dotenv",
|
||||
"mongodb.mongodb-vscode",
|
||||
"ms-vscode-remote.remote-wsl-recommender",
|
||||
"ms-vscode.js-debug",
|
||||
"ms-vscode.js-debug-companion",
|
||||
"ms-vscode.references-view",
|
||||
"ms-vscode.vscode-js-profile-table",
|
||||
"pflannery.vscode-versionlens",
|
||||
"adpyke.codesnap",
|
||||
"anan.devdocstab",
|
||||
"axosoft.gitkraken-glo",
|
||||
"gruntfuggly.todo-tree",
|
||||
"kiteco.kite",
|
||||
"lkytal.pomodoro",
|
||||
"wayou.vscode-todo-highlight",
|
||||
"johnpapa.vscode-peacock",
|
||||
"stepsize.stepsize",
|
||||
"nicoespeon.abracadabra",
|
||||
"sonarsource.sonarlint-vscode",
|
||||
"nicoespeon.hocus-pocus",
|
||||
"aaron-bond.better-comments",
|
||||
"oouo-diogo-perdigao.docthis"
|
||||
],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
{
|
||||
// See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations.
|
||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||
// List of extensions which should be recommended for users of this workspace.
|
||||
"recommendations": [
|
||||
"abrahamwilliam007.es7-javascript-class-snippets",
|
||||
"christian-kohler.npm-intellisense",
|
||||
"christian-kohler.path-intellisense",
|
||||
"dbaeumer.vscode-eslint",
|
||||
"donjayamanne.githistory",
|
||||
"eamodio.gitlens",
|
||||
"esbenp.prettier-vscode",
|
||||
"github.github-vscode-theme",
|
||||
"irongeek.vscode-env",
|
||||
"xabikos.javascriptsnippets",
|
||||
"wix.vscode-import-cost",
|
||||
"vscode-icons-team.vscode-icons",
|
||||
"visualstudioexptteam.vscodeintellicode",
|
||||
"teledemic.branch-warnings",
|
||||
"tabnine.tabnine-vscode",
|
||||
"streetsidesoftware.code-spell-checker",
|
||||
"seatonjiang.gitmoji-vscode",
|
||||
"sburg.vscode-javascript-booster",
|
||||
"kisstkondoros.vscode-codemetrics",
|
||||
"mgmcdermott.vscode-language-babel",
|
||||
"mhutchie.git-graph",
|
||||
"mikestead.dotenv",
|
||||
"mongodb.mongodb-vscode",
|
||||
"ms-vscode-remote.remote-wsl-recommender",
|
||||
"ms-vscode.js-debug",
|
||||
"ms-vscode.js-debug-companion",
|
||||
"ms-vscode.references-view",
|
||||
"ms-vscode.vscode-js-profile-table",
|
||||
"pflannery.vscode-versionlens",
|
||||
"adpyke.codesnap",
|
||||
"anan.devdocstab",
|
||||
"axosoft.gitkraken-glo",
|
||||
"gruntfuggly.todo-tree",
|
||||
"kiteco.kite",
|
||||
"lkytal.pomodoro",
|
||||
"wayou.vscode-todo-highlight",
|
||||
"johnpapa.vscode-peacock",
|
||||
"stepsize.stepsize",
|
||||
"nicoespeon.abracadabra",
|
||||
"sonarsource.sonarlint-vscode",
|
||||
"nicoespeon.hocus-pocus",
|
||||
"aaron-bond.better-comments",
|
||||
"oouo-diogo-perdigao.docthis"
|
||||
],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
"unwantedRecommendations": []
|
||||
}
|
||||
|
|
52
.vscode/settings.json
vendored
52
.vscode/settings.json
vendored
|
@ -1,26 +1,26 @@
|
|||
{
|
||||
"editor.bracketPairColorization.enabled": true,
|
||||
"editor.codeActionsOnSave": ["source.formatDocument", "source.fixAll.eslint"],
|
||||
"editor.cursorBlinking": "phase",
|
||||
"editor.cursorSmoothCaretAnimation": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.fontFamily": "Cascadia Code",
|
||||
"editor.fontLigatures": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.guides.bracketPairs": "active",
|
||||
"editor.minimap.maxColumn": 200,
|
||||
"editor.minimap.renderCharacters": false,
|
||||
"editor.minimap.showSlider": "always",
|
||||
"editor.tabSize": 2,
|
||||
"editor.wordWrapColumn": 100,
|
||||
"files.eol": "\n",
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"cSpell.customDictionaries": {
|
||||
"custom-dictionary-workspace": {
|
||||
"name": "custom-dictionary-workspace",
|
||||
"path": "${workspaceFolder:xyter}/.cspell/custom-dictionary-workspace.txt",
|
||||
"addWords": true,
|
||||
"scope": "workspace"
|
||||
}
|
||||
}
|
||||
}
|
||||
{
|
||||
"editor.bracketPairColorization.enabled": true,
|
||||
"editor.codeActionsOnSave": ["source.formatDocument", "source.fixAll.eslint"],
|
||||
"editor.cursorBlinking": "phase",
|
||||
"editor.cursorSmoothCaretAnimation": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode",
|
||||
"editor.fontFamily": "Cascadia Code",
|
||||
"editor.fontLigatures": true,
|
||||
"editor.formatOnSave": true,
|
||||
"editor.guides.bracketPairs": "active",
|
||||
"editor.minimap.maxColumn": 200,
|
||||
"editor.minimap.renderCharacters": false,
|
||||
"editor.minimap.showSlider": "always",
|
||||
"editor.tabSize": 2,
|
||||
"editor.wordWrapColumn": 100,
|
||||
"files.eol": "\n",
|
||||
"files.trimTrailingWhitespace": true,
|
||||
"cSpell.customDictionaries": {
|
||||
"custom-dictionary-workspace": {
|
||||
"name": "custom-dictionary-workspace",
|
||||
"path": "${workspaceFolder:xyter}/.cspell/custom-dictionary-workspace.txt",
|
||||
"addWords": true,
|
||||
"scope": "workspace"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
50
PRIVACY.md
50
PRIVACY.md
|
@ -7,54 +7,50 @@ This document entails the privacy policy and agreement that you accept when addi
|
|||
|
||||
This privacy policy applies to **Xyter**#7721 (949998000401436673)
|
||||
|
||||
|
||||
|
||||
|
||||
### Terminology
|
||||
* **Server Manager** - Anyone who has the ability to add a bot to a server or configure the bot for the server. This is usually an administrator or moderator
|
||||
* **Server Member** - Anyone who is a member of server to which one of the bots has been added
|
||||
* **Service User** - Anyone who authorizes an application (logs in) for a scope that provides additional information
|
||||
|
||||
|
||||
- **Server Manager** - Anyone who has the ability to add a bot to a server or configure the bot for the server. This is usually an administrator or moderator
|
||||
- **Server Member** - Anyone who is a member of server to which one of the bots has been added
|
||||
- **Service User** - Anyone who authorizes an application (logs in) for a scope that provides additional information
|
||||
|
||||
### Data Collected By Command
|
||||
The following items may be collected and stored when intentionally provided by a user (usually by means of a command). This data will not be collected automatically. When providing data in this way, you forego any rights to the content of the data provided.
|
||||
* Server configurations (/settings guild)
|
||||
* Data and content for automated tasks (/shop roles)
|
||||
* Locale (/settings user language)
|
||||
* Reputation (/reputation give)
|
||||
|
||||
The following items may be collected and stored when intentionally provided by a user (usually by means of a command). This data will not be collected automatically. When providing data in this way, you forego any rights to the content of the data provided.
|
||||
|
||||
- Server configurations (/settings guild)
|
||||
- Data and content for automated tasks (/shop roles)
|
||||
- Locale (/settings user language)
|
||||
- Reputation (/reputation give)
|
||||
|
||||
### Data Collected When Enabled
|
||||
|
||||
These items will be automatically collected if a bot is configured to perform certain actions by a server manager. These features are always opt-in, and thus this data will not be collected unless the corresponding feature is enabled.
|
||||
* API Token & URL (/settings guild pterodactyl)
|
||||
* Counters (/admin counter)
|
||||
|
||||
|
||||
- API Token & URL (/settings guild pterodactyl)
|
||||
- Counters (/admin counter)
|
||||
|
||||
### Data Collected Automatically
|
||||
|
||||
This data may be collected automatically. This data is used to provide statistics or history data. For any bots that collect this data, it is necessary for features of said bot.
|
||||
* Username ID (Unique identifier)
|
||||
* Guild ID (Unique identifier)
|
||||
* Any data needed for standard operation of Discord bots, such as server permissions
|
||||
* Credits (/profile view)
|
||||
* Points (/profile view)
|
||||
* Levels (/profile view)
|
||||
* Timestamps (Audit logs and all your data that we store)
|
||||
|
||||
|
||||
- Username ID (Unique identifier)
|
||||
- Guild ID (Unique identifier)
|
||||
- Any data needed for standard operation of Discord bots, such as server permissions
|
||||
- Credits (/profile view)
|
||||
- Points (/profile view)
|
||||
- Levels (/profile view)
|
||||
- Timestamps (Audit logs and all your data that we store)
|
||||
|
||||
### Data Storage
|
||||
|
||||
All stored data is kept on protected servers. While storage methods vary, most data is kept within password-protected databases such as [MongoDB Atlas](https://atlas.mongodb.com/). Please keep in mind that even with these protections, no data can ever be 100% secure. All efforts are taken to keep your data secure and private, but its absolute security cannot be guaranteed.
|
||||
|
||||
|
||||
|
||||
### Feedback
|
||||
|
||||
Feedback on Xyter bot and service is appreciated. When you submit comments, suggestions, bug reports, and any other forms of feedback, you forego any rights to the content, title, or intent of the provided feedback. Additionally, the feedback may be utilized in any way.
|
||||
|
||||
|
||||
|
||||
### Agreement
|
||||
|
||||
By adding Xyter bot to your server or using this bot or service in any way, you are consenting to the policies outlined in this document. In addition, you (the server manager) are agreeing to inform your members of the [Developer Terms of Service](https://discordapp.com/developers/docs/legal) and the contents of this document. If you, the server manager, do not agree to this document, you may remove the bot(s) from the server. If you, the server member, do not agree to this document, you may leave the server that contains the bot(s). If you, the service user, do not agree to this document, you may revoke authorization of the application(s) in your 'Authorized Apps' menu.
|
||||
|
||||
Changes to This Privacy Policy
|
||||
|
|
|
@ -8,6 +8,7 @@
|
|||
|
||||
<div align=center>
|
||||
|
||||
[](https://app.codacy.com/gh/ZynerOrg/xyter?utm_source=github.com&utm_medium=referral&utm_content=ZynerOrg/xyter&utm_campaign=Badge_Grade_Settings)
|
||||
[](https://sonarcloud.io/dashboard?id=ZynerOrg_xyter)
|
||||
[](https://www.codefactor.io/repository/github/ZynerOrg/xyter/overview/main)
|
||||
|
||||
|
|
|
@ -2,10 +2,10 @@
|
|||
|
||||
## Supported Versions
|
||||
|
||||
| Version | Supported |
|
||||
| ------- | ------------------ |
|
||||
| Version | Supported |
|
||||
| ---------- | ------------------ |
|
||||
| 2022.4.x | :white_check_mark: |
|
||||
| < 2022.4.x | :x: |
|
||||
| < 2022.4.x | :x: |
|
||||
|
||||
## Reporting a Vulnerability
|
||||
|
||||
|
|
|
@ -27,11 +27,10 @@
|
|||
"email": "vermium@zyner.org"
|
||||
},
|
||||
"dependencies": {
|
||||
"@crowdin/ota-client": "^0.7.0",
|
||||
"@discordjs/builders": "^0.13.0",
|
||||
"@discordjs/rest": "^0.4.0",
|
||||
"@types/i18next-fs-backend": "^1.1.2",
|
||||
"axios": "^0.27.0",
|
||||
"axios": "^0.27.2",
|
||||
"chance": "^1.1.8",
|
||||
"common": "^0.2.5",
|
||||
"crypto": "^1.0.1",
|
||||
|
|
|
@ -4,7 +4,7 @@ import { secretKey, algorithm } from "@config/encryption";
|
|||
|
||||
const iv = crypto.randomBytes(16);
|
||||
|
||||
const encrypt = (text: any) => {
|
||||
const encrypt = (text: any): { iv: error; content: error } => {
|
||||
const cipher = crypto.createCipheriv(algorithm, secretKey, iv);
|
||||
|
||||
const encrypted = Buffer.concat([cipher.update(text), cipher.final()]);
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import logger from "@root/logger";
|
||||
|
||||
export default (count: number, noun: string, suffix?: string) => {
|
||||
export default (count: number, noun: string, suffix?: string): string => {
|
||||
const result = `${count} ${noun}${count !== 1 ? suffix || "s" : ""}`;
|
||||
logger?.silly(`Pluralized ${count} to ${result}`);
|
||||
return result;
|
||||
|
|
43
src/index.ts
43
src/index.ts
|
@ -9,18 +9,51 @@ import schedules from "@handlers/schedules";
|
|||
import events from "@handlers/events";
|
||||
import commands from "@handlers/commands";
|
||||
|
||||
// Main process that starts all other sub processes
|
||||
const main = async () => {
|
||||
// Initiate client object
|
||||
const client = new Client({
|
||||
intents,
|
||||
});
|
||||
|
||||
await database();
|
||||
await schedules(client);
|
||||
// Start database manager
|
||||
await database()
|
||||
.then(async () => {
|
||||
await logger.silly("Database process started");
|
||||
})
|
||||
.catch(async (err) => {
|
||||
await logger.error(`${err}`);
|
||||
});
|
||||
|
||||
await commands(client);
|
||||
await events(client);
|
||||
// Start schedule manager
|
||||
await schedules(client)
|
||||
.then(async () => {
|
||||
await logger.silly("Schedules process started");
|
||||
})
|
||||
.catch(async (err) => {
|
||||
await logger.error(`${err}`);
|
||||
});
|
||||
|
||||
// Start command handler
|
||||
await commands(client)
|
||||
.then(async () => {
|
||||
await logger.silly("Commands process started");
|
||||
})
|
||||
.catch(async (err) => {
|
||||
await logger.error(`${err}`);
|
||||
});
|
||||
|
||||
// Start event handler
|
||||
await events(client)
|
||||
.then(async () => {
|
||||
await logger.silly("Events process started");
|
||||
})
|
||||
.catch(async (err) => {
|
||||
await logger.error(`${err}`);
|
||||
});
|
||||
|
||||
// Authorize with Discord's API
|
||||
await client.login(token);
|
||||
};
|
||||
|
||||
main();
|
||||
main()
|
|
@ -3,24 +3,31 @@ import "winston-daily-rotate-file";
|
|||
|
||||
const { combine, timestamp, printf, colorize, align, json } = winston.format;
|
||||
|
||||
export default winston.createLogger({
|
||||
level: process.env.LOG_LEVEL || "silly",
|
||||
transports: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: "logs/combined-%DATE%.log",
|
||||
datePattern: "YYYY-MM-DD",
|
||||
maxFiles: "14d",
|
||||
format: combine(timestamp(), json()),
|
||||
}),
|
||||
new winston.transports.Console({
|
||||
format: combine(
|
||||
colorize({ all: true }),
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD HH:MM:ss",
|
||||
module.exports = {
|
||||
// Logger initialized async-hronously
|
||||
logger: async () => {
|
||||
return winston.createLogger({
|
||||
level: process.env.LOG_LEVEL || "silly",
|
||||
transports: [
|
||||
new winston.transports.DailyRotateFile({
|
||||
filename: "logs/combined-%DATE%.log",
|
||||
datePattern: "YYYY-MM-DD",
|
||||
maxFiles: "14d",
|
||||
format: combine(timestamp(), json()),
|
||||
}),
|
||||
align(),
|
||||
printf((info) => `[${info.timestamp}] ${info.level}: ${info.message}`)
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
new winston.transports.Console({
|
||||
format: combine(
|
||||
colorize({ all: true }),
|
||||
timestamp({
|
||||
format: "YYYY-MM-DD HH:MM:ss",
|
||||
}),
|
||||
align(),
|
||||
printf(
|
||||
(info) => `[${info.timestamp}] ${info.level}: ${info.message}`
|
||||
)
|
||||
),
|
||||
}),
|
||||
],
|
||||
});
|
||||
},
|
||||
};
|
||||
|
|
|
@ -1,12 +1,10 @@
|
|||
import axios from "axios";
|
||||
import { CommandInteraction, MessageEmbed } from "discord.js";
|
||||
import { CommandInteraction } from "discord.js";
|
||||
|
||||
import getEmbedConfig from "@helpers/getEmbedConfig";
|
||||
|
||||
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
|
||||
import logger from "@logger";
|
||||
import embedBuilder from "@root/helpers/embedBuilder";
|
||||
|
||||
export default {
|
||||
|
|
Loading…
Add table
Reference in a new issue