public async Task Resume(CommandContext ctx) { if (ctx.Member.VoiceState == null || ctx.Member.VoiceState.Channel == null) { await ctx.RespondAsync("You are not in a vc."); return; } LavalinkNodeConnection node = ctx.Client.GetLavalink().ConnectedNodes.Values.First(); LavalinkGuildConnection conn = node.GetGuildConnection(ctx.Member.VoiceState.Guild); if (conn == null) { await ctx.RespondAsync("Lavalink not connected"); return; } if (conn.CurrentState.CurrentTrack == null) { await ctx.RespondAsync("Nothing playing"); return; } await conn.ResumeAsync(); await ctx.RespondAsync("Resuming"); }
public async Task Resume(CommandContext ctx) { LavalinkNodeConnection lavalinkNodeConnection = await Connections.GetNodeConnection(ctx); LavalinkGuildConnection lavalinkGuildConnection = lavalinkNodeConnection.GetGuildConnection(ctx.Guild); await lavalinkGuildConnection.ResumeAsync(); Messaging messaging = new Messaging(ctx); await messaging.RespondContent()("▶️ Resumed."); }
public async Task Play(CommandContext context) { if (context.Channel.Id == BotClient.configJson.ComandosBotCanalId) { guildConnection = BotClient.LavalinkNode.GetGuildConnection(await BotClient.Lavalink.Client.GetGuildAsync(BotClient.configJson.ServerId).ConfigureAwait(false)); if (!BotClient.IsSongPlaying && guildConnection != null) { await guildConnection.ResumeAsync().ConfigureAwait(false); await context.RespondAsync($"Ok {context.User.Username}! Musica resumida!").ConfigureAwait(false); BotClient.IsSongPlaying = true; } else { await context.RespondAsync($"{context.User.Username} a música ja está tocando!").ConfigureAwait(false); } } }