foxcord/FoxcordTest/Program.cs

36 lines
1 KiB
C#
Raw Permalink Normal View History

2024-09-03 00:07:12 +02:00
using Foxcord.Gateway;
using Foxcord.Gateway.Events;
using Foxcord.Gateway.Events.Commands;
using Foxcord.Models;
2024-09-03 00:07:12 +02:00
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,
InitialPresence = new PresenceUpdateCommand
{
Activities = [new Activity("balls", ActivityType.Custom, State: "gay gay homosexual gay")]
},
IdentifyProperties = new IdentifyProperties
{
Browser = "Discord iOS"
}
2024-09-03 00:07:12 +02:00
});
await gateway.ConnectAsync();
await Task.Delay(-1);