Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
cb52ee1b59 | ||
|
|
6a3245f8de |
No files matched your search
+2
-1
@@ -1 +1,2 @@
|
||||
node_modules
|
||||
node_modules
|
||||
Procfile
|
||||
+31
-32
@@ -5,48 +5,47 @@ name: CI/CD
|
||||
|
||||
on:
|
||||
push:
|
||||
tags:
|
||||
- '*'
|
||||
tags:
|
||||
- "*"
|
||||
|
||||
jobs:
|
||||
build:
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
strategy:
|
||||
matrix:
|
||||
node-version: [16.x]
|
||||
node-version: [18.x]
|
||||
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: 'npm'
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
- uses: actions/checkout@v3
|
||||
- name: Use Node.js ${{ matrix.node-version }}
|
||||
uses: actions/setup-node@v3
|
||||
with:
|
||||
node-version: ${{ matrix.node-version }}
|
||||
cache: "npm"
|
||||
- run: npm ci
|
||||
- run: npm run build --if-present
|
||||
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
- name: Check out the repo
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
images: unknowableshade/quetza-bot
|
||||
- name: Log in to Docker Hub
|
||||
uses: docker/login-action@f054a8b539a109f9f41c372932f1ae047eff08c9
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@98669ae865ea3cffbcbaa878cf57c20bbf1c6c38
|
||||
with:
|
||||
images: unknowableshade/quetza-bot
|
||||
|
||||
- name: Build and push Docker image
|
||||
uses: docker/build-push-action@ad44023a93711e3deb337508980b4b5e9bcdc5dc
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
+6
-6
@@ -1,9 +1,10 @@
|
||||
FROM node:16
|
||||
|
||||
RUN apt -y update
|
||||
RUN apt install -y ffmpeg
|
||||
RUN apt install -y python3-pip
|
||||
FROM node:18-alpine
|
||||
|
||||
RUN apk update
|
||||
RUN apk add --no-cache bash
|
||||
RUN apk add --no-cache curl
|
||||
RUN apk add --no-cache ffmpeg
|
||||
RUN apk add --no-cache python3
|
||||
|
||||
WORKDIR /usr/src/app
|
||||
|
||||
@@ -11,7 +12,6 @@ RUN mkdir bin
|
||||
RUN curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/src/app/bin/youtube-dl
|
||||
RUN chmod a+rx /usr/src/app/bin/youtube-dl
|
||||
|
||||
|
||||
COPY package*.json ./
|
||||
RUN npm ci
|
||||
|
||||
|
||||
@@ -1,16 +1,16 @@
|
||||
# Quetza - 2210.1 <soundrewrite>
|
||||
# Quetza - 2302.1 <soundrewrite>
|
||||
|
||||
_Neat typescript discord bot._
|
||||
|
||||
## About
|
||||
|
||||
- Base player features.
|
||||
- Play music from YouTube and many other sites.
|
||||
- Lots of different filters _(nightcore, earrape etc.)_.
|
||||
- Slash commands.
|
||||
- Base player features.
|
||||
- Play music from YouTube and many other sites.
|
||||
- Lots of different filters _(nightcore, earrape etc.)_.
|
||||
- Slash commands.
|
||||
|
||||
## Links
|
||||
|
||||
- **[Dependencies](https://github.com/unknowableshade/quetza-bot/blob/master/package.json)**
|
||||
- **[Docker](https://hub.docker.com/repository/docker/unknowableshade/quetza-bot)**
|
||||
- **[Licence](https://github.com/unknowableshade/5a0b-bot/blob/master/LICENSE)**
|
||||
- **[Dependencies](https://github.com/unknowableshade/quetza-bot/blob/master/package.json)**
|
||||
- **[Docker](https://hub.docker.com/repository/docker/unknowableshade/quetza-bot)**
|
||||
- **[Licence](https://github.com/unknowableshade/5a0b-bot/blob/master/LICENSE)**
|
||||
Generated
+2396
-3976
File diff suppressed because it is too large.
Load diff
+44
-42
@@ -1,44 +1,46 @@
|
||||
{
|
||||
"name": "quetza-bot",
|
||||
"engines": {
|
||||
"node": "16.x.x",
|
||||
"npm": "*"
|
||||
},
|
||||
"version": "2205.3.0",
|
||||
"description": "Discord multifunctional bot",
|
||||
"author": {
|
||||
"name": "unknowableshade",
|
||||
"email": "60275123+unknowableshade@users.noreply.github.com",
|
||||
"url": "https://unknowableshade.ru"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/unknowableshade/quetza-bot.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/unknowableshade/quetza-bot/issues"
|
||||
},
|
||||
"readme": "https://github.com/unknowableshade/quetza-bot#readme",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"start": "node dist/index.js",
|
||||
"build": "tsc --build",
|
||||
"clean": "tsc --build --clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.8.0",
|
||||
"@discordjs/voice": "^0.11.0",
|
||||
"discord-ytdl-core": "^5.0.4",
|
||||
"discord.js": "^14.3.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ytdl-core": "^4.11.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.7.13",
|
||||
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
||||
"@typescript-eslint/parser": "^5.35.1",
|
||||
"eslint": "^8.22.0",
|
||||
"typescript": "^4.8.2"
|
||||
}
|
||||
"name": "quetza-bot",
|
||||
"engines": {
|
||||
"node": "18.x.x",
|
||||
"npm": "*"
|
||||
},
|
||||
"type": "module",
|
||||
"version": "2302.1.0",
|
||||
"description": "Discord multifunctional bot",
|
||||
"author": {
|
||||
"name": "unknowableshade",
|
||||
"email": "60275123+unknowableshade@users.noreply.github.com",
|
||||
"url": "https://unknowableshade.ru"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/unknowableshade/quetza-bot.git"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/unknowableshade/quetza-bot/issues"
|
||||
},
|
||||
"readme": "https://github.com/unknowableshade/quetza-bot#readme",
|
||||
"license": "MIT",
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"poststart": "npm run build",
|
||||
"start": "node dist/index.js",
|
||||
"build": "tsc --build",
|
||||
"clean": "tsc --build --clean"
|
||||
},
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.8.0",
|
||||
"@discordjs/voice": "^0.11.0",
|
||||
"discord-ytdl-core": "^5.0.4",
|
||||
"discord.js": "^14.3.0",
|
||||
"tweetnacl": "^1.0.3",
|
||||
"ytdl-core": "^4.11.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.7.13",
|
||||
"@typescript-eslint/eslint-plugin": "^5.35.1",
|
||||
"@typescript-eslint/parser": "^5.35.1",
|
||||
"eslint": "^8.22.0",
|
||||
"typescript": "^4.8.2"
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,12 @@
|
||||
import Client from "../lib/Client";
|
||||
import Client from "../lib/Client.js";
|
||||
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import Client from "../lib/Client";
|
||||
import Client from "../lib/Client.js";
|
||||
|
||||
import { CommandInteraction, GuildMember, SlashCommandBuilder } from "discord.js";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, GuildMember, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel || !ctx.member) return;
|
||||
@@ -9,8 +9,8 @@ export async function run(client: Client, ctx: CommandInteraction) {
|
||||
await ctx.deferReply();
|
||||
|
||||
const player =
|
||||
client.modules.music.get(ctx.guild.id, ctx.channel) ||
|
||||
client.modules.music.set(ctx.guild, ctx.channel);
|
||||
client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel) ||
|
||||
client.modules.music.set(ctx.guild, ctx.channel as TextChannel);
|
||||
|
||||
if (!player.Connection) {
|
||||
const channel = (ctx.member as GuildMember).voice.channel;
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const filter = ctx.options.get("filter")?.value as string;
|
||||
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import Client from "../lib/Client";
|
||||
import Client from "../lib/Client.js";
|
||||
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel || !ctx.member) return;
|
||||
|
||||
await ctx.deferReply();
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
await ctx.editReply({ embeds: [I18n.en.playerInfo(player)] });
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const pos = ctx.options.get("position")?.value as number;
|
||||
@@ -8,7 +8,7 @@ export async function run(client: Client, ctx: CommandInteraction) {
|
||||
|
||||
if (!ctx.guild || !query || !pos || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const query = ctx.options.get("query")?.value as string;
|
||||
|
||||
if (!ctx.guild || !query || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,14 +1,14 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import { loopOption } from "../lib/Types";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import { loopOption } from "../lib/Types.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const query = ctx.options.get("option")?.value as string;
|
||||
|
||||
if (!ctx.guild || !query || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const start = Date.now();
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import { run as connect } from "./connect";
|
||||
import I18n from "../lib/I18n";
|
||||
import Client from "../lib/Client.js";
|
||||
import { run as connect } from "./connect.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const query = ctx.options.get("query")?.value as string;
|
||||
|
||||
@@ -6,16 +6,17 @@ import {
|
||||
CommandInteraction,
|
||||
Message,
|
||||
MessageActionRowComponentBuilder,
|
||||
SlashCommandBuilder
|
||||
SlashCommandBuilder,
|
||||
TextChannel
|
||||
} from "discord.js";
|
||||
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const query = ctx.options.get("query")?.value as string;
|
||||
|
||||
if (!ctx.guild || !query || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const hours = ctx.options.get("hrs")?.value as number || 0;
|
||||
@@ -9,7 +9,7 @@ export async function run(client: Client, ctx: CommandInteraction) {
|
||||
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { CommandInteraction, SlashCommandBuilder } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import I18n from "../lib/I18n";
|
||||
import { CommandInteraction, SlashCommandBuilder, TextChannel } from "discord.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import I18n from "../lib/I18n.js";
|
||||
|
||||
export async function run(client: Client, ctx: CommandInteraction) {
|
||||
const volume = ctx.options.get("volume")?.value as number || 100;
|
||||
|
||||
if (!ctx.guild || !ctx.channel) return;
|
||||
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel);
|
||||
const player = client.modules.music.get(ctx.guild.id, ctx.channel as TextChannel);
|
||||
|
||||
if (!player) return;
|
||||
|
||||
|
||||
@@ -1,4 +1,7 @@
|
||||
import path from "path";
|
||||
import { fileURLToPath } from "url";
|
||||
|
||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||
|
||||
const config = {
|
||||
token: process.env.DISCORD_TOKEN,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { Interaction } from "discord.js";
|
||||
import Client from "../lib/Client";
|
||||
import Client from "../lib/Client.js";
|
||||
|
||||
export async function run(client: Client, args: Interaction[]): Promise<void> {
|
||||
const [interaction] = args;
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import Client from "../lib/Client";
|
||||
import Client from "../lib/Client.js";
|
||||
import { generateDependencyReport } from "@discordjs/voice";
|
||||
import { ActivityType } from "discord.js";
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import { VoiceState } from "discord.js";
|
||||
import I18n from "../lib/I18n";
|
||||
import Client from "../lib/Client";
|
||||
import { asleep } from "../lib/Misc";
|
||||
import I18n from "../lib/I18n.js";
|
||||
import Client from "../lib/Client.js";
|
||||
import { asleep } from "../lib/Misc.js";
|
||||
|
||||
export async function run(client: Client, args: VoiceState[]): Promise<void> {
|
||||
const [oldState] = args;
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import Client from "./lib/Client";
|
||||
import config from "./config";
|
||||
import Client from "./lib/Client.js";
|
||||
import config from "./config.js";
|
||||
|
||||
const client = new Client();
|
||||
|
||||
|
||||
+10
-9
@@ -1,11 +1,13 @@
|
||||
import {
|
||||
Client as DiscordClient
|
||||
Client as DiscordClient,
|
||||
GatewayIntentBits
|
||||
} from "discord.js";
|
||||
import { existsSync, readdirSync } from "fs";
|
||||
import path from "path";
|
||||
import Music from "./Music";
|
||||
import { command, event } from "./Types";
|
||||
import config from "../config";
|
||||
import Music from "./Music.js";
|
||||
import { command, event } from "./Types.js";
|
||||
import config from "../config.js";
|
||||
import { pathToFileURL } from "url";
|
||||
|
||||
export default class Client extends DiscordClient {
|
||||
private commands = new Map<string, command>();
|
||||
@@ -21,9 +23,8 @@ export default class Client extends DiscordClient {
|
||||
public constructor() {
|
||||
super({
|
||||
intents: [
|
||||
"Guilds",
|
||||
"GuildMessages",
|
||||
"GuildVoiceStates",
|
||||
GatewayIntentBits.Guilds,
|
||||
GatewayIntentBits.GuildVoiceStates
|
||||
],
|
||||
});
|
||||
|
||||
@@ -33,7 +34,7 @@ export default class Client extends DiscordClient {
|
||||
);
|
||||
|
||||
for (const file of files) {
|
||||
import(path.join(config.commands, file)).then((cmd: command) =>
|
||||
import(pathToFileURL(path.join(config.commands, file)).toString()).then((cmd: command) =>
|
||||
this.commands.set(cmd.data.name, cmd)
|
||||
);
|
||||
}
|
||||
@@ -45,7 +46,7 @@ export default class Client extends DiscordClient {
|
||||
);
|
||||
|
||||
for (const file of files) {
|
||||
import(path.join(config.events, file)).then((evnt: event) => {
|
||||
import(pathToFileURL(path.join(config.events, file)).toString()).then((evnt: event) => {
|
||||
this.on(evnt.name, (...args: unknown[]) =>
|
||||
evnt.run(this, args)
|
||||
);
|
||||
|
||||
+2
-2
@@ -1,7 +1,7 @@
|
||||
import { ytdlArgs, ytdlResponse } from "./Types";
|
||||
import { ytdlArgs, ytdlResponse } from "./Types.js";
|
||||
import { execFile } from "child_process";
|
||||
import { promisify } from "util";
|
||||
import config from "../config";
|
||||
import config from "../config.js";
|
||||
import path from "path";
|
||||
|
||||
const execFileAsync = promisify(execFile);
|
||||
|
||||
+4
-4
@@ -1,7 +1,7 @@
|
||||
import Player from "./Player";
|
||||
import { loopOption, track } from "./Types";
|
||||
import { loopMoji, secToISO, statusBarGenerator, volumeMoji } from "./Misc";
|
||||
import Queue from "./Queue";
|
||||
import Player from "./Player.js";
|
||||
import { loopOption, track } from "./Types.js";
|
||||
import { loopMoji, secToISO, statusBarGenerator, volumeMoji } from "./Misc.js";
|
||||
import Queue from "./Queue.js";
|
||||
import { AudioResource } from "@discordjs/voice";
|
||||
import { EmbedBuilder } from "discord.js";
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { loopOption } from "./Types";
|
||||
import { loopOption } from "./Types.js";
|
||||
|
||||
export function statusBarGenerator(duration: number, length: number): string {
|
||||
duration = Math.max(0, duration);
|
||||
|
||||
+4
-4
@@ -1,10 +1,10 @@
|
||||
import { Guild, TextBasedChannel } from "discord.js";
|
||||
import Player from "./Player";
|
||||
import { Guild, TextChannel } from "discord.js";
|
||||
import Player from "./Player.js";
|
||||
|
||||
export default class Music {
|
||||
private players = new Map<string, Player>();
|
||||
|
||||
public get(guildId: string, channel?: TextBasedChannel): Player | undefined {
|
||||
public get(guildId: string, channel?: TextChannel): Player | undefined {
|
||||
const player = this.players.get(guildId);
|
||||
if (player) {
|
||||
if (channel) player.Channel = channel;
|
||||
@@ -12,7 +12,7 @@ export default class Music {
|
||||
}
|
||||
}
|
||||
|
||||
public set(guild: Guild, channel: TextBasedChannel): Player {
|
||||
public set(guild: Guild, channel: TextChannel): Player {
|
||||
const player = new Player(guild, this, channel);
|
||||
this.players.set(guild.id, player);
|
||||
|
||||
|
||||
+13
-13
@@ -14,30 +14,30 @@ import {
|
||||
import {
|
||||
Guild,
|
||||
Message,
|
||||
TextBasedChannel,
|
||||
TextChannel,
|
||||
User,
|
||||
VoiceBasedChannel,
|
||||
} from "discord.js";
|
||||
|
||||
import Music from "./Music";
|
||||
import Filter from "./Filter";
|
||||
import Queue from "./Queue";
|
||||
import { fetchStream } from "./Fetch";
|
||||
import I18n from "./I18n";
|
||||
import Music from "./Music.js";
|
||||
import Filter from "./Filter.js";
|
||||
import Queue from "./Queue.js";
|
||||
import { fetchStream } from "./Fetch.js";
|
||||
import I18n from "./I18n.js";
|
||||
|
||||
import ytdl from "discord-ytdl-core";
|
||||
import { track } from "./Types";
|
||||
import { largestCommonSequence } from "./Misc";
|
||||
import { track } from "./Types.js";
|
||||
import { largestCommonSequence } from "./Misc.js";
|
||||
|
||||
export default class Player {
|
||||
private music: Music;
|
||||
private guild: Guild;
|
||||
|
||||
private channel: TextBasedChannel;
|
||||
public get Channel(): TextBasedChannel {
|
||||
private channel: TextChannel;
|
||||
public get Channel(): TextChannel {
|
||||
return this.channel;
|
||||
}
|
||||
public set Channel(x: TextBasedChannel) {
|
||||
public set Channel(x: TextChannel) {
|
||||
this.channel = x;
|
||||
}
|
||||
|
||||
@@ -84,11 +84,11 @@ export default class Player {
|
||||
public constructor(
|
||||
guild: Guild,
|
||||
music: Music,
|
||||
textBasedChannel: TextBasedChannel
|
||||
textChannel: TextChannel
|
||||
) {
|
||||
this.music = music;
|
||||
this.guild = guild;
|
||||
this.channel = textBasedChannel;
|
||||
this.channel = textChannel;
|
||||
|
||||
this.player = createAudioPlayer();
|
||||
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { loopOption, track } from "./Types";
|
||||
import { loopOption, track } from "./Types.js";
|
||||
|
||||
export default class Queue {
|
||||
private tracks: track[] = [];
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
import { ApplicationCommandData, User, CommandInteraction } from "discord.js";
|
||||
import Client from "./Client";
|
||||
import Client from "./Client.js";
|
||||
|
||||
export type track = {
|
||||
url: string;
|
||||
|
||||
+15
-15
@@ -1,19 +1,19 @@
|
||||
{
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
"compilerOptions": {
|
||||
"strict": true,
|
||||
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"removeComments": false,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "node",
|
||||
"outDir": "dist",
|
||||
"removeComments": false,
|
||||
"sourceMap": true,
|
||||
"esModuleInterop": true,
|
||||
|
||||
"target": "ESNext",
|
||||
"lib": ["ESNext"],
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
"target": "ESNext",
|
||||
"lib": ["ESNext"],
|
||||
"types": ["node"],
|
||||
"skipLibCheck": true
|
||||
},
|
||||
"include": ["src/**/*"],
|
||||
"exclude": ["node_modules", "dist"]
|
||||
}
|
||||
Reference in new issue
Block a user