forked from MotiCAT/TuneNekoSync
-
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
Showing
12 changed files
with
101 additions
and
104 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
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,21 +1,6 @@ | ||
import { Builder } from '../Utils/Builder'; | ||
import { embeds } from '../embeds'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function helpCommand(message: Message): Promise<void> { | ||
message.reply( | ||
new Builder() | ||
.setTitle('Help') | ||
.setColor('Blue') | ||
.addFields( | ||
{ name: 'play', value: '้ณๆฅฝใๅ็ใใพใใ' }, | ||
{ name: 'queue', value: 'ใญใฅใผใ่กจ็คบใใพใใ' }, | ||
{ name: 'loop', value: 'ใซใผใใใชใณ/ใชใใซใใพใใ' }, | ||
{ name: 'skip', value: '็พๅจใฎๆฒใในใญใใใใพใใ' }, | ||
{ name: 'stop', value: 'ๅ็ใๅๆญขใใพใใ' }, | ||
{ name: 'pause', value: 'ๅ็ใไธๆๅๆญขใใพใใ' }, | ||
{ name: 'resume', value: 'ๅ็ใๅ้ใใพใใ' }, | ||
{ name: 'help', value: 'ใใฎใกใใปใผใธใ่กจ็คบใใพใใ' } | ||
) | ||
.build() | ||
); | ||
message.reply(embeds.help); | ||
} |
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,12 +1,13 @@ | ||
import { getSongInfo } from '../Utils/songResolver'; | ||
import { queueManager, Queue } from '../classes/queue'; | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function nowplayingCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }); | ||
if (typeof player === 'undefined') return message.reply(embeds.videoNotPlaying); | ||
const queue = queueManager.getQueue(message.guild?.id as string) as Queue; | ||
if (!queue.currentSong) return message.reply({ content: 'ใญใฅใผใซๆฒใใใใพใใใ' }); | ||
if (!queue.currentSong) return message.reply(embeds.queueEmpty); | ||
const info = await getSongInfo(queue.currentSong); | ||
return message.reply(info); | ||
} |
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,24 +1,18 @@ | ||
import { Builder } from '../Utils/Builder'; | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { AudioPlayerStatus } from '@discordjs/voice'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function pauseCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }); | ||
if (typeof player === 'undefined') return message.reply(embeds.videoNotPlaying); | ||
|
||
if (player.player.state.status === AudioPlayerStatus.Playing) { | ||
player.pause(); | ||
message.reply( | ||
new Builder().addFields({ name: 'Success', value: 'ๅ็ปใไธๆๅๆญขใใพใใใ' }).setColor('Green').build() | ||
); | ||
message.reply(embeds.videoPaused); | ||
} else if (player.player.state.status === AudioPlayerStatus.Paused) { | ||
player.resume(); | ||
message.reply( | ||
new Builder().addFields({ name: 'Success', value: 'ๅ็ปใๅ้ใใพใใใ' }).setColor('Green').build() | ||
); | ||
message.reply(embeds.videoResumed); | ||
} else { | ||
message.reply( | ||
new Builder().addFields({ name: 'Info', value: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }).setColor('Yellow').build() | ||
); | ||
message.reply(embeds.videoNotPlaying); | ||
} | ||
} |
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 |
---|---|---|
@@ -1,22 +1,16 @@ | ||
import { Builder } from '../Utils/Builder'; | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { AudioPlayerStatus } from '@discordjs/voice'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function resumeCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }); | ||
if (typeof player === 'undefined') return message.reply(embeds.videoNotPlaying); | ||
if (player.player.state.status === AudioPlayerStatus.Paused) { | ||
player.resume(); | ||
message.reply( | ||
new Builder().addFields({ name: 'Success', value: 'ๅ็ปใๅ้ใใพใใใ' }).setColor('Green').build() | ||
); | ||
message.reply(embeds.videoResumed); | ||
} else if (player.player.state.status === AudioPlayerStatus.Playing) { | ||
message.reply( | ||
new Builder().addFields({ name: 'Info', value: 'ๅ็ปใไธๆๅๆญขใใใฆใใพใใใ' }).setColor('Yellow').build() | ||
); | ||
message.reply(embeds.videoNotPaused); | ||
} else { | ||
message.reply( | ||
new Builder().addFields({ name: 'Info', value: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }).setColor('Yellow').build() | ||
); | ||
message.reply(embeds.videoNotPlaying); | ||
} | ||
} |
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,16 +1,11 @@ | ||
import { Builder } from '../Utils/Builder'; | ||
import { Queue, queueManager } from '../classes/queue'; | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function skipCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }); | ||
if (typeof player === 'undefined') return message.reply(embeds.videoNotPlaying); | ||
const queue = queueManager.queues.get(message.guildId!) as Queue; | ||
|
||
if (!queue.length) { | ||
return message.reply( | ||
new Builder().addFields({ name: 'Info', value: 'ใญใฅใผใ็ฉบใงใใ' }).setColor('Yellow').build() | ||
); | ||
} | ||
if (!queue.length) return message.reply(embeds.queueEmpty); | ||
player.skip(); | ||
} |
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,59 @@ | ||
import { Builder } from '../Utils/Builder'; | ||
|
||
export const embeds = { | ||
embed: new Builder(), | ||
help: new Builder() | ||
.setTitle('Help') | ||
.setColor('Blue') | ||
.addFields( | ||
{ name: 'play', value: '้ณๆฅฝใๅ็ใใพใใ' }, | ||
{ name: 'queue', value: 'ใญใฅใผใ่กจ็คบใใพใใ' }, | ||
{ name: 'loop', value: 'ใซใผใใใชใณ/ใชใใซใใพใใ' }, | ||
{ name: 'skip', value: '็พๅจใฎๆฒใในใญใใใใพใใ' }, | ||
{ name: 'stop', value: 'ๅ็ใๅๆญขใใพใใ' }, | ||
{ name: 'pause', value: 'ๅ็ใไธๆๅๆญขใใพใใ' }, | ||
{ name: 'resume', value: 'ๅ็ใๅ้ใใพใใ' }, | ||
{ name: 'help', value: 'ใใฎใกใใปใผใธใ่กจ็คบใใพใใ' } | ||
) | ||
.build(), | ||
videoNotPlaying: new Builder() | ||
.addFields({ name: 'Info', value: 'ๅ็ปใๅ็ใใใฆใใพใใใ' }) | ||
.setColor('Yellow') | ||
.build(), | ||
videoResumed: new Builder().addFields({ name: 'Success', value: 'ๅ็ปใๅ้ใใพใใใ' }).setColor('Green').build(), | ||
videoPaused: new Builder() | ||
.addFields({ name: 'Success', value: 'ๅ็ปใไธๆๅๆญขใใพใใใ' }) | ||
.setColor('Green') | ||
.build(), | ||
videoNotPaused: new Builder() | ||
.addFields({ name: 'Info', value: 'ๅ็ปใฏไธๆๅๆญขใใใฆใใพใใใ' }) | ||
.setColor('Yellow') | ||
.build(), | ||
videoStopped: new Builder().addFields({ name: 'Success', value: 'ๅ็ปใๅๆญขใใพใใใ' }).setColor('Green').build(), | ||
noUrl: new Builder().addFields({ name: 'Error', value: 'URLใๆๅฎใใฆใใ ใใใ' }).setColor('Red').build(), | ||
invaildUrl: new Builder() | ||
.addFields({ name: 'Error', value: 'ๆๅนใชURLใๆๅฎใใฆใใ ใใใ' }) | ||
.setColor('Red') | ||
.build(), | ||
voiceChannnelPermission: new Builder() | ||
.addFields({ name: 'Error', value: 'ใใคในใใฃใณใใซใซๅๅ ใใๆจฉ้ใใใใพใใใ' }) | ||
.setColor('Red') | ||
.build(), | ||
voiceChannnelJoined: new Builder() | ||
.addFields({ name: 'Error', value: 'ใใคในใใฃใณใใซใซๆขใซๅๅ ใใฆใใพใใ' }) | ||
.setColor('Red') | ||
.build(), | ||
queueEmpty: new Builder().addFields({ name: 'Error', value: 'ใญใฅใผใ็ฉบใงใใ' }).setColor('Red').build(), | ||
unknownCommand: new Builder() | ||
.addFields({ name: 'Error', value: 'ไธๆใชใณใใณใใใณใใณใใๆๅฎใใใฆใใพใใใ' }) | ||
.setColor('Red') | ||
.build(), | ||
voiceChannelJoin: new Builder() | ||
.addFields({ name: 'Error', value: 'ใใคในใใฃใณใใซใซๅๅ ใใฆใใๅฎ่กใใฆใใ ใใใ' }) | ||
.setColor('Red') | ||
.build(), | ||
commandNotFound: new Builder() | ||
.addFields({ name: 'Error', value: 'ใณใใณใใ่ฆใคใใใพใใใงใใใ' }) | ||
.setColor('Red') | ||
.build() | ||
}; |