예제 #1
0
        public async Task End(CommandContext ctx)
        {
            var participants = lg.getParticipants(ctx.Guild);
            var userChannel  = await ctx.Member.CreateDmChannelAsync().ConfigureAwait(false);

            foreach (var u in participants)
            {
                await userChannel.SendMessageAsync($"{u.DisplayName} was at the beginnig").ConfigureAwait(false);
            }
            var vnext = ctx.Client.GetVoiceNext();

            var vnc = vnext.GetConnection(ctx.Guild);

            if (vnc == null)
            {
                throw new InvalidOperationException("Not connected in this guild.");
            }

            vnc.Disconnect();
        }