distube 3.2.1 → 3.2.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/type.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"type.js","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"","sourcesContent":["import type ytdl from \"@distube/ytdl-core\";\nimport type { CustomPlugin, DisTubeVoice, ExtractorPlugin, Playlist, Queue, SearchResult, Song } from \".\";\nimport type {\n Guild,\n GuildMember,\n GuildTextBasedChannel,\n Interaction,\n Message,\n Snowflake,\n User,\n VoiceBasedChannel,\n VoiceState,\n} from \"discord.js\";\n\ntype Awaitable = Promise<void> | void;\n\nexport type DisTubeVoiceEvents = {\n disconnect: (error?: Error) => Awaitable;\n error: (error: Error) => Awaitable;\n finish: () => Awaitable;\n};\n\nexport type DisTubeEvents = {\n /** Emitted when DisTube encounters an error. */\n error: (channel: GuildTextBasedChannel, error: Error) => Awaitable;\n /** Emitted after DisTube add a new playlist to the playing {@link Queue}. */\n addList: (queue: Queue, playlist: Playlist) => Awaitable;\n /** Emitted after DisTube add a new song to the playing {@link Queue}. */\n addSong: (queue: Queue, song: Song) => Awaitable;\n /**\n * Emitted when DisTube play a song.\n *\n * If {@link DisTubeOptions.emitNewSongOnly} is `true`,\n * this event is not emitted when looping a song or next song is the previous one.\n */\n playSong: (queue: Queue, song: Song) => Awaitable;\n /** Emitted when DisTube finished a song. */\n finishSong: (queue: Queue, song: Song) => Awaitable;\n\n /**\n * Emitted when there is no user in the voice channel,\n * {@link DisTubeOptions.leaveOnEmpty} is `true` and there is a playing queue.\n *\n * If there is no playing queue (stopped and {@link DisTubeOptions.leaveOnStop} is `false`),\n * it will leave the channel without emitting this event.\n */\n empty: (queue: Queue) => Awaitable;\n /**\n * Emitted when there is no more song in the queue and {@link Queue#autoplay} is `false`.\n * DisTube will leave voice channel if {@link DisTubeOptions.leaveOnFinish} is `true`.\n */\n finish: (queue: Queue) => Awaitable;\n /** Emitted when DisTube initialize a queue to change queue default properties. */\n initQueue: (queue: Queue) => Awaitable;\n /**\n * Emitted when {@link Queue#autoplay} is `true`, {@link Queue#songs} is empty,\n * and DisTube cannot find related songs to play.\n */\n noRelated: (queue: Queue) => Awaitable;\n /** Emitted when the bot is disconnected to a voice channel. */\n disconnect: (queue: Queue) => Awaitable;\n /** Emitted when a {@link Queue} is deleted with any reasons. */\n deleteQueue: (queue: Queue) => Awaitable;\n\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to {@link DisTubeOptions.searchTimeout}.\n */\n searchCancel: (message: Message<true>, query: string) => Awaitable;\n /** Emitted when DisTube cannot find any results for the query. */\n searchNoResult: (message: Message<true>, query: string) => Awaitable;\n\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and after the user chose a search result to play.\n */\n searchDone: (message: Message<true>, answer: Message<true>, query: string) => Awaitable;\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to user's next message is not a number or out of results range.\n */\n searchInvalidAnswer: (message: Message<true>, answer: Message<true>, query: string) => Awaitable;\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and song param of {@link DisTube#play} is invalid url.\n * DisTube will wait for user's next message to choose a song manually.\n *\n * Safe search is enabled\n * if {@link DisTubeOptions.nsfw} is disabled and the message's channel is not a nsfw channel.\n */\n searchResult: (message: Message<true>, results: SearchResult[], query: string) => Awaitable;\n};\n\nexport type Filters = Record<string, string>;\n\nexport interface DisTubeOptions {\n plugins?: (CustomPlugin | ExtractorPlugin)[];\n emitNewSongOnly?: boolean;\n leaveOnFinish?: boolean;\n leaveOnStop?: boolean;\n leaveOnEmpty?: boolean;\n emptyCooldown?: number;\n savePreviousSongs?: boolean;\n searchSongs?: number;\n searchCooldown?: number;\n youtubeCookie?: string;\n youtubeIdentityToken?: string;\n youtubeDL?: boolean;\n updateYouTubeDL?: boolean;\n customFilters?: Filters;\n ytdlOptions?: ytdl.downloadOptions;\n nsfw?: boolean;\n emitAddSongWhenCreatingQueue?: boolean;\n emitAddListWhenCreatingQueue?: boolean;\n}\n\nexport type GuildIdResolvable =\n | Queue\n | DisTubeVoice\n | Snowflake\n | Message\n | GuildTextBasedChannel\n | VoiceBasedChannel\n | VoiceState\n | Guild\n | GuildMember\n | Interaction\n | string;\n\nexport interface OtherSongInfo {\n src?: string;\n id?: string;\n title?: string;\n name?: string;\n is_live?: boolean;\n isLive?: boolean;\n _duration_raw?: string | number;\n duration?: string | number;\n webpage_url?: string;\n url: string;\n thumbnail?: string;\n related?: Song[];\n view_count?: string | number;\n views?: string | number;\n like_count?: string | number;\n likes?: string | number;\n dislike_count?: string | number;\n dislikes?: string | number;\n repost_count?: string | number;\n reposts?: string | number;\n uploader?: string;\n uploader_url?: string;\n age_limit?: string | number;\n chapters?: Chapter[];\n age_restricted?: boolean;\n}\n\nexport interface Chapter {\n /** Chapter title */\n title: string;\n /** Chapter start time in seconds */\n start_time: number;\n}\n\nexport interface PlaylistInfo {\n /** The source of the playlist */\n source: string;\n /**\n * User requested.\n */\n member?: GuildMember;\n /**\n * User requested.\n */\n user?: User;\n /** Playlist songs. */\n songs: Song[];\n /**\n * Playlist name.\n */\n name?: string;\n /**\n * Playlist URL.\n */\n url?: string;\n /**\n * Playlist thumbnail.\n */\n thumbnail?: string;\n}\n"]}
1
+ {"version":3,"file":"type.js","sourceRoot":"","sources":["../src/type.ts"],"names":[],"mappings":"","sourcesContent":["import type ytdl from \"@distube/ytdl-core\";\nimport type { CustomPlugin, DisTubeVoice, ExtractorPlugin, Playlist, Queue, SearchResult, Song } from \".\";\nimport type {\n Guild,\n GuildMember,\n GuildTextBasedChannel,\n Interaction,\n Message,\n Snowflake,\n User,\n VoiceBasedChannel,\n VoiceState,\n} from \"discord.js\";\n\ntype Awaitable = Promise<void> | void;\n\nexport type DisTubeVoiceEvents = {\n disconnect: (error?: Error) => Awaitable;\n error: (error: Error) => Awaitable;\n finish: () => Awaitable;\n};\n\nexport type DisTubeEvents = {\n /** Emitted when DisTube encounters an error. */\n error: (channel: GuildTextBasedChannel, error: Error) => Awaitable;\n /** Emitted after DisTube add a new playlist to the playing {@link Queue}. */\n addList: (queue: Queue, playlist: Playlist) => Awaitable;\n /** Emitted after DisTube add a new song to the playing {@link Queue}. */\n addSong: (queue: Queue, song: Song) => Awaitable;\n /**\n * Emitted when DisTube play a song.\n *\n * If {@link DisTubeOptions.emitNewSongOnly} is `true`,\n * this event is not emitted when looping a song or next song is the previous one.\n */\n playSong: (queue: Queue, song: Song) => Awaitable;\n /** Emitted when DisTube finished a song. */\n finishSong: (queue: Queue, song: Song) => Awaitable;\n\n /**\n * Emitted when there is no user in the voice channel,\n * {@link DisTubeOptions.leaveOnEmpty} is `true` and there is a playing queue.\n *\n * If there is no playing queue (stopped and {@link DisTubeOptions.leaveOnStop} is `false`),\n * it will leave the channel without emitting this event.\n */\n empty: (queue: Queue) => Awaitable;\n /**\n * Emitted when there is no more song in the queue and {@link Queue#autoplay} is `false`.\n * DisTube will leave voice channel if {@link DisTubeOptions.leaveOnFinish} is `true`.\n */\n finish: (queue: Queue) => Awaitable;\n /** Emitted when DisTube initialize a queue to change queue default properties. */\n initQueue: (queue: Queue) => Awaitable;\n /**\n * Emitted when {@link Queue#autoplay} is `true`, {@link Queue#songs} is empty,\n * and DisTube cannot find related songs to play.\n */\n noRelated: (queue: Queue) => Awaitable;\n /** Emitted when the bot is disconnected to a voice channel. */\n disconnect: (queue: Queue) => Awaitable;\n /** Emitted when a {@link Queue} is deleted with any reasons. */\n deleteQueue: (queue: Queue) => Awaitable;\n\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to {@link DisTubeOptions.searchTimeout}.\n */\n searchCancel: (message: Message<true>, query: string) => Awaitable;\n /** Emitted when DisTube cannot find any results for the query. */\n searchNoResult: (message: Message<true>, query: string) => Awaitable;\n\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and after the user chose a search result to play.\n */\n searchDone: (message: Message<true>, answer: Message<true>, query: string) => Awaitable;\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and the search canceled due to user's next message is not a number or out of results range.\n */\n searchInvalidAnswer: (message: Message<true>, answer: Message<true>, query: string) => Awaitable;\n /**\n * Emitted when {@link DisTubeOptions.searchSongs} bigger than 0,\n * and song param of {@link DisTube#play} is invalid url.\n * DisTube will wait for user's next message to choose a song manually.\n *\n * Safe search is enabled\n * if {@link DisTubeOptions.nsfw} is disabled and the message's channel is not a nsfw channel.\n */\n searchResult: (message: Message<true>, results: SearchResult[], query: string) => Awaitable;\n};\n\nexport type Filters = Record<string, string>;\n\nexport interface DisTubeOptions {\n plugins?: (CustomPlugin | ExtractorPlugin)[];\n emitNewSongOnly?: boolean;\n leaveOnFinish?: boolean;\n leaveOnStop?: boolean;\n leaveOnEmpty?: boolean;\n emptyCooldown?: number;\n savePreviousSongs?: boolean;\n searchSongs?: number;\n searchCooldown?: number;\n youtubeCookie?: string;\n youtubeIdentityToken?: string;\n youtubeDL?: boolean;\n updateYouTubeDL?: boolean;\n customFilters?: Filters;\n ytdlOptions?: ytdl.downloadOptions;\n nsfw?: boolean;\n emitAddSongWhenCreatingQueue?: boolean;\n emitAddListWhenCreatingQueue?: boolean;\n}\n\nexport type GuildIdResolvable =\n | Queue\n | DisTubeVoice\n | Snowflake\n | Message\n | GuildTextBasedChannel\n | VoiceBasedChannel\n | VoiceState\n | Guild\n | GuildMember\n | Interaction\n | string;\n\nexport interface OtherSongInfo {\n src?: string;\n id?: string;\n title?: string;\n name?: string;\n is_live?: boolean;\n isLive?: boolean;\n _duration_raw?: string | number;\n duration?: string | number;\n webpage_url?: string;\n url: string;\n thumbnail?: string;\n related?: RelatedSong[];\n view_count?: string | number;\n views?: string | number;\n like_count?: string | number;\n likes?: string | number;\n dislike_count?: string | number;\n dislikes?: string | number;\n repost_count?: string | number;\n reposts?: string | number;\n uploader?: string;\n uploader_url?: string;\n age_limit?: string | number;\n chapters?: Chapter[];\n age_restricted?: boolean;\n}\n\nexport interface Chapter {\n /** Chapter title */\n title: string;\n /** Chapter start time in seconds */\n start_time: number;\n}\n\nexport interface PlaylistInfo {\n /** The source of the playlist */\n source: string;\n /**\n * User requested.\n */\n member?: GuildMember;\n /**\n * User requested.\n */\n user?: User;\n /** Playlist songs. */\n songs: Song[];\n /**\n * Playlist name.\n */\n name?: string;\n /**\n * Playlist URL.\n */\n url?: string;\n /**\n * Playlist thumbnail.\n */\n thumbnail?: string;\n}\n\nexport type RelatedSong = Omit<Song, \"related\">;\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "distube",
3
- "version": "3.2.1",
3
+ "version": "3.2.2",
4
4
  "description": "A Discord.js module to simplify your music commands and play songs with audio filters on Discord without any API key. Support YouTube, SoundCloud, Bandcamp, Facebook, and 700+ more sites",
5
5
  "main": "dist/index.js",
6
6
  "typings": "dist/index.d.ts",