Music Library

This commit is contained in:
2022-04-09 09:06:54 +03:00
parent cbd835c243
commit 3d4c9ae9ea
12 changed files with 308 additions and 21 deletions

37
MusicCommands/Leave.cs Normal file
View File

@@ -0,0 +1,37 @@
using Discord.Commands;
using Discord.WebSocket;
using PluginManager.Interfaces;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace CMD_Utils.Music
{
class Leave : DBCommand
{
public string Command => "leave";
public string Description => "Leave the voice channel";
public string Usage => "leave";
public bool canUseDM => false;
public bool canUseServer => true;
public bool requireAdmin => false;
public async void Execute(SocketCommandContext context, SocketMessage message, DiscordSocketClient client, bool isDM)
{
if (Data.audioClient is not null && Data.voiceChannel is not null)
{
await Data.audioClient.StopAsync();
await Data.voiceChannel.DisconnectAsync();
}
}
}
}