init
This commit is contained in:
commit
b3bf3a7c16
43 changed files with 2057 additions and 0 deletions
19
FoxcordTest/FoxcordTest.csproj
Normal file
19
FoxcordTest/FoxcordTest.csproj
Normal 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
25
FoxcordTest/Program.cs
Normal 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);
|
Loading…
Add table
Add a link
Reference in a new issue