Update dependencies and fix a reminder bug (#102)
All checks were successful
ci/woodpecker/push/publish Pipeline was successful

- Update dependencies
- Resolve a minor bug with reminders

Co-authored-by: Mylloon <kennel.anri@tutanota.com>
Reviewed-on: #102
This commit is contained in:
Mylloon 2023-08-06 20:34:25 +02:00
parent 309d73d03d
commit 0904bd0d98
Signed by: Forgejo
GPG key ID: E72245C752A07631
8 changed files with 566 additions and 490 deletions

1013
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -16,27 +16,23 @@
"author": "La confrérie du Kassoulait",
"license": "GPL-3.0-only",
"dependencies": {
"@discord-player/extractor": "^4.2.1",
"@discord-player/extractor": "^4.4.1",
"@discordjs/opus": "^0.9.0",
"@discordjs/rest": "^1.7.0",
"@discordjs/rest": "^2.0.0",
"@types/sqlite3": "^3.1.8",
"@types/uuid": "^9.0.1",
"discord-player": "^6.2.1",
"discord.js": "^14.9.0",
"@types/uuid": "^9.0.2",
"discord-player": "^6.6.2",
"discord.js": "^14.12.1",
"genius-lyrics": "^4.4.3",
"node-fetch": "^2.6.9",
"play-dl": "^1.9.6",
"sqlite3": "^5.1.6",
"typescript": "^5.0.4",
"typescript": "^5.1.6",
"uuid": "^9.0.0"
},
"overrides": {
"discord-api-types": "0.37.34"
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.30.7",
"@typescript-eslint/parser": "^5.30.7",
"dotenv": "^16.0.1",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"dotenv": "^16.3.1",
"prettier-eslint": "^15.0.1",
"ts-node-dev": "^2.0.0"
}

View file

@ -1,5 +1,5 @@
import { SlashCommandBuilder } from "@discordjs/builders";
import { Player, useMasterPlayer, useQueue } from "discord-player";
import { Player, useMainPlayer, useQueue } from "discord-player";
import { ChatInputCommandInteraction, Client, EmbedBuilder } from "discord.js";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
@ -45,7 +45,7 @@ export default {
let data = null;
await interaction.deferReply();
const player = useMasterPlayer() as Player;
const player = useMainPlayer() as Player;
if (request) {
try {
data = await player.lyrics.search(request);

View file

@ -10,7 +10,7 @@ import {
import { Metadata } from "../../utils/metadata";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { Player, QueryType, SearchResult, useMasterPlayer, useQueue } from "discord-player";
import { Player, QueryType, SearchResult, useMainPlayer, useQueue } from "discord-player";
export default {
scope: () => [],
@ -71,7 +71,7 @@ export default {
loc_default?.get(`c_${filename}_opt1_name`) as string
);
const player = useMasterPlayer() as Player;
const player = useMainPlayer() as Player;
if (!query) {
// Now playing
@ -154,7 +154,7 @@ export default {
const loc_default = interaction.client.locales.get(interaction.client.config.default_lang);
const filename = getFilename(__filename);
const player = useMasterPlayer() as Player;
const player = useMainPlayer() as Player;
const query = interaction.options.getString(
loc_default?.get(`c_${filename}_opt1_name`) as string,
true

View file

@ -3,7 +3,7 @@ import { ChatInputCommandInteraction, Client, GuildResolvable } from "discord.js
import { Metadata } from "../../utils/metadata";
import { getLocale, getLocalizations } from "../../utils/locales";
import { getFilename } from "../../utils/misc";
import { Player, useMasterPlayer } from "discord-player";
import { Player, useMainPlayer } from "discord-player";
export default {
scope: () => [],
@ -25,7 +25,7 @@ export default {
interaction: async (interaction: ChatInputCommandInteraction, client: Client) => {
const loc = getLocale(client, interaction.locale);
const player = useMasterPlayer() as Player;
const player = useMainPlayer() as Player;
const queue = player.nodes.create(interaction.guild as GuildResolvable, {
metadata: {
channel: interaction.channel,

View file

@ -1,4 +1,4 @@
import { Player, PlayerEvents, useMasterPlayer } from "discord-player";
import { Player, PlayerEvents, useMainPlayer } from "discord-player";
import { Client } from "discord.js";
import { readdir } from "fs/promises";
@ -29,7 +29,7 @@ export default async (client: Client) => {
const event_type = event_type_ext.join(".");
if (event_category == "player") {
const player = useMasterPlayer() as Player;
const player = useMainPlayer() as Player;
if (once) {
// eslint-disable-next-line
return player.events.once(event_type as keyof PlayerEvents, (...args: any[]) => {

View file

@ -39,7 +39,6 @@ export default async () => {
};
const player = Player.singleton(client, {
autoRegisterExtractor: false,
ytdlOptions: {
filter: "audioonly",
quality: "highestaudio",

View file

@ -127,7 +127,7 @@ export const sendReminder = (client: Client, info: infoReminder, option: OptionR
// Send the message in the appropriate channel
// TODO: Embed
let message: string;
if (info.message === null) {
if (info.message === null || info.message.length === 0) {
message = loc.get("c_reminder7");
} else {
message = cleanCodeBlock(info.message);