Merge pull request #483 from VermiumSifell/dev
Improve developer experience
This commit is contained in:
commit
cd47d11339
45 changed files with 6996 additions and 13191 deletions
9
.github/workflows/docker-image.yml
vendored
9
.github/workflows/docker-image.yml
vendored
|
@ -1,16 +1,11 @@
|
||||||
name: Docker Image CI
|
name: Docker Image CI
|
||||||
|
|
||||||
on:
|
on:
|
||||||
schedule:
|
|
||||||
- cron: "0 10 * * *"
|
|
||||||
push:
|
push:
|
||||||
branches:
|
|
||||||
- "**"
|
|
||||||
tags:
|
|
||||||
- "v*.*.*"
|
|
||||||
pull_request:
|
|
||||||
branches:
|
branches:
|
||||||
- "main"
|
- "main"
|
||||||
|
tags:
|
||||||
|
- "*.*.*"
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker:
|
docker:
|
||||||
|
|
62
.vscode/extensions.json
vendored
62
.vscode/extensions.json
vendored
|
@ -3,50 +3,30 @@
|
||||||
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
// Extension identifier format: ${publisher}.${name}. Example: vscode.csharp
|
||||||
// List of extensions which should be recommended for users of this workspace.
|
// List of extensions which should be recommended for users of this workspace.
|
||||||
"recommendations": [
|
"recommendations": [
|
||||||
"abrahamwilliam007.es7-javascript-class-snippets",
|
"nicoespeon.abracadabra",
|
||||||
|
"mgmcdermott.vscode-language-babel",
|
||||||
|
"aaron-bond.better-comments",
|
||||||
|
"streetsidesoftware.code-spell-checker",
|
||||||
|
"adpyke.codesnap",
|
||||||
|
"mikestead.dotenv",
|
||||||
|
"mateuszdrewniak.theme-dracula-dark-plus",
|
||||||
|
"irongeek.vscode-env",
|
||||||
|
"dbaeumer.vscode-eslint",
|
||||||
|
"dracula-theme.theme-dracula",
|
||||||
|
"mhutchie.git-graph",
|
||||||
|
"donjayamanne.githistory",
|
||||||
|
"github.github-vscode-theme",
|
||||||
|
"eamodio.gitlens",
|
||||||
|
"vtrois.gitmoji-vscode",
|
||||||
|
"xabikos.javascriptsnippets",
|
||||||
"christian-kohler.npm-intellisense",
|
"christian-kohler.npm-intellisense",
|
||||||
"christian-kohler.path-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",
|
"johnpapa.vscode-peacock",
|
||||||
"stepsize.stepsize",
|
"esbenp.prettier-vscode",
|
||||||
"nicoespeon.abracadabra",
|
"wayou.vscode-todo-highlight",
|
||||||
"sonarsource.sonarlint-vscode",
|
"gruntfuggly.todo-tree",
|
||||||
"nicoespeon.hocus-pocus",
|
"pflannery.vscode-versionlens",
|
||||||
"aaron-bond.better-comments",
|
"vscode-icons-team.vscode-icons"
|
||||||
"oouo-diogo-perdigao.docthis",
|
|
||||||
"Vtrois.gitmoji-vscode"
|
|
||||||
],
|
],
|
||||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||||
"unwantedRecommendations": []
|
"unwantedRecommendations": []
|
||||||
|
|
19884
package-lock.json
generated
19884
package-lock.json
generated
File diff suppressed because it is too large
Load diff
25
package.json
25
package.json
|
@ -33,46 +33,29 @@
|
||||||
"email": "vermium@zyner.org"
|
"email": "vermium@zyner.org"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@discordjs/rest": "^1.0.0",
|
|
||||||
"@prisma/client": "^4.5.0",
|
"@prisma/client": "^4.5.0",
|
||||||
"@types/i18next-fs-backend": "^1.1.2",
|
"@types/i18next-fs-backend": "^1.1.2",
|
||||||
"axios": "^1.0.0",
|
"axios": "^1.0.0",
|
||||||
"chance": "^1.1.8",
|
"chance": "^1.1.8",
|
||||||
"common": "^0.2.5",
|
|
||||||
"crypto": "^1.0.1",
|
|
||||||
"date-fns": "^2.29.3",
|
|
||||||
"discord-api-types": "^0.37.0",
|
|
||||||
"discord.js": "^14.0.0",
|
"discord.js": "^14.0.0",
|
||||||
"dotenv": "^16.0.1",
|
"dotenv": "^16.0.1",
|
||||||
"i18n": "^0.15.0",
|
|
||||||
"i18next": "^22.0.0",
|
|
||||||
"i18next-async-backend": "^2.0.0",
|
|
||||||
"i18next-fs-backend": "^2.0.0",
|
|
||||||
"i18next-http-backend": "^2.0.0",
|
|
||||||
"i18next-resources-to-backend": "^1.0.0",
|
|
||||||
"moment": "^2.29.4",
|
|
||||||
"mongoose": "^6.2.3",
|
|
||||||
"node-schedule": "^2.1.0",
|
"node-schedule": "^2.1.0",
|
||||||
"ts-node": "^10.7.0",
|
|
||||||
"tsconfig-paths": "^4.0.0",
|
|
||||||
"typescript": "^4.8.4",
|
"typescript": "^4.8.4",
|
||||||
"uuid": "^9.0.0",
|
"uuid": "^9.0.0",
|
||||||
|
"winston": "^3.8.2",
|
||||||
"winston-daily-rotate-file": "^4.6.1"
|
"winston-daily-rotate-file": "^4.6.1"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/chance": "1.1.3",
|
"@types/chance": "1.1.3",
|
||||||
"@types/node-schedule": "2.1.0",
|
"@types/node-schedule": "2.1.0",
|
||||||
"@types/uuid": "8.3.4",
|
"@types/uuid": "8.3.4",
|
||||||
"@typescript-eslint/eslint-plugin": "5.41.0",
|
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
||||||
"@typescript-eslint/parser": "5.41.0",
|
"@typescript-eslint/parser": "^5.42.0",
|
||||||
"eslint": "8.26.0",
|
"eslint": "^8.26.0",
|
||||||
"eslint-config-airbnb-base": "15.0.0",
|
|
||||||
"eslint-config-prettier": "8.5.0",
|
"eslint-config-prettier": "8.5.0",
|
||||||
"eslint-plugin-import": "2.26.0",
|
"eslint-plugin-import": "2.26.0",
|
||||||
"eslint-plugin-no-loops": "0.3.0",
|
"eslint-plugin-no-loops": "0.3.0",
|
||||||
"eslint-plugin-prettier": "4.2.1",
|
"eslint-plugin-prettier": "4.2.1",
|
||||||
"husky": "8.0.1",
|
|
||||||
"jest": "29.2.2",
|
|
||||||
"lint-staged": "13.0.3",
|
"lint-staged": "13.0.3",
|
||||||
"nodemon": "2.0.20",
|
"nodemon": "2.0.20",
|
||||||
"prettier": "2.7.1",
|
"prettier": "2.7.1",
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleAudits from "./modules/audits";
|
import moduleAudits from "./modules/audits";
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
import { ChannelType } from "discord-api-types/v10";
|
|
||||||
import {
|
import {
|
||||||
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -2,9 +2,9 @@ import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
|
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import checkPermission from "../../../../helpers/checkPermission";
|
import checkPermission from "../../../../helpers/checkPermission";
|
||||||
import getValues from "./components/getValues";
|
import getValues from "./components/getValues";
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import { ChannelType } from "discord-api-types/v10";
|
|
||||||
import {
|
import {
|
||||||
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import Chance from "chance";
|
import Chance from "chance";
|
||||||
import { CommandInteraction } from "discord.js";
|
import { CommandInteraction, SlashCommandSubcommandBuilder } from "discord.js";
|
||||||
|
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleLookup from "./modules/lookup";
|
import moduleLookup from "./modules/lookup";
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
import {
|
||||||
|
ChatInputCommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
import logger from "../../middlewares/logger";
|
import logger from "../../middlewares/logger";
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
import {
|
||||||
|
CommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder
|
||||||
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
import cooldown from "../../../../middlewares/cooldown";
|
import cooldown from "../../../../middlewares/cooldown";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
//Dependencies
|
//Dependencies
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleCounters from "./modules/counters";
|
import moduleCounters from "./modules/counters";
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
ChatInputCommandInteraction,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from "discord.js";
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleAdd from "./modules/add";
|
import moduleAdd from "./modules/add";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import { ChannelType } from "discord-api-types/v10";
|
|
||||||
import {
|
import {
|
||||||
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// Models
|
// Models
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import { ChannelType } from "discord-api-types/v10";
|
|
||||||
import {
|
import {
|
||||||
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||||
|
|
|
@ -1,5 +1,7 @@
|
||||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
ChatInputCommandInteraction,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from "discord.js";
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleGive from "./modules/give";
|
import moduleGive from "./modules/give";
|
||||||
|
|
|
@ -1,11 +1,17 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
// Dependencies
|
||||||
import { ChatInputCommandInteraction, PermissionsBitField } from "discord.js";
|
import {
|
||||||
|
ChatInputCommandInteraction, PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder
|
||||||
|
} from "discord.js";
|
||||||
|
// Configurations
|
||||||
|
// Helpers../../../../../../../helpers/userData
|
||||||
|
import pluralize from "../../../../../../helpers/pluralize";
|
||||||
|
// Models
|
||||||
|
// Handlers
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
import { success as baseEmbedSuccess } from "../../../../../../helpers/baseEmbeds";
|
import { success as baseEmbedSuccess } from "../../../../../../helpers/baseEmbeds";
|
||||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||||
import creditsGive from "../../../../../../helpers/credits/give";
|
import creditsGive from "../../../../../../helpers/credits/give";
|
||||||
import pluralize from "../../../../../../helpers/pluralize";
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
builder: (command: SlashCommandSubcommandBuilder) => {
|
builder: (command: SlashCommandSubcommandBuilder) => {
|
||||||
|
|
|
@ -1,13 +1,14 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import { ButtonStyle, ChannelType } from "discord-api-types/v10";
|
|
||||||
import {
|
import {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
ButtonBuilder,
|
ButtonBuilder,
|
||||||
|
ButtonStyle,
|
||||||
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import encryption from "../../../../../../helpers/encryption";
|
import encryption from "../../../../../../helpers/encryption";
|
||||||
|
|
|
@ -1,7 +1,10 @@
|
||||||
|
// Dependencies
|
||||||
|
// Helpers
|
||||||
|
// Models
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
SlashCommandSubcommandBuilder,
|
SlashCommandSubcommandBuilder
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
|
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,7 +1,9 @@
|
||||||
|
// Dependencies
|
||||||
|
// Models
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
SlashCommandSubcommandBuilder,
|
SlashCommandSubcommandBuilder
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
|
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// Models
|
// Models
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import creditsTransfer from "../../../../../../helpers/credits/transfer";
|
import creditsTransfer from "../../../../../../helpers/credits/transfer";
|
||||||
// Configurations
|
// Configurations
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import modulePrune from "./modules/prune";
|
import modulePrune from "./modules/prune";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChannelType,
|
ChannelType,
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
PermissionsBitField,
|
PermissionsBitField,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import checkPermission from "../../../../helpers/checkPermission";
|
import checkPermission from "../../../../helpers/checkPermission";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleGive from "./modules/give";
|
import moduleGive from "./modules/give";
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
ChatInputCommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder
|
||||||
|
} from "discord.js";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
import logger from "../../../../middlewares/logger";
|
import logger from "../../../../middlewares/logger";
|
||||||
import noSelfReputation from "./components/noSelfReputation";
|
import noSelfReputation from "./components/noSelfReputation";
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
ChatInputCommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
} from "discord.js";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
|
|
|
@ -1,6 +1,5 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleCpgg from "./modules/cpgg";
|
import moduleCpgg from "./modules/cpgg";
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import axios from "axios";
|
import axios from "axios";
|
||||||
import {
|
import {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
|
@ -7,6 +6,7 @@ import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
Message,
|
Message,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
import prisma from "../../../../handlers/database";
|
import prisma from "../../../../handlers/database";
|
||||||
|
|
|
@ -1,6 +1,8 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
ChatInputCommandInteraction,
|
||||||
|
SlashCommandSubcommandGroupBuilder,
|
||||||
|
} from "discord.js";
|
||||||
|
|
||||||
// Handlers
|
// Handlers
|
||||||
|
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// Helpers
|
// Helpers
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
ColorResolvable,
|
ColorResolvable,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
GuildMemberRoleManager,
|
GuildMemberRoleManager,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import deferReply from "../../../../../../handlers/deferReply";
|
import deferReply from "../../../../../../handlers/deferReply";
|
||||||
import getEmbedData from "../../../../../../helpers/getEmbedData";
|
import getEmbedData from "../../../../../../helpers/getEmbedData";
|
||||||
|
|
|
@ -1,10 +1,10 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
// Helpers
|
// Helpers
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ChatInputCommandInteraction,
|
ChatInputCommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
GuildMemberRoleManager,
|
GuildMemberRoleManager,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
// Configurations
|
// Configurations
|
||||||
// Models
|
// Models
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||||
import { ChatInputCommandInteraction } from "discord.js";
|
|
||||||
|
|
||||||
// Modules
|
// Modules
|
||||||
import moduleAbout from "./modules/about";
|
import moduleAbout from "./modules/about";
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
|
||||||
import {
|
import {
|
||||||
ActionRowBuilder,
|
ActionRowBuilder,
|
||||||
ButtonBuilder,
|
ButtonBuilder,
|
||||||
ButtonStyle,
|
ButtonStyle,
|
||||||
CommandInteraction,
|
CommandInteraction,
|
||||||
EmbedBuilder,
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
} from "discord.js";
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
// Configurations
|
// Configurations
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
CommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
// Dependencies
|
// Dependencies
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
CommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
} from "discord.js";
|
||||||
// Configurations
|
// Configurations
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
|
|
|
@ -1,5 +1,8 @@
|
||||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
import {
|
||||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
CommandInteraction,
|
||||||
|
EmbedBuilder,
|
||||||
|
SlashCommandSubcommandBuilder,
|
||||||
|
} from "discord.js";
|
||||||
import deferReply from "../../../../handlers/deferReply";
|
import deferReply from "../../../../handlers/deferReply";
|
||||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||||
|
|
||||||
|
|
38
src/helpers/upsertGuildMember/index.ts
Normal file
38
src/helpers/upsertGuildMember/index.ts
Normal file
|
@ -0,0 +1,38 @@
|
||||||
|
import { GuildMember } from "discord.js";
|
||||||
|
import db from "../../handlers/database";
|
||||||
|
|
||||||
|
export default async (guildMember: GuildMember) => {
|
||||||
|
const { guild, user } = guildMember;
|
||||||
|
|
||||||
|
return await db.guildMember.upsert({
|
||||||
|
where: {
|
||||||
|
userId_guildId: {
|
||||||
|
userId: user.id,
|
||||||
|
guildId: guild.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
update: {},
|
||||||
|
create: {
|
||||||
|
user: {
|
||||||
|
connectOrCreate: {
|
||||||
|
create: {
|
||||||
|
id: user.id,
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
id: user.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
guild: {
|
||||||
|
connectOrCreate: {
|
||||||
|
create: {
|
||||||
|
id: guild.id,
|
||||||
|
},
|
||||||
|
where: {
|
||||||
|
id: guild.id,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
};
|
|
@ -1,4 +1,4 @@
|
||||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
import { SlashCommandBuilder } from "discord.js";
|
||||||
|
|
||||||
export interface ICommand {
|
export interface ICommand {
|
||||||
builder: SlashCommandBuilder;
|
builder: SlashCommandBuilder;
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
import { Snowflake } from "discord.js";
|
|
||||||
import { Document } from "mongoose";
|
|
||||||
|
|
||||||
export interface IShopRole extends Document {
|
|
||||||
guildId: Snowflake;
|
|
||||||
userId: Snowflake;
|
|
||||||
roleId: Snowflake;
|
|
||||||
lastPayed: Date;
|
|
||||||
}
|
|
Loading…
Add table
Reference in a new issue