-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
735152d
commit 821db46
Showing
25 changed files
with
1,913 additions
and
604 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
.replit | ||
replit.nix | ||
|
||
# Logs | ||
logs | ||
*.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue, useTimeline } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: "filter", | ||
params: [], | ||
info: "Adds a filter the song", | ||
category: "hidden", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (true) return; | ||
if (fsh.music.checkVoice(message)) return; | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkQueue(message, queue)) return; | ||
if (fsh.music.checkSameVoice(message, queue)) return; | ||
if (!queue.filters.ffmpeg) { | ||
message.reply('filters not available') | ||
return; | ||
} | ||
queue.filters.ffmpeg.setFilters(false); | ||
queue.filters.ffmpeg.toggle(arguments[0]); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,31 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue, QueueRepeatMode } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: "loop", | ||
params: [], | ||
info: "Set the current song to loop or not", | ||
category: "music", | ||
params: ['mode', false], | ||
info: "Set the current song loop mode", | ||
category: "hidden", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (!message.member.voice?.channel) return message.channel.send('connect to a Voice Channel'); | ||
if (fsh.music.looped.get(message.guild.id)) { | ||
fsh.music.unloop(message.guild.id) | ||
if (fsh.music.checkVoice(message)) return; | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkQueue(message, queue)) return; | ||
if (fsh.music.checkSameVoice(message, queue)) return; | ||
if (!arguments2[0]) { | ||
message.channel.send('current loop mode: '+ QueueRepeatMode[queue.repeatMode].toLowerCase()) | ||
} else { | ||
fsh.music.loop(message.guild.id) | ||
if (!['off','queue','track','autoplay'].includes(arguments2[0])) { | ||
message.reply('available loop modes: off, queue, track and autoplay'); | ||
return; | ||
} | ||
let past = QueueRepeatMode[queue.repeatMode].toLowerCase(); | ||
if (past === arguments2[0]) { | ||
message.reply('loop mode alredy is '+past) | ||
return; | ||
} | ||
queue.setRepeatMode(QueueRepeatMode[arguments2[0].toUpperCase()]); | ||
message.reply('changed loop mode from `'+past+'` to `'+arguments2[0]+'`') | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue, useTimeline } = require("discord-player"); | ||
|
||
function prettyNumber(x) { | ||
x = x.toString(); | ||
x = x.replace(/\B(?=(\d{3})+(?!\d))/g, "."); | ||
return x; | ||
} | ||
|
||
module.exports = { | ||
name: ["now-playing", 'np'], | ||
params: [], | ||
info: "Get current song", | ||
category: "music", | ||
|
||
async execute(message, arguments2, fsh) { | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkQueue(message, queue)) return; | ||
const { timestamp, track } = useTimeline(message.guild.id); | ||
|
||
let embed = new Discord.EmbedBuilder() | ||
.setTitle(`${fsh.emojis.music} Now Playing: ${track.raw.source} - ${track.cleanTitle}`) | ||
.setDescription(`Views: ${prettyNumber(track.views)} | ||
${queue.node.createProgressBar({ | ||
leftChar: fsh.emojis.tl, | ||
indicator: fsh.emojis.ti, | ||
rightChar: fsh.emojis.tr | ||
})} ${timestamp.progress}%`) | ||
.setFooter({ text: `V${fsh.version}` }) | ||
.setTimestamp(new Date()) | ||
.setColor("#888888") | ||
.setURL(track.url) | ||
.setImage(track.thumbnail) | ||
.setAuthor({ | ||
name: track.author.replace(' - Topic','') | ||
}); | ||
|
||
message.channel.send({ | ||
embeds: [embed] | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,19 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: ["pause", "unpause", "resume"], | ||
name: ["pause", "resume"], | ||
params: [], | ||
info: "Pauses or unpauses the current song", | ||
info: "Pause or resume the current queue", | ||
category: "music", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (!message.member.voice?.channel) return message.channel.send('connect to a Voice Channel'); | ||
if (fsh.music.paused.get(message.guild.id)) { | ||
fsh.music.unpause(message.guild.id) | ||
} else { | ||
fsh.music.pause(message.guild.id) | ||
} | ||
if (fsh.music.checkVoice(message)) return; | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkQueue(message, queue)) return; | ||
if (fsh.music.checkSameVoice(message, queue)) return; | ||
let state = (!queue.node.isPaused()); | ||
queue.node.setPaused(state); | ||
message.reply((state ? 'paused' : 'resumed')+' queue') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,25 @@ | ||
const Discord = require("discord.js"); | ||
const { useMainPlayer, useQueue } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: "play", | ||
params: [], | ||
params: ['song', true], | ||
info: "Play a song in a vc", | ||
category: "music", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (!message.member.voice?.channel) return message.channel.send('connect to a Voice Channel'); | ||
if (fsh.music.checkVoice(message)) return; | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkSameVoice(message, queue)) return; | ||
let player = useMainPlayer(); | ||
if (!arguments2.length) return message.channel.send('send a song to play') | ||
fsh.music.play(message, message.member.voice.channel, message.content.split(' ').slice(1,message.content.split(' ').length).join(' ')) | ||
player.play(message.member.voice.channel, message.content.split(' ').slice(1,message.content.split(' ').length).join(' '), { | ||
nodeOptions: { | ||
metadata: { | ||
text: message.channel, | ||
voice: message.member.voice.channel | ||
} | ||
} | ||
}) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,18 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: "queue", | ||
params: [], | ||
info: "Current music queue", | ||
info: "Get the Current music queue", | ||
category: "music", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (!message.member.voice?.channel) return message.channel.send('connect to a Voice Channel'); | ||
message.channel.send(fsh.music.userQueue.get(message.guild.id).length ? '**queue:**\n1. '+fsh.music.userQueue.get(message.guild.id).join('\n1. ') : 'Nothing in queue') | ||
let queue = useQueue(message.guild.id); | ||
if (!queue) { | ||
message.reply('no queue in this server'); | ||
} | ||
message.channel.send(queue.tracks.data.length ? '**queue:**\n'+queue.tracks.data.map(t=>`1. ${t.title} by ${t.author}`).join('\n') : 'nothing in queue') | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const Discord = require("discord.js"); | ||
const { useQueue, useTimeline } = require("discord-player"); | ||
|
||
module.exports = { | ||
name: "volume", | ||
params: ['volume', false], | ||
info: "Changes the volume of the song", | ||
category: "music", | ||
|
||
async execute(message, arguments2, fsh) { | ||
if (fsh.music.checkVoice(message)) return; | ||
let queue = useQueue(message.guild.id); | ||
if (fsh.music.checkQueue(message, queue)) return; | ||
if (fsh.music.checkSameVoice(message, queue)) return; | ||
let { volume, setVolume } = useTimeline(message.guild.id); | ||
let num = Number(arguments2[0]); | ||
if (!isNaN(num)) { | ||
if (num < 0) { | ||
message.reply('must be a positive integer') | ||
return; | ||
} | ||
if (num > 1000) { | ||
message.reply('a bit too loud keep it under 1000') | ||
return; | ||
} | ||
queue.node.setVolume(num); | ||
} else { | ||
message.channel.send('current volume: '+volume) | ||
} | ||
} | ||
}} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -197,5 +197,5 @@ module.exports = { | |
} else { | ||
message.channel.send({ embeds }); | ||
} | ||
}, | ||
}; | ||
} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.