$guildShardID will return the current shard ID.
$guildShardID
This will return the current shard ID:
1client.command({2 name: "guildShardID",3 code: `4 I'm currently on shard $guildShardID!5 `6});