Archived
0
0
Fork 0

feat: added automatic sharding via kubernetes

This commit is contained in:
Daryl Ronningen 2021-10-15 18:57:27 -07:00
parent 8b506d01b6
commit baf797d8c3
Signed by: Daryl Ronningen
GPG key ID: FD23F0C934A5EC6B
3 changed files with 17 additions and 12 deletions

View file

@ -56,8 +56,7 @@ namespace Sharpy.Commands.General
**Total RAM Usage**: {currentRamUsage}GB/{totalRamUsage}GB ({Math.Round(currentRamUsage / totalRamUsage * 100, 2)}%)")
.Build();
await ctx.CreateResponseAsync(InteractionResponseType.UpdateMessage,
new DiscordInteractionResponseBuilder().AddEmbed(embed));
await ctx.EditResponseAsync(new DiscordWebhookBuilder().AddEmbed(embed));
}
}
}

View file

@ -1,4 +1,7 @@
using System;
#if RELEASE
using System.Net;
#endif
using System.Threading.Tasks;
using DSharpPlus;
using DSharpPlus.Entities;
@ -40,6 +43,8 @@ var discord = new DiscordClient(new DiscordConfiguration
LogTimestampFormat = "MMM dd yyyy - hh:mm:ss tt",
MinimumLogLevel = LogLevel.Information,
ReconnectIndefinitely = false,
ShardCount = Convert.ToInt32(Dns.GetHostName().Substring(Dns.GetHostName().IndexOf('-') + 1)),
ShardId = Convert.ToInt32(Dns.GetHostName().Substring(Dns.GetHostName().IndexOf('-') + 1)),
Token = config.GetValue<string>("token"),
TokenType = TokenType.Bot,
});

View file

@ -33,16 +33,17 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="ByteSize" Version="2.1.0"/>
<PackageReference Include="DSharpPlus" Version="4.2.0-nightly-01024"/>
<PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0-nightly-01024"/>
<PackageReference Include="DSharpPlus.Lavalink" Version="4.2.0-nightly-01024"/>
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.2.0-nightly-01024"/>
<PackageReference Include="Hardware.Info" Version="1.1.1.1"/>
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.1.21451.13"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0-rc.1.21451.13"/>
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0-rc.1.21451.13"/>
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0-rc.1.21451.13"/>
<PackageReference Include="ByteSize" Version="2.1.0" />
<PackageReference Include="DSharpPlus" Version="4.2.0-nightly-01030" />
<PackageReference Include="DSharpPlus.Interactivity" Version="4.2.0-nightly-01030" />
<PackageReference Include="DSharpPlus.Lavalink" Version="4.2.0-nightly-01030" />
<PackageReference Include="DSharpPlus.SlashCommands" Version="4.2.0-nightly-01030" />
<PackageReference Include="Hardware.Info" Version="1.1.1.1" />
<PackageReference Include="Microsoft.Extensions.Configuration" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Binder" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.FileExtensions" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="Microsoft.Extensions.Configuration.Json" Version="6.0.0-rc.2.21480.5" />
<PackageReference Include="NATS.Client" Version="0.14.0-pre3" />
</ItemGroup>
<ItemGroup>