Because it's giving the error: "System.NullReferenceException: Object reference not set to an instance of an object.
at Violet.commands.CommonCommands.Ping(CommandContext ctx) in /home/kyorem/Documentos/Projects/Violet/commands/CommonCommands.cs:line 24" when I use the command? I wanted to get the ID and Ping of the shard that the user used the command.
#Sharding Ping and Id
1 messages · Page 1 of 1 (latest)
i have no idea what your sharding context does
simply use ctx.client
also guild can be null in case of dms
?
DSharpPlus.CommandsNext.CommandContext.Client
Summary
Gets the client which received the message.
Declaration
public DiscordClient Client { get; internal set; }
DSharpPlus.Utilities.GetShardId
Summary
Gets a shard id from a guild id and total shard count.
Declaration
public static int GetShardId
(
ulong guildId,
int shardCount
);
and
DSharpPlus.DiscordClient.GetConnectionLatency
Summary
Gets the latency in the connection to a specific guild.
Declaration
public TimeSpan GetConnectionLatency
(
ulong guildId
);
in versions before roughly 5.0.0-nightly-2300 the client represented one shard
you were automatically given the current shard
in versions after that, use what plerx linked
Hm, Should I update too then?
DSharpPlus.Clients.IShardOrchestrator.GetConnectionLatency
Summary
Gets the connection latency to a specific guild, otherwise known as ping.
Declaration
public abstract TimeSpan GetConnectionLatency
(
ulong guildId
);
This function to get the latency of the shard on the server didn't work, it didn't appear for me, I'm using the standard version 5.0.0.
standard version 5?
the nightlies have a suffix with a number
Yes, To work, should I update to nightly-02330?