Skip to content

Commit

Permalink
fix(music): incorrect imports
Browse files Browse the repository at this point in the history
  • Loading branch information
NedcloarBR committed May 18, 2024
1 parent 525af2c commit ce2a533
Show file tree
Hide file tree
Showing 16 changed files with 65 additions and 64 deletions.
2 changes: 1 addition & 1 deletion Database
Submodule Database updated 1 files
+10 −0 docker-compose.yml
2 changes: 1 addition & 1 deletion Lavalink
Submodule Lavalink updated 2 files
+1 −1 Dockerfile
+1 −1 docker-compose.yml
4 changes: 2 additions & 2 deletions docker-compose.dev.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
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

Expand Down
6 changes: 4 additions & 2 deletions src/modules/core/NDB.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,10 @@ import { JSONLocaleLoader, NecordConfigService, config } from "../config";
import type { Config } from "../config/types";
import { DatabaseModule } from "../database/database.module";
import { EventsModule } from "../events/Events.module";
import { MusicModule } from "../music";
import { ReactionRolesModule } from "../reactionRoles/ReactionRoles.module";
import { NDBServiceProvider } from "./provider/NDBService.provider";
import { ScheduleModule } from "../schedule/schedule.module";
import { NDBServiceProvider } from "./provider/NDBService.provider";

@Module({
imports: [
Expand Down Expand Up @@ -41,7 +42,8 @@ import { ScheduleModule } from "../schedule/schedule.module";
load: [config],
}),
DatabaseModule,
ScheduleModule,
ScheduleModule,
MusicModule,
CommandsModule,
ComponentsModule,
EventsModule,
Expand Down
30 changes: 15 additions & 15 deletions src/modules/music/Music.embeds.ts
Original file line number Diff line number Diff line change
@@ -1,26 +1,26 @@
import type { Config } from "@/modules/config/types";
import { Timer } from "@/utils/Tools";
import {
LOCALIZATION_ADAPTER,
type NestedLocalizationAdapter,
LOCALIZATION_ADAPTER,
NestedLocalizationAdapter,
} from "@necord/localization";
import { Inject, Injectable } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import {
EmbedBuilder,
channelMention,
type Client,
type ColorResolvable,
type CommandInteraction,
type Guild,
type TextChannel,
type User,
type VoiceChannel
EmbedBuilder,
channelMention,
Client,
type ColorResolvable,
type CommandInteraction,
type Guild,
type TextChannel,
type User,
type VoiceChannel
} from "discord.js";
import {
type Player,
type SearchResult,
type Track
type Player,
type SearchResult,
type Track
} from "lavalink-client";
import type { IMusicEmbeds } from "./interfaces";

Expand Down
6 changes: 3 additions & 3 deletions src/modules/music/Music.manager.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, type OnModuleInit } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import type { EventEmitter2 } from "@nestjs/event-emitter";
import type { Client } from "discord.js";
import { ConfigService } from "@nestjs/config";
import { EventEmitter2 } from "@nestjs/event-emitter";
import { Client } from "discord.js";
import { CommonManager } from "./classes/CommonManager";
import "./classes/ExtendedPlayer";
import { PremiumManager } from "./classes/PremiumManager";
Expand Down
16 changes: 8 additions & 8 deletions src/modules/music/Music.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@ import type { Config } from "@/modules/config/types";
import type { IDatabaseService } from "@/modules/database/interfaces/IDatabaseService";
import { Services } from "@/types/Constants";
import {
LOCALIZATION_ADAPTER,
type NestedLocalizationAdapter,
LOCALIZATION_ADAPTER,
NestedLocalizationAdapter,
} from "@necord/localization";
import { Inject, Injectable } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import {
channelMention,
type CommandInteraction,
type GuildMember,
type VoiceChannel,
channelMention,
type CommandInteraction,
type GuildMember,
type VoiceChannel,
} from "discord.js";
import type { Player, PlayerOptions, SourceNames } from "lavalink-client";
import moment from "moment";
Expand All @@ -32,7 +32,7 @@ export class MusicService implements IMusicService {
) {}

