Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
fd37d78
rearrange rest request objects
akiraveliara Apr 24, 2023
525a0ea
the ratelimit buckets are no longer bloatware
akiraveliara Apr 24, 2023
9701b2f
the arrival of the -gods- new ratelimiter
akiraveliara Apr 24, 2023
b064e54
de-bloat the bucket even further and get rid of S.R.IS inclusion
akiraveliara Apr 30, 2023
cdeed94
kill dead code and reformat SessionBucket
akiraveliara Apr 30, 2023
b32241f
clean up the rest client
akiraveliara Apr 30, 2023
b10c235
update BadRequestException throwing
akiraveliara May 11, 2023
6993ee1
throw UnauthorizedExceptions correctly
akiraveliara May 11, 2023
ca528c9
use the regex generator
akiraveliara May 11, 2023
f530537
finish up the exceptions
akiraveliara May 11, 2023
a87da58
Merge branch 'master' into fix/consolidate-rest
akiraveliara May 17, 2023
be25fbd
administer file scoped namespaces upon DiscordApiClient.cs
akiraveliara May 17, 2023
290a4fc
sort endpoints alphabetically
akiraveliara May 17, 2023
7f9473b
format and update the DiscordApiClient prelude
akiraveliara May 17, 2023
3d04168
make QueryUriBuilder fit for the purpose
akiraveliara May 17, 2023
dfb8c82
fix merge conflict
akiraveliara Jun 18, 2023
6e2ee27
fix another merge conflict
akiraveliara Jun 18, 2023
58e4f13
dotnet format
akiraveliara Jun 18, 2023
1ba6fd4
target-typed new
akiraveliara Jun 18, 2023
a283987
missed another merge conflict
akiraveliara Jun 18, 2023
a986a7d
update DiscordApiClient.cs, guild region, to the new system
akiraveliara Jun 20, 2023
ff04532
fix this url
akiraveliara Jun 20, 2023
a780a87
clean up stickers
akiraveliara Aug 29, 2023
e2aece4
Update first method
Plerx2493 Sep 19, 2023
4fe60c3
i knew i missed smth
Plerx2493 Sep 19, 2023
1586c5e
nullability on a payload
akiraveliara Sep 20, 2023
e2937a8
Region Channel reworked
Plerx2493 Sep 20, 2023
5f6cdd1
Merge remote-tracking branch 'upstream/fix/consolidate-rest' into fix…
Plerx2493 Sep 20, 2023
d9370f5
Region Threads reworked
Plerx2493 Sep 20, 2023
0e60d8e
Region Member reworked
Plerx2493 Sep 20, 2023
90a9682
Region Roles reworked
Plerx2493 Sep 20, 2023
7d0311d
Region Prune, GuildVarious, Invite, Connections, Voice, Webhooks rewo…
Plerx2493 Sep 20, 2023
cb0bf8f
Region Reactions, Emoji, Application Commands, Misc and the rest (pun…
Plerx2493 Sep 20, 2023
3651e92
nullability annotate the API client
akiraveliara Sep 20, 2023
2bf6806
Merge branch 'master' into fix/consolidate-rest
akiraveliara Sep 20, 2023
16c51d5
fix build errors in corelib
akiraveliara Sep 20, 2023
0e80848
fix a build error in the channel description tool
akiraveliara Sep 20, 2023
809dc1f
fix build errors for DSP.Rest
akiraveliara Sep 20, 2023
8971e55
dispose of JsonDocuments as required
akiraveliara Sep 20, 2023
0560be1
re-add Microsoft.SourceLink.GitHub back into project
inftord Sep 25, 2023
0b752a5
re-added sourcelink reference
akiraveliara Sep 25, 2023
a718b4d
fix more merge conflicts
akiraveliara Sep 25, 2023
34a616f
fix another merge conflict
akiraveliara Sep 25, 2023
eb8ae6e
use strings instead of uri in infra
akiraveliara Sep 25, 2023
fa0fd9a
Uris to strings and fix one outlier
Plerx2493 Sep 25, 2023
6d9a830
fix routes
akiraveliara Sep 25, 2023
3169650
actually set the base uri
akiraveliara Sep 25, 2023
0ed66aa
Use global Base_Uri
Plerx2493 Sep 25, 2023
a6001df
engineer the url manually
akiraveliara Sep 25, 2023
4262d7d
Merge branch 'fix/consolidate-rest' of https://github.com/dsharpplus/…
akiraveliara Sep 25, 2023
823c804
log uris correctly
akiraveliara Sep 25, 2023
d9f907d
erm
akiraveliara Sep 25, 2023
6de929a
correct the query uri builder
akiraveliara Sep 25, 2023
37af357
fix merge conflicts
akiraveliara Sep 29, 2023
78564b3
fix another conflict
akiraveliara Sep 29, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ indent_style = space

# XML project files
[*.{csproj,vbproj,vcxproj,vcxproj.filters,proj,projitems,shproj}]
indent_size = 2
indent_size = 4

# XML config files
[*.{props,targets,ruleset,config,nuspec,resx,vsixmanifest,vsct}]
Expand Down Expand Up @@ -105,6 +105,10 @@ dotnet_naming_symbols.async_methods.required_modifiers = async

# Don't force namespaces to match their folder names
dotnet_diagnostic.IDE0130.severity = none
dotnet_style_prefer_simplified_boolean_expressions = true:suggestion
dotnet_style_operator_placement_when_wrapping = beginning_of_line
tab_width = 4
end_of_line = crlf

###############################
# C# Coding Conventions #
Expand Down Expand Up @@ -180,3 +184,8 @@ csharp_space_between_method_call_empty_parameter_list_parentheses = false
# Wrapping preferences
csharp_preserve_single_line_statements = true
csharp_preserve_single_line_blocks = true
csharp_using_directive_placement = inside_namespace:silent
csharp_prefer_simple_using_statement = true:suggestion
csharp_style_prefer_method_group_conversion = true:silent
csharp_style_prefer_top_level_statements = true:silent
csharp_style_expression_bodied_local_functions = false:warning
4,342 changes: 2,171 additions & 2,171 deletions DSharpPlus.Rest/DiscordRestClient.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions DSharpPlus/Clients/BaseDiscordClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ public async Task<DiscordApplication> GetCurrentApplicationAsync()
/// </summary>
/// <returns></returns>
/// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception>
public Task<IReadOnlyList<DiscordVoiceRegion>> ListVoiceRegionsAsync()
=> this.ApiClient.ListVoiceRegionsAsync();
public async Task<IReadOnlyList<DiscordVoiceRegion>> ListVoiceRegionsAsync()
=> await this.ApiClient.ListVoiceRegionsAsync();

/// <summary>
/// Initializes this client. This method fetches information about current user, application, and voice regions.
Expand Down
6 changes: 4 additions & 2 deletions DSharpPlus/Clients/DiscordClient.WebSocket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -113,14 +113,16 @@ internal async Task InternalConnectAsync()
this._webSocketClient.MessageReceived += SocketOnMessage;
this._webSocketClient.ExceptionThrown += SocketOnException;

var gwuri = new QueryUriBuilder(this.GatewayUri)
QueryUriBuilder gwuri = new QueryUriBuilder(this.GatewayUri.ToString())
.AddParameter("v", "10")
.AddParameter("encoding", "json");

if (this.Configuration.GatewayCompressionLevel == GatewayCompressionLevel.Stream)
{
gwuri.AddParameter("compress", "zlib-stream");
}

await this._webSocketClient.ConnectAsync(gwuri.Build());
await this._webSocketClient.ConnectAsync(new Uri(gwuri.Build()));

Task SocketOnConnect(IWebSocketClient sender, SocketEventArgs e)
=> this._socketOpened.InvokeAsync(this, e);
Expand Down
102 changes: 51 additions & 51 deletions DSharpPlus/Clients/DiscordClient.cs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion DSharpPlus/Clients/DiscordWebhookClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public DiscordWebhookClient(IWebProxy proxy = null, TimeSpan? timeout = null, bo

var parsedTimeout = timeout ?? TimeSpan.FromSeconds(10);

this._apiclient = new DiscordApiClient(proxy, parsedTimeout, useRelativeRateLimit, this.Logger);
this._apiclient = new DiscordApiClient(proxy, parsedTimeout, this.Logger);
this._hooks = new List<DiscordWebhook>();
this.Webhooks = new ReadOnlyCollection<DiscordWebhook>(this._hooks);
}
Expand Down
3 changes: 2 additions & 1 deletion DSharpPlus/DSharpPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Extensions.Caching.Memory" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Newtonsoft.Json" />
<PackageReference Include="Microsoft.Extensions.Logging.Abstractions" />
<PackageReference Include="Polly" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ public class DiscordAutoModerationRule : SnowflakeObject
/// Deletes the rule in the guild.
/// </summary>
/// <param name="reason">Reason for audits logs.</param>
public Task DeleteAsync(string reason = null)
=> this.Discord.ApiClient.DeleteGuildAutoModerationRuleAsync(this.GuildId, this.Id, reason);
public async Task DeleteAsync(string reason = null)
=> await this.Discord.ApiClient.DeleteGuildAutoModerationRuleAsync(this.GuildId, this.Id, reason);

/// <summary>
/// Modify the rule in the guild.
Expand Down
174 changes: 88 additions & 86 deletions DSharpPlus/Entities/Channel/DiscordChannel.cs

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions DSharpPlus/Entities/Channel/DiscordDmChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@ public string IconUrl
/// <exception cref="Exceptions.NotFoundException">Thrown when the channel does not exist.</exception>
/// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception>
/// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception>
public Task AddDmRecipientAsync(ulong user_id, string accesstoken, string nickname)
=> this.Discord.ApiClient.AddGroupDmRecipientAsync(this.Id, user_id, accesstoken, nickname);
public async Task AddDmRecipientAsync(ulong user_id, string accesstoken, string nickname)
=> await this.Discord.ApiClient.AddGroupDmRecipientAsync(this.Id, user_id, accesstoken, nickname);

/// <summary>
/// Only use for Group DMs!
Expand All @@ -62,7 +62,7 @@ public Task AddDmRecipientAsync(ulong user_id, string accesstoken, string nickna
/// <exception cref="Exceptions.NotFoundException">Thrown when the channel does not exist.</exception>
/// <exception cref="Exceptions.BadRequestException">Thrown when an invalid parameter was provided.</exception>
/// <exception cref="Exceptions.ServerErrorException">Thrown when Discord is unable to process the request.</exception>
public Task RemoveDmRecipientAsync(ulong user_id, string accesstoken)
=> this.Discord.ApiClient.RemoveGroupDmRecipientAsync(this.Id, user_id);
public async Task RemoveDmRecipientAsync(ulong user_id, string accesstoken)
=> await this.Discord.ApiClient.RemoveGroupDmRecipientAsync(this.Id, user_id);
}
}
Loading