-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: types, imports, strings, remove full removal of sharedmodule
- Loading branch information
1 parent
7ad9d66
commit 5ede6cf
Showing
61 changed files
with
1,877 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
version: "3.8" | ||
|
||
include: | ||
- path: ./Lavalink/docker-compose.yml | ||
env_file: .env | ||
# - path: ./Lavalink/docker-compose.yml | ||
# env_file: .env | ||
- path: ./Database/docker-compose.yml | ||
env_file: .env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 4 additions & 4 deletions
8
src/modules/commands/🛠️ Developer Tools/commands/eval/eval.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,112 @@ | ||
import { Config, ENVIRONMENT } from "./types"; | ||
|
||
export const config = (): Config => ({ | ||
ENVIRONMENT: process.env.ENVIRONMENT as ENVIRONMENT, | ||
Database: { | ||
Version: "Music", | ||
URL: process.env.DATABASE_URL, | ||
Name: process.env.DatabaseName, | ||
Password: process.env.DatabasePassword, | ||
Redis: { | ||
Port: process.env.RedisPort, | ||
Host: process.env.RedisHost, | ||
}, | ||
}, | ||
API: { | ||
JwtSecret: process.env.JWT_SECRET, | ||
JwtExpire: "1d", | ||
CookieSecret: process.env.COOKIE_SECRET, | ||
MaxAge: 86400, // 1 day in seconds | ||
}, | ||
TopGGToken: process.env.TopGGToken, | ||
FallbackLocale: "pt-BR", | ||
Discord: { | ||
Token: process.env.Token, | ||
DevToken: process.env.DevToken, | ||
Client: { | ||
Owners: ["330047048009252864"], | ||
Secret: process.env.ClientSecret, | ||
ID: "708822043420000366", | ||
CallbackURL: process.env.CallbackURL, | ||
}, | ||
Servers: { | ||
NDCommunity: "679066351456878633", | ||
TestGuild: "717094267243462688", | ||
}, | ||
}, | ||
Debug: { | ||
Client: true, | ||
Translations: false, | ||
Lavalink: false, | ||
PremiumMusicPlayer: false, | ||
}, | ||
Music: { | ||
Lavalink: true, | ||
Volumes: { | ||
Lavalink: 0.75, | ||
Player: 50, | ||
}, | ||
Player: { | ||
AutoLeaveEmpty: { | ||
Channel: { | ||
Enable: true, | ||
Delay: 60000, | ||
}, | ||
Queue: { | ||
Enable: true, | ||
Delay: 30000, | ||
}, | ||
}, | ||
}, | ||
Client: { | ||
selfDeaf: true, | ||
serverDeaf: true, | ||
}, | ||
}, | ||
Emojis: { | ||
logo: "<:NDB:763741625079300117>", | ||
fail: "<:NotixDeny:719560576015138830>", | ||
accept: "<:NotixAllow:719560623960096789>", | ||
success: "<:NotixAllow:719560623960096789>", | ||
thing: "<a:OPensador:718195925327151134>", | ||
loading: "<a:Carregando:718196232757182566>", | ||
loading2: "<a:Carregando2:718196278646800424>", | ||
delayping: "<:DelayPing:718196166399098901>", | ||
Music: { | ||
Youtube: "<:youtube:730741995416453150>", | ||
Spotify: "<:Spotify:775154334832001044>", | ||
SoundCloud: "<:soundcloud:932065538014842950>", | ||
Deezer: "<:deezer:932065971336802334>", | ||
Facebook: "<:facebook:932066080996864070>", | ||
Apple: "<:Apple:852677662983716884>", | ||
Twitch: "<:twitch:998725252098052197>", | ||
}, | ||
}, | ||
URLList: { | ||
Music: { | ||
Youtube: "https://www.youtube.com", | ||
ShortYoutube: "https://youtu.be", | ||
SoundCloud: "https://soundcloud.com", | ||
Spotify: "https://open.spotify.com", | ||
Deezer: "https://www.deezer", | ||
Facebook: "https://facebook.com", | ||
Apple: "https://music.apple.com/", | ||
Twitch: "https://www.twitch.tv/", | ||
}, | ||
}, | ||
EvalBadKeys: [ | ||
"client.token", | ||
"client.destroy", | ||
"process.env.Token", | ||
"process.env.DevToken", | ||
"process.env.DATABASE_URL", | ||
"process.env.DatabaseName", | ||
"process.env.DatabasePassword", | ||
"process.env.RedisPort", | ||
"process.env.RedisHost", | ||
"process.env.LavalinkHOST", | ||
"process.env.LavalinkPassword", | ||
"process.env.SpotifyClientId", | ||
"process.env.SpotifyClientSecret", | ||
], | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import fs from "node:fs"; | ||
import path from "node:path"; | ||
|
||
export class JSONLocaleLoader { | ||
public constructor(private readonly path: string) {} | ||
|
||
public async loadTranslations() { | ||
const locales: Record<string, Record<string, string>> = {}; | ||
const folders = fs.readdirSync(this.path); | ||
|
||
for (const langFolder of folders) { | ||
const langPath = path.join(this.path, langFolder); | ||
const namespaces = fs.readdirSync(langPath); | ||
const langData = {}; | ||
|
||
for (const namespace of namespaces) { | ||
const namespacePath = path.join(langPath, namespace); | ||
const files = fs.readdirSync(namespacePath); | ||
const namespaceData = {}; | ||
|
||
for (const file of files) { | ||
const filePath = path.join(namespacePath, file); | ||
const jsonContent = fs.readFileSync(filePath, "utf-8"); | ||
const jsonData = JSON.parse(jsonContent); | ||
namespaceData[file.replace(".json", "")] = jsonData; | ||
} | ||
|
||
langData[namespace] = namespaceData; | ||
} | ||
|
||
locales[langFolder] = langData; | ||
} | ||
return locales; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { Injectable } from "@nestjs/common"; | ||
import type { ConfigService } from "@nestjs/config"; | ||
import { GatewayIntentBits, GatewayVersion, Options, Partials } from "discord.js"; | ||
import type { NecordModuleOptions } from "necord"; | ||
import { Config } from "./types"; | ||
|
||
@Injectable() | ||
export class NecordConfigService { | ||
public constructor(private readonly config: ConfigService) {} | ||
|
||
createNecordOptions(): NecordModuleOptions { | ||
return { | ||
token: this.config.getOrThrow<Config["Discord"]>("Discord").Token, | ||
skipRegistration: false, | ||
shards: "auto", | ||
rest: { | ||
version: GatewayVersion, | ||
offset: 0, | ||
api: "https://discord.com/api/", | ||
cdn: "https://cdn.discordapp.com", | ||
}, | ||
failIfNotExists: true, | ||
allowedMentions: { | ||
parse: ["roles", "users"], | ||
repliedUser: false, | ||
}, | ||
makeCache: Options.cacheEverything(), | ||
partials: [ | ||
Partials.Channel, | ||
Partials.GuildMember, | ||
Partials.GuildScheduledEvent, | ||
Partials.Message, | ||
Partials.Reaction, | ||
Partials.ThreadMember, | ||
Partials.User, | ||
], | ||
intents: [ | ||
GatewayIntentBits.DirectMessageReactions, | ||
GatewayIntentBits.DirectMessageTyping, | ||
GatewayIntentBits.DirectMessages, | ||
GatewayIntentBits.GuildModeration, | ||
GatewayIntentBits.GuildEmojisAndStickers, | ||
GatewayIntentBits.GuildIntegrations, | ||
GatewayIntentBits.GuildInvites, | ||
GatewayIntentBits.GuildMembers, | ||
GatewayIntentBits.GuildMessageReactions, | ||
GatewayIntentBits.GuildMessageTyping, | ||
GatewayIntentBits.GuildMessages, | ||
GatewayIntentBits.GuildPresences, | ||
GatewayIntentBits.GuildScheduledEvents, | ||
GatewayIntentBits.GuildVoiceStates, | ||
GatewayIntentBits.GuildWebhooks, | ||
GatewayIntentBits.Guilds, | ||
GatewayIntentBits.MessageContent, | ||
GatewayIntentBits.AutoModerationConfiguration, | ||
GatewayIntentBits.AutoModerationExecution, | ||
], | ||
} as never; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
export * from "./Config"; | ||
export * from "./JSONLocale.loader"; | ||
export * from "./NecordConfig.service"; |
Oops, something went wrong.