-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from Nich87/main
おめでとうございます!あなたはこれマージすべきなのか...?と思うPRを受け取りました!
- Loading branch information
Showing
14 changed files
with
151 additions
and
145 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { EmbedBuilder } from 'discord.js'; | ||
|
||
export class Builder extends EmbedBuilder { | ||
constructor() { | ||
super(); | ||
} | ||
|
||
public build() { | ||
return { embeds: [this] }; | ||
} | ||
|
||
public addEmbeds(embeds: Builder[]) { | ||
return { embeds: [this, ...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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,6 @@ | ||
import { Message, EmbedBuilder } from 'discord.js'; | ||
import { embeds } from '../embeds'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function helpCommand(message: Message): Promise<void> { | ||
message.reply({ | ||
embeds: [ | ||
new EmbedBuilder() | ||
.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: 'このメッセージを表示します。' } | ||
) | ||
] | ||
}); | ||
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,23 +1,18 @@ | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { AudioPlayerStatus } from '@discordjs/voice'; | ||
import { Message, EmbedBuilder } from 'discord.js'; | ||
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({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Success', value: '動画を一時停止しました。' }).setColor('Green')] | ||
}); | ||
message.reply(embeds.videoPaused); | ||
} else if (player.player.state.status === AudioPlayerStatus.Paused) { | ||
player.resume(); | ||
message.reply({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Success', value: '動画を再開しました。' }).setColor('Green')] | ||
}); | ||
message.reply(embeds.videoResumed); | ||
} else { | ||
message.reply({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Info', value: '動画が再生されていません。' }).setColor('Yellow')] | ||
}); | ||
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,23 +1,16 @@ | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { AudioPlayerStatus } from '@discordjs/voice'; | ||
import { Message, EmbedBuilder } from 'discord.js'; | ||
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({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Success', value: '動画を再開しました。' }).setColor('Green')] | ||
}); | ||
message.reply(embeds.videoResumed); | ||
} else if (player.player.state.status === AudioPlayerStatus.Playing) { | ||
message.reply({ | ||
embeds: [ | ||
new EmbedBuilder().addFields({ name: 'Info', value: '動画が一時停止されていません。' }).setColor('Yellow') | ||
] | ||
}); | ||
message.reply(embeds.videoNotPaused); | ||
} else { | ||
message.reply({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Info', value: '動画が再生されていません。' }).setColor('Yellow')] | ||
}); | ||
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,15 +1,11 @@ | ||
import { Queue, queueManager } from '../classes/queue'; | ||
import { embeds } from '../embeds'; | ||
import { player } from './play'; | ||
import { Message, EmbedBuilder } from 'discord.js'; | ||
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({ | ||
embeds: [new EmbedBuilder().addFields({ name: 'Info', value: 'キューが空です。' }).setColor('Yellow')] | ||
}); | ||
} | ||
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
Oops, something went wrong.