New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add DiscordShardedClient sample project & Client FAQ entry. #1177
Conversation
docs/faq/basics/client-basics.md
Outdated
instances, with each one serving a different amount of guilds. | ||
|
||
Aside from a few noteworthy differences in some event names, and specifying the amount of shards to connect with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Run-on sentence; revision is recommended.
The main differences are: | ||
1. You need to specify the total amount of shards, or shard ids, via [DiscordShardedClient]'s constructors. | ||
2. The [Connected], [Disconnected], [Ready], and [LatencyUpdated] events |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
docs/faq/basics/client-basics.md
Outdated
|
||
Aside from a few noteworthy differences in some event names, and specifying the amount of shards to connect with | ||
in a [DiscordSocketConfig], there are very few differences from the [DiscordSocketClient] class, and it is very straightforward |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in a [DiscordSocketConfig], there are very few differences from the [DiscordSocketClient] class, and it is very straightforward | |
within a [DiscordSocketConfig], there are very few differences from the [DiscordSocketClient] class, and it is very straightforward |
docs/faq/basics/client-basics.md
Outdated
instances, with each one serving a different amount of guilds. | ||
|
||
Aside from a few noteworthy differences in some event names, and specifying the amount of shards to connect with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Aside from a few noteworthy differences in some event names, and specifying the amount of shards to connect with | |
Aside from a few noteworthy differences in some event names, and specifying the number of shards to connect with |
docs/faq/basics/client-basics.md
Outdated
|
||
If you do not wish to use the [DiscordShardedClient] and instead reuse the same [DiscordSocketClient] code and manually shard them, | ||
you can do so by specifiying the [ShardId] for the [DiscordSocketConfig] and pass that to the [DiscordSocketClient]'s constructor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can do so by specifiying the [ShardId] for the [DiscordSocketConfig] and pass that to the [DiscordSocketClient]'s constructor. | |
you can do so by specifying the [ShardId] for the [DiscordSocketConfig] and pass that to the [DiscordSocketClient]'s constructor. |
samples/03_sharded_client/Program.cs
Outdated
TotalShards = 2 | ||
}; | ||
|
||
var services = ConfigureServices(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
_client
is uninitiated at this point?
_discord = services.GetRequiredService<DiscordShardedClient>(); | ||
_services = services; | ||
|
||
_discord.MessageReceived += MessageReceivedAsync; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd probably move it under InitializeAsync
so it doesn't start processing before modules are discovered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"It" just being the handler attachment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes.
Resolves #1118 .