foxcord/FoxcordTest/Program.cs
2024-09-03 00:07:12 +02:00

25 lines
No EOL
685 B
C#

using Foxcord.Gateway;
using Serilog;
using Foxcord.Rest;
Log.Logger = new LoggerConfiguration()
.MinimumLevel.Verbose()
.WriteTo.Console()
.CreateLogger();
var client = new DiscordRestClient(Log.Logger, new DiscordRestClientOptions
{
Token = Environment.GetEnvironmentVariable("TOKEN")!
});
var gatewayBot = await client.GatewayBotAsync();
var gateway = new DiscordGatewayClient(Log.Logger, new DiscordGatewayClientOptions
{
Token = Environment.GetEnvironmentVariable("TOKEN")!,
Uri = gatewayBot.Url,
Intents = GatewayIntent.Guilds | GatewayIntent.GuildMessages | GatewayIntent.MessageContent
});
await gateway.ConnectAsync();
await Task.Delay(-1);