-
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.
- Loading branch information
Showing
4 changed files
with
57 additions
and
0 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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { player } from './play'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function changeVolumeCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: '動画が再生されていません。' }); | ||
if (!message.content.split(' ')[1]) return message.reply({ content: `現在の音量は${player.volume}です。` }); | ||
if (Number(message.content.split(' ')[1]) > 100) { | ||
player.changeVolume(100 / 10); | ||
return message.reply({ content: 'ボリュームを最大に設定しました。' }); | ||
} | ||
|
||
if (Number(message.content.split(' ')[1]) < 0) { | ||
player.changeVolume(0 / 10); | ||
return message.reply({ content: 'ミュートに設定しました。' }); | ||
} | ||
|
||
player.changeVolume(Number(message.content.split(' ')[1]) / 10); | ||
return message.reply({ content: `ボリュームを${player.volume * 10}に変更しました。` }); | ||
} |
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,12 @@ | ||
import { getSongInfo } from '../Utils/songResolver'; | ||
import { queueManager, Queue } from '../classes/queue'; | ||
import { player } from './play'; | ||
import { Message } from 'discord.js'; | ||
|
||
export async function nowplayingCommand(message: Message) { | ||
if (typeof player === 'undefined') return message.reply({ content: '動画が再生されていません。' }); | ||
const queue = queueManager.getQueue(message.guild?.id as string) as Queue<string>; | ||
if (!queue.currentSong) return message.reply({ content: 'キューに曲がありません。' }); | ||
const info = await getSongInfo(queue.currentSong); | ||
return message.reply(info); | ||
} |