mirror of
https://github.com/Myxelium/Lunaris2.0.git
synced 2026-04-13 16:10:36 +00:00
Compare commits
2 Commits
Fix-deadlo
...
Require-us
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8d69277868 | ||
| 8dcd4b334d |
@@ -45,9 +45,16 @@ public class PlayHandler : IRequestHandler<PlayCommand>
|
|||||||
|
|
||||||
async void PlayMusic()
|
async void PlayMusic()
|
||||||
{
|
{
|
||||||
await _audioService.StartAsync(cancellationToken);
|
|
||||||
var context = command.Message;
|
var context = command.Message;
|
||||||
_context = context;
|
_context = context;
|
||||||
|
|
||||||
|
if ((context.User as SocketGuildUser)?.VoiceChannel == null)
|
||||||
|
{
|
||||||
|
await context.SendMessageAsync("You must be in a voice channel to use this command.", _client);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
await _audioService.StartAsync(cancellationToken);
|
||||||
|
|
||||||
var searchQuery = context.GetOptionValueByName(Option.Input);
|
var searchQuery = context.GetOptionValueByName(Option.Input);
|
||||||
|
|
||||||
@@ -56,7 +63,7 @@ public class PlayHandler : IRequestHandler<PlayCommand>
|
|||||||
await context.SendMessageAsync("Please provide search terms.", _client);
|
await context.SendMessageAsync("Please provide search terms.", _client);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
var player = await _audioService.GetPlayerAsync(_client, context, connectToVoiceChannel: true);
|
var player = await _audioService.GetPlayerAsync(_client, context, connectToVoiceChannel: true);
|
||||||
|
|
||||||
if (player is null) return;
|
if (player is null) return;
|
||||||
|
|||||||
Reference in New Issue
Block a user