Browse Source

Remove connections sample

pull/1304/head
Still Hsu 6 years ago
parent
commit
4fd45f4683
2 changed files with 0 additions and 27 deletions
  1. +0
    -4
      docs/guides/concepts/connections.md
  2. +0
    -23
      docs/guides/concepts/samples/connections.cs

+ 0
- 4
docs/guides/concepts/connections.md View File

@@ -35,10 +35,6 @@ sync and has a completed guild cache.

[DiscordSocketClient]: xref:Discord.WebSocket.DiscordSocketClient

### Samples

[!code-csharp[Connection Sample](samples/events.cs)]

## Reconnection

> [!TIP]


+ 0
- 23
docs/guides/concepts/samples/connections.cs View File

@@ -1,23 +0,0 @@
using Discord;
using Discord.WebSocket;

public class Program
{
private DiscordSocketClient _client;
static void Main(string[] args) => new Program().MainAsync().GetAwaiter().GetResult();
public async Task MainAsync()
{
_client = new DiscordSocketClient();

await _client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("DiscordToken"));
await _client.StartAsync();

Console.WriteLine("Press any key to exit...");
Console.ReadKey();

await _client.StopAsync();
// Wait a little for the client to finish disconnecting before allowing the program to return
await Task.Delay(500);
}
}

Loading…
Cancel
Save