foxcord/FoxcordTest/Program.cs

25 lines
685 B
C#
Raw Normal View History

2024-09-03 00:07:12 +02:00
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);