Skip to content

W-Wewwite e-evewything with Typescript UwU #16

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
40b6d91
W-Wewwite e-evewything with Typescript UwU
vitoUwu Dec 15, 2024
a19d84d
feat: implement delete server & fix check members max content length
vitoUwu Dec 20, 2024
987ab18
chore: bump eslint version
vitoUwu Dec 21, 2024
1cd4bc8
chore: lint & fmt
vitoUwu Dec 21, 2024
20c7d0d
fix: eslint and check errors
vitoUwu Dec 24, 2024
e904947
fix: possible access property of undefined error
vitoUwu Dec 24, 2024
70ea0e1
fix: remove the possibility to add bots to staffs
vitoUwu Dec 24, 2024
78dbb55
W-Wewwite e-evewything with Typescript UwU 2
vitoUwu Dec 25, 2024
4ef8661
refactor: revert this bullshit
vitoUwu Dec 29, 2024
be8ca4f
fix: packages vulnerability
vitoUwu Dec 29, 2024
156c9b4
refactor: autocompletes and modals
vitoUwu Dec 29, 2024
8176eea
refactor: lint and fmt
vitoUwu Dec 29, 2024
cba7445
fix: linter errors
vitoUwu Dec 29, 2024
f9e5386
refactor: get my life easier
vitoUwu Dec 29, 2024
a3ae597
refactor: files casing
vitoUwu Dec 29, 2024
c38625d
refactor: standardize button creation and enhance documentation acros…
vitoUwu Dec 29, 2024
f8489c9
refactor: treat context as command
vitoUwu Dec 30, 2024
0a1ca18
fix: button interaction
vitoUwu Dec 30, 2024
777cca7
fix: missing ephemeral flag
vitoUwu Dec 30, 2024
9cf2583
fix: embed transparent color
vitoUwu Dec 31, 2024
dfc94c1
fix: windows path
vitoUwu Dec 31, 2024
475b3a6
feat: throw snowball commands
vitoUwu Dec 31, 2024
67b1534
feat: allow partnered servers to bypass 5k members requirement
vitoUwu Jan 4, 2025
ab623b8
chore: format code
vitoUwu Jan 4, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
MONGOURL=
DISCORD_TOKEN=
OFFTOPIC_WEBHOOK=
47 changes: 41 additions & 6 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
# Taken from https://github.com/github/gitignore/blob/main/Node.gitignore
# and added custom ignores

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
Expand Down Expand Up @@ -41,8 +45,8 @@ build/Release
node_modules/
jspm_packages/

# TypeScript v1 declaration files
typings/
# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo
Expand All @@ -53,6 +57,9 @@ typings/
# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
Expand All @@ -68,29 +75,41 @@ typings/
# Yarn Integrity file
.yarn-integrity

# dotenv environment variables file
# dotenv environment variable files
.env
.env.test
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and *not* Next.js
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

Expand All @@ -102,4 +121,20 @@ dist

# TernJS port file
.tern-port
.vscode

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# custom added ignores below
bundle
dist
node_modules
TODO
.envrc
141 changes: 141 additions & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
# Taken from https://github.com/github/gitignore/blob/main/Node.gitignore
# and added custom ignores

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
lerna-debug.log*
.pnpm-debug.log*

# Diagnostic reports (https://nodejs.org/api/report.html)
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json

# Runtime data
pids
*.pid
*.seed
*.pid.lock

# Directory for instrumented libs generated by jscoverage/JSCover
lib-cov

# Coverage directory used by tools like istanbul
coverage
*.lcov

# nyc test coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt

# Bower dependency directory (https://bower.io/)
bower_components

# node-waf configuration
.lock-wscript

# Compiled binary addons (https://nodejs.org/api/addons.html)
build/Release

# Dependency directories
node_modules/
jspm_packages/

# Snowpack dependency directory (https://snowpack.dev/)
web_modules/

# TypeScript cache
*.tsbuildinfo

# Optional npm cache directory
.npm

# Optional eslint cache
.eslintcache

# Optional stylelint cache
.stylelintcache

# Microbundle cache
.rpt2_cache/
.rts2_cache_cjs/
.rts2_cache_es/
.rts2_cache_umd/

# Optional REPL history
.node_repl_history

# Output of 'npm pack'
*.tgz

# Yarn Integrity file
.yarn-integrity

# dotenv environment variable files
.env
.env.development.local
.env.test.local
.env.production.local
.env.local

# parcel-bundler cache (https://parceljs.org/)
.cache
.parcel-cache

# Next.js build output
.next
out

# Nuxt.js build / generate output
.nuxt
dist

# Gatsby files
.cache/
# Comment in the public line in if your project uses Gatsby and not Next.js
# https://nextjs.org/blog/next-9-1#public-directory-support
# public

# vuepress build output
.vuepress/dist

# vuepress v2.x temp and cache directory
.temp
.cache

# Docusaurus cache and generated files
.docusaurus

# Serverless directories
.serverless/

# FuseBox cache
.fusebox/

# DynamoDB Local files
.dynamodb/

# TernJS port file
.tern-port

# Stores VSCode versions used for testing VSCode extensions
.vscode-test

