private async Task SendHeartbeat(CancellationToken cancellationToken) { logger.LogInformation("Sending heartbeat"); var dataPayload = new GatewayDataPayload <int?> { Data = lastSequenceNumber, GatewayOpcode = Opcode.Heartbeat, }; await client.SendPayload(dataPayload, MaxSendPayload, cancellationToken); }
private async Task SendVoiceServerUpdate(ulong guildId, ulong channelId, CancellationToken cancellationToken) { var sendPayload = new GatewayDataPayload <VoiceState> { GatewayOpcode = Opcode.VoiceStateUpdate, Data = new VoiceState { GuildId = guildId, ChannelId = channelId, SelfMute = false, SelfDeaf = false, } }; await client.SendPayload(sendPayload, MaxSendPayload, cancellationToken); }
private async Task HelloRecievedSendIdentify(object sender, DataPayload <Hello> payload, CancellationToken cancellationToken) { logger.LogInformation("Hello Recieved"); await SendHeartbeat(cancellationToken); var sendPayload = new GatewayDataPayload <Identify> { Data = new Identify { GuildSubscriptions = false, Intents = Intent.GuildMessages | Intent.DirectMessages | Intent.GuildVoiceStates, Token = Configuration["discordtoken"] }, GatewayOpcode = Opcode.Identify }; await client.SendPayload(sendPayload, MaxSendPayload, cancellationToken); }
private Task Client_VoiceServerUpdateReceived(object sender, GatewayDataPayload <VoiceServerUpdate> voiceServerUpdatePayload, CancellationToken cancellationToken) { return(Task.CompletedTask); }