This commit is contained in:
sam 2024-09-03 00:07:12 +02:00
commit b3bf3a7c16
Signed by: sam
GPG key ID: B4EF20DDE721CAA1
43 changed files with 2057 additions and 0 deletions

View file

@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\Foxcord\Foxcord.csproj" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Serilog" Version="4.0.1" />
<PackageReference Include="Serilog.Sinks.Console" Version="6.0.0" />
</ItemGroup>
</Project>

25
FoxcordTest/Program.cs Normal file
View file

@ -0,0 +1,25 @@
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);