public async getPlayer(interaction: CommandInteraction): Promise<Player> {
if (this.getPremium(interaction.guildId)) {
if (await this.getPremium(interaction.guildId)) {
return this.MusicManager.premium.getPlayer(interaction.guildId);
}

Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/classes/BaseManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export class BaseManager extends LavalinkManager {
id: "localhost",
host: process.env.LavalinkHOST,
port: 2333,
authorization: process.env.LavalinkPassword,
authorization: process.env.LAVALINK_SERVER_PASSWORD,
retryAmount: 22,
retryDelay: 5000,
},
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/classes/RedisClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Redis } from "ioredis";
export class RedisClient extends Redis {
public constructor() {
super({
port: process.env.RedisPort as unknown as number,
port: Number(process.env.RedisPort),
host: process.env.RedisHost,
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/events/Channel.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import type { IDatabaseService } from "@/modules/database/interfaces/IDatabaseSe
import { Services } from "@/types/Constants";
import { LOCALIZATION_ADAPTER, type NestedLocalizationAdapter } from "@necord/localization";
import { Inject, Injectable, Logger } from "@nestjs/common";
import { ChannelType, type Client, type TextChannel } from "discord.js";
import { ChannelType, Client, type TextChannel } from "discord.js";
import { Context, On, type ContextOf } from "necord";
import { Music } from "..";
import { MessageTools } from "../../commands/Message";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/events/Guild.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IDatabaseService } from "@/modules/database/interfaces/IDatabaseService";
import { Services } from "@/types/Constants";
import { Inject, Injectable } from "@nestjs/common";
import type { Client } from "discord.js";
import { Client } from "discord.js";
import { Context, On, type ContextOf } from "necord";
import type { IMusicService } from "../interfaces";
import { Music } from "../types/constants";
Expand Down
2 changes: 1 addition & 1 deletion src/modules/music/events/Node.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Config } from "@/modules/config/types";
import { Injectable, Logger } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import { OnEvent } from "@nestjs/event-emitter";
import type { LavalinkNode } from "lavalink-client";

Expand Down
6 changes: 3 additions & 3 deletions src/modules/music/events/Player.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { Config } from "@/modules/config/types";
import { Inject, Injectable, Logger } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import { OnEvent } from "@nestjs/event-emitter";
import type { Client, Guild, TextChannel, VoiceChannel } from "discord.js";
import { Client, Guild, TextChannel, VoiceChannel } from "discord.js";
import type { Player } from "lavalink-client";
import { Music } from "..";
import { MessageTools } from "../../commands/Message";
Expand All @@ -20,7 +20,7 @@ export class PlayerEvents {

@OnEvent("player.create")
public async onPlayerCreate(player: Player): Promise<void> {
const guild = (await this.client.guilds.fetch(player.guildId)) as Guild;
const guild = (await this.client.guilds.fetch(player.guildId));
this.logger.log(`Player iniciando no servidor: ${guild.name}(${guild.id})`);
const textChannel = this.client.channels.cache.get(player.textChannelId) as TextChannel;
const voiceChannel = this.client.channels.cache.get(player.voiceChannelId) as VoiceChannel;
Expand Down
24 changes: 12 additions & 12 deletions src/modules/music/events/Queue.ts
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
import type { Config } from "@/modules/config/types";
import {
LOCALIZATION_ADAPTER,
type NestedLocalizationAdapter,
LOCALIZATION_ADAPTER,
NestedLocalizationAdapter,
} from "@necord/localization";
import { Inject, Injectable, Logger } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import { OnEvent } from "@nestjs/event-emitter";
import {
EmbedBuilder,
type Client,
type TextChannel,
type VoiceChannel,
EmbedBuilder,
Client,
type TextChannel,
type VoiceChannel,
} from "discord.js";
import type {
Player,
Track,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
Player,
Track,
TrackEndEvent,
TrackExceptionEvent,
TrackStuckEvent,
} from "lavalink-client";
import ms from "parse-ms";
import { MessageTools } from "../../commands/Message";
Expand Down
7 changes: 3 additions & 4 deletions src/modules/music/events/Track.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import { Timer, WAIT } from "@/utils/Tools";
import {
LOCALIZATION_ADAPTER,
type NestedLocalizationAdapter,
NestedLocalizationAdapter,
} from "@necord/localization";
import { Inject, Injectable, Logger } from "@nestjs/common";
import { OnEvent } from "@nestjs/event-emitter";
import {
type Client,
type GuildMember,
Client,
type Message,
type TextChannel
} from "discord.js";
Expand Down Expand Up @@ -46,7 +45,7 @@ export class TrackEvents {
const Requester = (
(await (
await this.client.guilds.fetch(player.guildId)
).members.fetch(track.requester as string)) as GuildMember
).members.fetch(track.requester as string))
).user;

await WAIT(500);
Expand Down
16 changes: 8 additions & 8 deletions src/modules/music/events/Voice.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@ import type { Config } from "@/modules/config/types";
import type { IDatabaseService } from "@/modules/database/interfaces/IDatabaseService";
import { Services } from "@/types/Constants";
import {
LOCALIZATION_ADAPTER,
type NestedLocalizationAdapter,
LOCALIZATION_ADAPTER,
NestedLocalizationAdapter,
} from "@necord/localization";
import { Inject, Logger } from "@nestjs/common";
import type { ConfigService } from "@nestjs/config";
import { ConfigService } from "@nestjs/config";
import {
ChannelType,
EmbedBuilder,
type Client,
type TextChannel,
type VoiceChannel,
ChannelType,
EmbedBuilder,
Client,
type TextChannel,
type VoiceChannel,
} from "discord.js";
import { Context, On, type ContextOf } from "necord";
import { Music } from "..";
Expand Down

0 comments on commit ce2a533

Please sign in to comment.