commit
16d94e82f9
46 changed files with 7051 additions and 13202 deletions
9
.github/workflows/docker-image.yml
vendored
9
.github/workflows/docker-image.yml
vendored
|
@ -1,16 +1,11 @@
|
|||
name: Docker Image CI
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 10 * * *"
|
||||
push:
|
||||
branches:
|
||||
- "**"
|
||||
tags:
|
||||
- "v*.*.*"
|
||||
pull_request:
|
||||
branches:
|
||||
- "main"
|
||||
tags:
|
||||
- "*.*.*"
|
||||
|
||||
jobs:
|
||||
docker:
|
||||
|
|
62
.vscode/extensions.json
vendored
62
.vscode/extensions.json
vendored
|
@ -3,50 +3,30 @@
|
|||
// 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",
|
||||
"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.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",
|
||||
"Vtrois.gitmoji-vscode"
|
||||
"esbenp.prettier-vscode",
|
||||
"wayou.vscode-todo-highlight",
|
||||
"gruntfuggly.todo-tree",
|
||||
"pflannery.vscode-versionlens",
|
||||
"vscode-icons-team.vscode-icons"
|
||||
],
|
||||
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.
|
||||
"unwantedRecommendations": []
|
||||
|
|
66
README.md
66
README.md
|
@ -4,18 +4,62 @@
|
|||
<br>
|
||||
</h1>
|
||||
|
||||
<h3 align=center>A privacy-focused bot built with <a href=https://github.com/discordjs/discord.js>discord.js</a></h3>
|
||||
<h4 align="center"> A multi purpose Discord bot written in Typescript with Discord.js that tries to respects your privacy by making features <b>opt-in</b>.</h4>
|
||||
|
||||
<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)
|
||||
|
||||
</div>
|
||||
<br>
|
||||
|
||||
<p align="center">
|
||||
•
|
||||
<a href="https://xyter.zyner.org">Documentation</a>
|
||||
•
|
||||
<a href="https://discord.zyner.org">
|
||||
<img src="https://img.shields.io/discord/774981996878626847.svg?label=Discord&logo=Discord&colorB=7289da&style=for-the-badge" alt="Support">
|
||||
</a>
|
||||
</p>
|
||||
|
||||
<p align="center">
|
||||
<a href="#overview">Overview</a>
|
||||
•
|
||||
<a href="#installation">Installation</a>
|
||||
•
|
||||
<a href="https://xyter.zyner.org/">Documentation</a>
|
||||
•
|
||||
<a href="#join-the-community">Community</a>
|
||||
•
|
||||
<a href="#license">License</a>
|
||||
</p>
|
||||
|
||||
# Overview
|
||||
|
||||
Xyter is a privacy-focused bot - by making a lot of features opt-in and can easily be enabled/disabled by server owners. We are not and will never be one of those who makes proprietary code and making money out of it, we are happily accepting donations to make Xyter even better. And of course, you can self-host this bot or use our cloud instance if you want. We are happily helping you setting up your own instance and we provide same support regardless of if you self-host it or if we host it.
|
||||
|
||||
[Installation](#installation) is easy, bot is only supported officially when hosted on **Linux**, if you don't have much Linux knowledge we are happy to help you out on our [Discord server](https://discord.zyner.org)! When you have installed the bot you manage settings from within Discord aside from global settings.
|
||||
|
||||
**The default set of modules includes and is not limited to:**
|
||||
|
||||
- Credits (balance,gift,top,work including administrative commands such as give,take,set,transfer)
|
||||
- Counters (allows you to create channels that only allows a specific word to be sent, user needs to wait until someone else has sent before sending it again)
|
||||
- Fun (currently only includes meme)
|
||||
- Shop (allows users to purchase with their credits, custom roles in the discord server and server hosting via [Controlpanel.gg](https://controlpanel.gg) if the server has enabled and is hosting their own hosting solution)
|
||||
- Moderation (currently only includes a prune command, this is because we don't want to implement more damaging commands yet until we have a better solution for permissions)
|
||||
- Reputation (allows users to give each other a reputation anonymously, this is global which means all users will have their reputation shown across all server the bot instance is connected to)
|
||||
|
||||
**Additionally, other [commands](https://xyter.zyner.org/docs/commands) can easily be found on our documentation site.**
|
||||
|
||||
# Installation
|
||||
|
||||
**The following platforms are officially supported:**
|
||||
|
||||
- [Docker](https://xyter.zyner.org/docs/flavors/on-premise/docker)
|
||||
- [Node](https://xyter.zyner.org/docs/flavors/on-premise/node)
|
||||
- [Pterodactyl](https://xyter.zyner.org/docs/flavors/on-premise/pterodactyl)
|
||||
|
||||
If after reading the guide you are still experiencing issues, feel free to join the
|
||||
[Official Discord Server](https://discord.zyner.org) and ask in the **#support** channel for help.
|
||||
|
||||
# Join the community!
|
||||
|
||||
**Xyter** is in continuous development, and is currently still in **beta**!
|
||||
|
||||
Join us on our [Official Discord Server](https://discord.gg/red)!
|
||||
|
||||
# License
|
||||
|
||||
Released under the [GNU GPL v3](https://www.gnu.org/licenses/gpl-3.0.en.html) license.
|
||||
|
|
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"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/rest": "^1.0.0",
|
||||
"@prisma/client": "^4.5.0",
|
||||
"@types/i18next-fs-backend": "^1.1.2",
|
||||
"axios": "^1.0.0",
|
||||
"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",
|
||||
"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",
|
||||
"ts-node": "^10.7.0",
|
||||
"tsconfig-paths": "^4.0.0",
|
||||
"typescript": "^4.8.4",
|
||||
"uuid": "^9.0.0",
|
||||
"winston": "^3.8.2",
|
||||
"winston-daily-rotate-file": "^4.6.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/chance": "1.1.3",
|
||||
"@types/node-schedule": "2.1.0",
|
||||
"@types/uuid": "8.3.4",
|
||||
"@typescript-eslint/eslint-plugin": "5.41.0",
|
||||
"@typescript-eslint/parser": "5.41.0",
|
||||
"eslint": "8.26.0",
|
||||
"eslint-config-airbnb-base": "15.0.0",
|
||||
"@typescript-eslint/eslint-plugin": "^5.42.0",
|
||||
"@typescript-eslint/parser": "^5.42.0",
|
||||
"eslint": "^8.26.0",
|
||||
"eslint-config-prettier": "8.5.0",
|
||||
"eslint-plugin-import": "2.26.0",
|
||||
"eslint-plugin-no-loops": "0.3.0",
|
||||
"eslint-plugin-prettier": "4.2.1",
|
||||
"husky": "8.0.1",
|
||||
"jest": "29.2.2",
|
||||
"lint-staged": "13.0.3",
|
||||
"nodemon": "2.0.20",
|
||||
"prettier": "2.7.1",
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleAudits from "./modules/audits";
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -2,9 +2,9 @@ import {
|
|||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import checkPermission from "../../../../helpers/checkPermission";
|
||||
import getValues from "./components/getValues";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,8 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import Chance from "chance";
|
||||
import { CommandInteraction } from "discord.js";
|
||||
import { CommandInteraction, SlashCommandSubcommandBuilder } from "discord.js";
|
||||
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleLookup from "./modules/lookup";
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import axios from "axios";
|
||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import logger from "../../middlewares/logger";
|
||||
|
||||
// Modules
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import axios from "axios";
|
||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
import cooldown from "../../../../middlewares/cooldown";
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
//Dependencies
|
||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleCounters from "./modules/counters";
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleAdd from "./modules/add";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Dependencies
|
||||
// Models
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||
|
|
|
@ -1,5 +1,7 @@
|
|||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleGive from "./modules/give";
|
||||
|
|
|
@ -1,11 +1,17 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction, PermissionsBitField } from "discord.js";
|
||||
|
||||
// Dependencies
|
||||
import {
|
||||
ChatInputCommandInteraction, PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder
|
||||
} from "discord.js";
|
||||
// Configurations
|
||||
// Helpers../../../../../../../helpers/userData
|
||||
import pluralize from "../../../../../../helpers/pluralize";
|
||||
// Models
|
||||
// Handlers
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
import { success as baseEmbedSuccess } from "../../../../../../helpers/baseEmbeds";
|
||||
import checkPermission from "../../../../../../helpers/checkPermission";
|
||||
import creditsGive from "../../../../../../helpers/credits/give";
|
||||
import pluralize from "../../../../../../helpers/pluralize";
|
||||
|
||||
export default {
|
||||
builder: (command: SlashCommandSubcommandBuilder) => {
|
||||
|
|
|
@ -1,13 +1,14 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import axios from "axios";
|
||||
import { ButtonStyle, ChannelType } from "discord-api-types/v10";
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import encryption from "../../../../../../helpers/encryption";
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
// Dependencies
|
||||
// Helpers
|
||||
// Models
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
SlashCommandSubcommandBuilder
|
||||
} from "discord.js";
|
||||
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,7 +1,9 @@
|
|||
// Dependencies
|
||||
// Models
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
SlashCommandSubcommandBuilder
|
||||
} from "discord.js";
|
||||
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Dependencies
|
||||
// Models
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import creditsTransfer from "../../../../../../helpers/credits/transfer";
|
||||
// Configurations
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import modulePrune from "./modules/prune";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChannelType,
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
PermissionsBitField,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import checkPermission from "../../../../helpers/checkPermission";
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Dependencies
|
||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleGive from "./modules/give";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder
|
||||
} from "discord.js";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
import logger from "../../../../middlewares/logger";
|
||||
import noSelfReputation from "./components/noSelfReputation";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import prisma from "../../../../handlers/database";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
// Dependencies
|
||||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleCpgg from "./modules/cpgg";
|
||||
|
|
|
@ -1,4 +1,3 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import axios from "axios";
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
|
@ -7,6 +6,7 @@ import {
|
|||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
Message,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import { v4 as uuidv4 } from "uuid";
|
||||
import prisma from "../../../../handlers/database";
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandGroupBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
SlashCommandSubcommandGroupBuilder,
|
||||
} from "discord.js";
|
||||
|
||||
// Handlers
|
||||
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Dependencies
|
||||
// Helpers
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
ColorResolvable,
|
||||
EmbedBuilder,
|
||||
GuildMemberRoleManager,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../../../handlers/deferReply";
|
||||
import getEmbedData from "../../../../../../helpers/getEmbedData";
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
// Dependencies
|
||||
// Helpers
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ChatInputCommandInteraction,
|
||||
EmbedBuilder,
|
||||
GuildMemberRoleManager,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
// Configurations
|
||||
// Models
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
import { SlashCommandBuilder } from "@discordjs/builders";
|
||||
import { ChatInputCommandInteraction } from "discord.js";
|
||||
import { ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
|
||||
// Modules
|
||||
import moduleAbout from "./modules/about";
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import {
|
||||
ActionRowBuilder,
|
||||
ButtonBuilder,
|
||||
ButtonStyle,
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
// Configurations
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
// Dependencies
|
||||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
// Configurations
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
import getEmbedConfig from "../../../../helpers/getEmbedData";
|
||||
|
|
|
@ -1,5 +1,8 @@
|
|||
import { SlashCommandSubcommandBuilder } from "@discordjs/builders";
|
||||
import { CommandInteraction, EmbedBuilder } from "discord.js";
|
||||
import {
|
||||
CommandInteraction,
|
||||
EmbedBuilder,
|
||||
SlashCommandSubcommandBuilder,
|
||||
} from "discord.js";
|
||||
import deferReply from "../../../../handlers/deferReply";
|
||||
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 {
|
||||
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