discord-nestjs package builds slash command object based on all decorators and DiscordCommandProvider provides it. For example, this is useful when you need to lazily register commands or register commands for a specific guild. ℹ️ ReflectMetadataProvider Provides methods for getting metadata for...
metadata ?? this.current); this._filtersUpdate = false; }); @@ -188,7 +188,7 @@ class Queue<T = unknown> { this.playing = false; if (this._filtersUpdate) return; this._streamTime = 0; if (resource && resource.metadata) this.previousTracks.push(resource.metadata); if (resource?
Node Module (FFMPEG): https://npmjs.com/package/ffmpeg-static Avconv: https://libav.org/download Documentation Getting Started First of all, you will need to register slash commands: const { REST } = require("@discordjs/rest"); const { Routes, ApplicationCommandOptionType } = require(...
npm update ytdl-core discord.js 3. 使用 YouTube API 考虑使用 YouTube Data API 来获取视频元数据,这通常更稳定和可靠。 代码语言:txt 复制 const { google } = require('googleapis'); const ytdl = require('ytdl-core'); async function getVideoMetadata(videoId) { const authClient = awa...
我们将会使用: Node.js TypeScript Discord.js,Discord API的包装器 InversifyJS,一个依赖注入框架测试库:Mocha,Chai和ts-mockito...1npm i --save typescript discord.js inversify dotenv @typ...
Install packages you'd like to test locally yarn add discord.js@latest, yarn add @discordjs/rest@latest, etc. Note: Make sure you use latest tag or else yarn will try to install the remote package from npm Import the package in your source code and test them out! Working with TypeScri...
npm i --save discord.js dotenv typescript inversify @types/node reflect-metadata Then for the last step of setup, you need to change scripts inside thepackage.jsonfile. Later on, you will need two scripts, and thesestartandwatch.
如何在 Discord.js 中检查消息是否为 DM?我已经尝试了几种方法来对此进行测试,我已经尝试了这些方法: if (msg.channel.isDM) ... Produced undefined if (msg.isDM) ... Produced undefined if (msg.channel.DMChannel.isDM) ... produced undefined if (msg.DMChannel) ... produced undefined if (msg...
npm i --save typescript discord.js inversify dotenv @types/node reflect-metadata npm i --save-dev chai mocha ts-mockito ts-node @types/chai @types/mocha 然后, 将package.json中生成的”脚本”部分替换为: "scripts": { "start": "node src/index.js", "watch": "tsc -p tsconfig.json -w...
const{MetadataTypes}=require('discord-role-linker');// ...your RoleLinker instanceroleLinker.metadata.register([{key:'level',name:'Level',description:'Minimum user level',type:MetadataTypes.Integer.GreaterThanOrEqual,},]); Setting up your backend ...