Skip to content

Commit

Permalink
Update distube to last version!
Browse files Browse the repository at this point in the history
  • Loading branch information
Adivise committed May 29, 2022
1 parent 4df8c8b commit 6c5555e
Show file tree
Hide file tree
Showing 11 changed files with 51 additions and 53 deletions.
2 changes: 1 addition & 1 deletion .env.example
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
TOKEN=replace_on_here
PREFIX=#
OWNER_ID-replace_on_here
OWNER_ID=replace_on_here
27 changes: 13 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,8 @@
## 🤖 FORK
[![Run on Repl.it](https://repl.it/badge/github/Adivise/DisSpaceX)](https://repl.it/github/Adivise/DisSpaceX)

## 📑 Short Feature
- [x] Music
- [x] Filters
- [x] MessageButton
- [x] No Database Requirement
- [x] No Database
- [x] Easy to use

## 🎶 Support Source
Expand All @@ -20,12 +17,10 @@

## 🛑 Requirements

Node.js V16+ **[Download](https://nodejs.org/dist/v17.0.1/node-v17.0.1-x64.msi)**
Node.js **[Download](https://nodejs.org/dist/v17.0.1/node-v17.0.1-x64.msi)**

Discord Bot Token **[Guide](https://discordjs.guide/preparations/setting-up-a-bot-application.html#creating-your-bot)**

FFmpeg **[Download](https://github.com/BtbN/FFmpeg-Builds)**

## 💌 Installation

```
Expand All @@ -42,17 +37,22 @@ Copy or Rename `.env.example` to `.env` and fill out the values:
```.env
TOKEN=replace_on_here
PREFIX=!
OWNER_ID-replace_on_here
OWNER_ID=replace_on_here
```

## 📄 Features & Commands

> Note: The default prefix is '#'
🎶 **Music Commands!**
- Play (#play, #p, #pplay) can play song from youtube, soundcloud and spotify
- Play (#play, #p, #pplay)
- Autoplay (#autoplay, #ap)
- Lyrics (#lyrics)
- Playskip (#playskip)
- Replay (#replay)
- Previous (#previous)
- Nowplaying (#nowplaying, #np)
- Queue (#queue <page>, #q <page>)
- Queue (#queue, #q)
- Loop (#loop, #l)
- Loopqueue (#loopqueue, #lq)
- Shuffle (#shuffle)
Expand All @@ -68,7 +68,7 @@ OWNER_ID-replace_on_here
- Vaporwave (#vaporwave, #vw)
- earwax (#earwax)
- Nightcore (#nightcore, nc)
- 3d (#3d) <== use head phone for this feeling
- 3d (#3d)
- echo (#echo)
- flanger (#flanger, #fg)
- gate (#gate)
Expand All @@ -88,7 +88,7 @@ OWNER_ID-replace_on_here
- Invite (#invite)
- Restart (#restart, #stopbot, #shutdown)

## 🖼 Picture
## 🖼 Picture (OLD)

- [CLICK ME!](https://imgur.com/a/zvP3NIi)

Expand All @@ -98,5 +98,4 @@ OWNER_ID-replace_on_here
![see](https://i.imgur.com/CqKhn2a.png)
![see](https://i.imgur.com/sbkZXnb.png)
![see](https://i.imgur.com/4GGIXyZ.png)
![see](https://i.imgur.com/poraMNP.png)

![see](https://i.imgur.com/poraMNP.png)
6 changes: 3 additions & 3 deletions commands/music/play.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ module.exports = {
category: "music",
},
run: async (client, message, args) => {
message.channel.send(`**Searching.....** \`${args.join(" ")}\``).then(msg => {
setTimeout(() => msg.delete(), 5000)
})
// message.channel.send(`**Searching.....** \`${args.join(" ")}\``).then(msg => {
// setTimeout(() => msg.delete(), 5000)
// })

const { channel } = message.member.voice;
if (!channel) return message.channel.send("You need to be in voice channel.")
Expand Down
6 changes: 3 additions & 3 deletions commands/music/playskip.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ module.exports = {
category: "music",
},
run: async (client, message, args) => {
message.channel.send(`**Searching.....** \`${args.join(" ")}\``).then(msg => {
setTimeout(() => msg.delete(), 5000)
})
// message.channel.send(`**Searching.....** \`${args.join(" ")}\``).then(msg => {
// setTimeout(() => msg.delete(), 5000)
// })

const { channel } = message.member.voice;
if (!channel) return message.channel.send("You need to be in voice channel.")
Expand Down
20 changes: 8 additions & 12 deletions disspace.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const { Intents, Client, Collection } = require("discord.js");
const { Client, Collection } = require("discord.js");
const { DisTube } = require('distube');
const { SoundCloudPlugin } = require('@distube/soundcloud');
const { SpotifyPlugin } = require('@distube/spotify');
Expand All @@ -7,16 +7,11 @@ class MainClient extends Client {
constructor() {
super({
shards: "auto",
intents: 32767,
allowedMentions: {
parse: ["roles", "users", "everyone"],
repliedUser: false
},
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MESSAGES
],
});

process.on('unhandledRejection', error => console.log(error));
Expand All @@ -30,12 +25,13 @@ if(!this.token) this.token = this.config.TOKEN;
const client = this;

this.distube = new DisTube(client, {
searchSongs: 0,
searchSongs: 0, /// SET TO 5 FOR ENABLE SEARCH MODE!
searchCooldown: 30,
leaveOnEmpty: this.config.LEAVE_EMPTY,
emptyCooldown: this.config.EMPTY_LEAVE,
leaveOnFinish: this.config.LEAVE_FINISH,
leaveOnStop: this.config.LEAVE_STOP,
leaveOnEmpty: true,
emptyCooldown: 60,
leaveOnFinish: true,
leaveOnStop: true,
youtubeDL: false,
plugins: [
new SoundCloudPlugin(),
new SpotifyPlugin({
Expand Down
3 changes: 3 additions & 0 deletions events/distube/searchCancel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async (client, message, query) => {
message.channel.send(`No response.`);
}
3 changes: 3 additions & 0 deletions events/distube/searchDone.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async (client, answer, query, queue) => {

}
3 changes: 3 additions & 0 deletions events/distube/searchInvalidAnswer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
module.exports = async (client, answer, query, queue) => {

}
12 changes: 12 additions & 0 deletions events/distube/searchResult.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const { MessageEmbed } = require("discord.js");

module.exports = async (client, message, result, query) => {
let i = 0
let embed = new MessageEmbed()
.setColor("#000001")
.setTitle(`Song Selection...`)
.setDescription(`${result.map(song => `**(${++i}.) [${song.name}](${song.url})** - \`${song.formattedDuration}\``).join("\n")}`)
.setFooter({ text: `Please select a song in 30 seconds.` });

message.channel.send({ embeds: [embed] });
}
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "disspacex",
"version": "3.7.1",
"version": "3.7.3",
"description": "✈ Join Discord: https://discord.gg/SNG3dh3MbR",
"main": "index.js",
"scripts": {
Expand All @@ -16,7 +16,7 @@
"common-tags": "^1.8.2",
"delay": "^5.0.0",
"discord.js": "^13.6.0",
"distube": "^3.3.2",
"distube": "^3.3.4",
"dotenv": "^14.3.2",
"ffmpeg-static": "^4.4.1",
"figlet": "^1.5.2",
Expand Down
18 changes: 0 additions & 18 deletions settings/config.js
Original file line number Diff line number Diff line change
@@ -1,25 +1,7 @@

require("dotenv").config();

module.exports = {

/**
* @description require settings for the bot
*/

TOKEN: process.env.TOKEN || "YOUR_TOKEN", // your bot token
PREFIX: process.env.PREFIX || "#", //<= default is # // bot prefix
OWNER_ID: process.env.OWNER_ID || "YOUR_CLIENT_ID", //your client id

/**
*
*/
EMPTY_LEAVE: process.env.EMPTY_LEAVE || 60, //<= default is 60 // time in seconds

/**
* @description boolean settings for the bot
*/
LEAVE_EMPTY: true, //<= default is true "true" = use and "false" = not use! // leave voice channel when empty
LEAVE_FINISH: true, //<= default is true "true" = use and "false" = not use! // leave voice channel when finished
LEAVE_STOP:true, //<= default is true "true" = use and "false" = not use! // leave voice channel when stopped
}

0 comments on commit 6c5555e

Please sign in to comment.