foxcord/FoxcordTest/Program.cs

36 lines
No EOL
1 KiB
C#

using Foxcord.Gateway;
using Foxcord.Gateway.Events;
using Foxcord.Gateway.Events.Commands;
using Foxcord.Models;
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"
}
});
await gateway.ConnectAsync();
await Task.Delay(-1);