Skip to content
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

Merged
merged 4 commits into from Oct 20, 2018

Conversation

AntiTcb
Copy link
Collaborator

@AntiTcb AntiTcb commented Oct 19, 2018

Resolves #1118 .

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
Copy link
Member

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All [] references are not linked correctly. Add corresponding xrefs at the bottom of the section.

e.g.,

2. The [Connected], [Disconnected], [Ready], and [LatencyUpdated] events
...
[Connected]: xref:Discord.WebSocket.DiscordSocketClient.Connected

Current Snapshot

image


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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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

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
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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


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.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
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.

TotalShards = 2
};

var services = ConfigureServices();
Copy link
Member

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;
Copy link
Member

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.

Copy link
Collaborator Author

@AntiTcb AntiTcb Oct 19, 2018

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?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes.

@foxbot foxbot merged commit 00097d3 into discord-net:dev Oct 20, 2018
@AntiTcb AntiTcb deleted the shardedclient branch October 25, 2018 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants