Skip to content

Commit

Permalink
feat: Remove shardinfo-command.
Browse files Browse the repository at this point in the history
  • Loading branch information
itssimple committed Feb 2, 2024
1 parent 64e6b6f commit 076aa54
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 22 deletions.
36 changes: 18 additions & 18 deletions CFDiscordBot/Commands/DebugCommands.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,25 +15,25 @@ public async Task PingAsync()
await Context.Interaction.DeleteOriginalResponseAsync();
}

[SlashCommand("shardinfo", "Returns information about the shard")]
public async Task ShardInfoAsync()
{
var shardId = Context.Client.GetShardIdFor(Context.Guild);
var shard = Context.Client.GetShard(shardId);
// [SlashCommand("shardinfo", "Returns information about the shard")]
// public async Task ShardInfoAsync()
// {
// var shardId = Context.Client.GetShardIdFor(Context.Guild);
// var shard = Context.Client.GetShard(shardId);

var embed = new EmbedBuilder()
.WithTitle("Shard Information")
.WithDescription($"""
Shard ID: {shardId}
Guilds: {shard.Guilds.Count}
Users: {shard.Guilds.Sum(x => x.MemberCount)}
Channels: {shard.Guilds.Sum(x => x.Channels.Count)}
Latency: {shard.Latency}ms
""")
.WithColor(Color.Blue)
.Build();
// var embed = new EmbedBuilder()
// .WithTitle("Shard Information")
// .WithDescription($"""
//Shard ID: {shardId}
//Guilds: {shard.Guilds.Count}
//Users: {shard.Guilds.Sum(x => x.MemberCount)}
//Channels: {shard.Guilds.Sum(x => x.Channels.Count)}
//Latency: {shard.Latency}ms
//""")
// .WithColor(Color.Blue)
// .Build();

await RespondAsync(embeds: new[] { embed }, ephemeral: true);
}
// await RespondAsync(embeds: new[] { embed }, ephemeral: true);
// }
}
}
4 changes: 1 addition & 3 deletions CFDiscordBot/DiscordBot.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using CurseForge.APIClient;
using Discord;
using Discord;
using Discord.Interactions;
using Discord.WebSocket;
using Microsoft.Extensions.Hosting;
Expand All @@ -12,7 +11,6 @@ public partial class DiscordBot(
ILogger logger,
DiscordShardedClient discordClient,
string botToken,
ApiClient apiClient,
IServiceProvider serviceProvider
) : BackgroundService
{
Expand Down
1 change: 0 additions & 1 deletion CFDiscordBot/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ await Host.CreateDefaultBuilder(args)
x.GetRequiredService<ILogger<DiscordBot>>(),
x.GetRequiredService<DiscordShardedClient>(),
configuration["Discord:BotToken"]!,
x.GetRequiredService<ApiClient>(),
x
)
);
Expand Down

0 comments on commit 076aa54

Please sign in to comment.