# yarn v2
.yarn/cache
.yarn/unplugged
.yarn/build-state.yml
.yarn/install-state.gz
.pnp.*

# custom added ignores below
bundle
dist
node_modules
TODO
# prettierignore specific
.yarn
64 changes: 40 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

# Agent

> Agent é um bot privado, desenvolvido com Nodejs e Discord.js, com o propósito de automatizar tarefas dentro de um servidor de Discord chamado ["Elite Penguin Force"](https://discord.gg/epf). O servidor reúne administradores, moderadores e desenvolvedores de grandes servidores brasileiros, juntos, formamos uma comunidade onde compartilhamos experiências de administração, ferramentas, metodologias, serviços e muito mais.
Expand Down Expand Up @@ -35,32 +34,49 @@ MONGOURL=''
OFFTOPIC_WEBHOOK=''
```

É importante também configurar o arquivo que está localizado no caminho `src/config.js`, caso contrário sua aplicação irá crashar instantâneamente.
É importante também configurar o arquivo que está localizado no caminho `src/config.ts`, caso contrário sua aplicação irá crashar instantâneamente.

```js
module.exports = {
devID: "", // ID para cargo de desenvolvedor
master: "", // ID do cargo de Penguin Master
guard: "", // ID do cargo de Penguin Guard
agent: "", // ID do Bot
guild: "", // ID do servidor
aproveChannel: '', // ID do canal onde será enviado os formulários que serão aprovados
formChannel: '', // ID do canal onde será enviado o botão para fazer os formulários
levels: ['', '', ''], // IDs dos cargos de Moderador, Administrador e Dono, respectivamente
logs: '', // ID do canal de log
membersForRole: 5, // Quantidade mínima de membros registrados em uma staff para ser criado o cargo do servidor
serversChannel: '', // ID do canal onde serão enviados as embeds contendo todos os servidores registrados
formChannelData: {
developerFormEmoji: '', // Emoji do botão de formulário de desenvolvedor
guildFormEmoji: '', // Emoji do botão de formulário de novo servidor
developerFormBanner: '', // Url do banner da embed do formulário de devenvolvedor
guildFormBanner: '', // Url do banner da embed do formulário de servidor
developerFormColor: 0xE18002, // Cor do embed de formulário de desenvolvedor
guildFormColor: 0x66f392, // Cor do embed de formulário de novo servidor
export default {
ids: {
devs: ["...", "..."], // Id dos desenvolvedores do bot
roles: {
dev: "...", // Id do cargo de desenvolvedor
master: "...", // Id do cargo de master
guard: "...", // Id do cargo de guard
mod: "...", // Id do cargo de mod
admin: "...", // Id do cargo de admin
owner: "...", // Id do cargo de owner
guildsDiv: "...", // Id do cargo divisor entre cargos de servidor e os demais cargos
guest: "...", // Id do cargo de guest
},
channels: {
approve: "...", // Id do canal de aprovação
serversList: "...", // Id do canal de lista de servidores
suggestions: "...", // Id do canal de sugestões
changeLog: "...", // Id do canal de logs
},
agent: "...", // Id do agent
guild: "...", // Id do servidor
tags: {
pending: "...", // Id da tag de sugestões pendentes
},
},
minMembersToCreateGuildRole: 5, // Quantidade mínima de membros minimos para criar o cargo de servidor
forms: {
dev: {
channelId: "...", // Id do canal de formulário de desenvolvedor
emoji: "...", // Emoji do formulário de desenvolvedor
bannerURL: "...", // URL do banner do formulário de desenvolvedor
color: 0xe18002, // Cor do formulário de desenvolvedor
},
guild: {
channelId: "...", // Id do canal de formulário de servidor
emoji: "...", // Emoji do formulário de servidor
bannerURL: "...", // URL do banner do formulário de servidor
color: 0x66f392, // Cor do formulário de servidor
},
serversDivRole: '', // Id do cargo imediatamente abaixo dos cargos de servidores
suggestionsChannel: '', // Id do canal de sugestões
pendingTag: '', // Id da tag de sugestão pendente
},
};
```

Expand Down
49 changes: 49 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
import tsPlugin from "@typescript-eslint/eslint-plugin";
import tsParser from "@typescript-eslint/parser";

export default [
{
files: ["**/*.ts"],
plugins: {
"@typescript-eslint": tsPlugin,
},
languageOptions: {
parser: tsParser,
ecmaVersion: 5,
sourceType: "script",
parserOptions: {
project: true,
tsconfigRootDir: "./",
},
},
ignores: [
"node_modules",
"dist",
"logs",
"*.log",
"*.tsbuildinfo",
".env",
".env.*",
],
rules: {
...tsPlugin.configs.recommended.rules,
"no-cond-assign": ["error", "always"],
eqeqeq: ["error"],
"no-constant-binary-expression": "error",
curly: "error",
"default-case": "error",
"default-case-last": "error",
"no-constant-condition": "error",
"no-duplicate-imports": "error",
"no-fallthrough": "error",
"use-isnan": "error",
"no-loss-of-precision": "error",
"no-promise-executor-return": "error",
"no-useless-escape": "error",
"prefer-object-spread": "error",
"prefer-spread": "error",
"no-empty": "error",
"no-useless-catch": "error",
},
},
];
Loading