Skip to content

Commit

Permalink
update (#24)
Browse files Browse the repository at this point in the history
* fix: limit request members batch size

Discord is actually enforcing v8 limits on v6 according to discord/discord-api-docs#2184

* fix: Missing AddReactions permission for DM channels. (discord-net#1244)

Co-authored-by: Samuel <33796679+Samrux@users.noreply.github.com>

* fix: GuildEmbed.ChannelId as nullable per API documentation (discord-net#1532)

* (ifcbrk) feature: Add includeRoleIds to PruneUsersAsync (discord-net#1581)

* Implemented include_roles for guilds/id/prune get&post

* Unnecessary using

Co-authored-by: Paulo <pnmanjos@hotmail.com>

* feature: Add "View Guild Insights" to GuildPermission (discord-net#1619)

* feature: Add "View Guild Insights" permission

* Add missing summary

Co-authored-by: Paulo <pnmanjos@hotmail.com>

* fix: Audio stream dispose (discord-net#1667)

* Fix audio dispose

* Missed a few

* feature: Add INVITE_CREATE and INVITE_DELETE events (discord-net#1491)

* Add invite events (create and delete)

* Removed unused using

* Fixing IInviteMetadata properties

* Add two new fields to the gateway event

* Better event summary and remarks

* Change how to assign to target variable

Co-Authored-By: Joe4evr <jii.geugten@gmail.com>

* Applying suggested changes to TargetUserType

* Renaming NotDefined to Undefined

* Fixing xml docs

* Changed the summary style format

Co-authored-by: Joe4evr <jii.geugten@gmail.com>

* feature: Add missing application properties (including Teams) (discord-net#1604)

* Add missing application properties

Add IsBotPublic, BotRequiresCodeGrant, and Team properties to IApplication

* To immutable list

* Change list to array

* feature: Add GetStreams to AudioClient (discord-net#1588)

* Added GetStreams

* Change return type

* Change return type on the interface

Co-authored-by: Paulo <pnmanjos@hotmail.com>

* fix: Crosspost throwing InvalidOperationException (discord-net#1671)

* Add INewsChannel

* Renaming variable to match the new type

* fix: Discord sends null when there's no team

* fix: Team is nullable, not optional (discord-net#1672)

* misc: Change ratelimit messages (discord-net#1678)

* misc: Missing summary tag

* fix: Emoji url encode (discord-net#1681)

* feature: Add missing properties to Guild and deprecate GuildEmbed (discord-net#1573)

* Add missing properties to Guild, related methods, and deprecate GuildEmbed endpoints

- Add missing guild properties: `discovery_splash`, `widget_enabled`, `widget_channel_id`, `rules_channel_id`, `max_presences`, `max_presences`, `max_members`, `public_updates_channel_id`, `max_video_channel_users`, `approximate_member_count`, `approximate_presence_count`
- Update guild properties: `embed_enabled`, `embed_channel_id`
- Add `GetGuildDiscoverySplashUrl` to `CDN`
- Add classes related to the guild widget
- Add `withCounts` parameter to `GetGuild(s)Async`
- Make GuildEmbed related methods obsolete with a message redirecting to widget ones

* Change xml docs and PremiumSubscriptionCount type

* Changed some xml docs

* fix: Revert PremiumSubscriptionCount type (discord-net#1686)

* feature: Implement gateway ratelimit (discord-net#1537)

* Implement gateway ratelimit

* Remove unused code

* Share WebSocketRequestQueue between clients

* Add global limit and a way to change gateway limits

* Refactoring variable to fit lib standards

* Update xml docs

* Update xml docs

* Move warning to remarks

* Remove specific RequestQueue for WebSocket and other changes

The only account limit is for identify that is dealt in a different way (exclusive semaphore), so websocket queues can be shared with REST and don't need to be shared between clients anymore.

Also added the ratelimit for presence updates.

* Add summary to IdentifySemaphoreName

* Fix spacing

* Add max_concurrency and other fixes

- Add session_start_limit to GetBotGatewayResponse
- Add GetBotGatewayAsync to IDiscordClient
- Add master/slave semaphores to enable concurrency
- Not store semaphore name as static
- Clone GatewayLimits when cloning the Config

* Add missing RequestQueue parameter and wrong nullable

* Add RequeueQueue paramater to Webhook

* Better xml documentation

* Remove GatewayLimits class and other changes

- Remove GatewayLimits
- Transfer a few properties to DiscordSocketConfig
- Remove unnecessary usings

* Remove unnecessary using and wording

* Remove more unnecessary usings

* Change named Semaphores to SemaphoreSlim

* Remove unused using

* Update branch

* Fix merge conflicts and update to new ratelimit

* Fixing merge, ignore limit for heartbeat, and dispose

* Missed one place and better xml docs.

* Wait identify before opening the connection

* Only request identify ticket when needed

* Move identify control to sharded client

* Better description for IdentifyMaxConcurrency

* Add lock to InvalidSession

* feature: Send presence on Identify payload (discord-net#1688)

* Send presence on identify

* Change CurrentUser presence

* feature: Add inline replies (discord-net#1659)

* Add inline replies

* Missed a few things

* Change xml docs, IUserMessage, and other changes

* Missed one when changing

* Fix referencedMessage author

* fix: Possible NullReferenceException when receiving InvalidSession (discord-net#1695)

* fix: UserMentions throwing NullRef

* fix: Wrong author for SocketUserMessage.ReferencedMessage

* fix: Rollback Activities to Game (discord-net#1702)

* docs: Update summary of SocketVoiceChannel.Users (discord-net#1714)

The inherited summary incorrectly stated that all users who _see_ the channel are returned when in reality only the ones _connected_ are.

* feature: Add max bitrate value to SocketGuild

* Update SocketGuild.cs

* Fix returns value docs

Signed-off-by: Still Hsu <dev@stillu.cc>

Co-authored-by: Still Hsu <dev@stillu.cc>

* fix: SocketGuild.HasAllMembers is false if a user left a guild (discord-net#1683)

* Fix: HasAllMembers is false if a user left

* Fix: Correct boolean logic

* Add new method of role ID copy

Signed-off-by: Still Hsu <5843208+Still34@users.noreply.github.com>

* Add missing asset

Signed-off-by: Still Hsu <5843208+Still34@users.noreply.github.com>

* Resolve inheritdocs warning

* Move bulk deletes remarks from <summary> to <remarks>

* Mark null as a specific langword in summary

* Cleanup GatewayReconnectException docs

* Update Docfx.Plugins.LastModified to v1.2.4

Signed-off-by: Still Hsu <5843208+Still34@users.noreply.github.com>

* Add updated libraries for LastModified

Signed-off-by: Still Hsu <5843208+Still34@users.noreply.github.com>

* Update project link

* Add initial StyleCops style enforcement

* Update framework version for tests to Core 3.1 to comply with LTS

* docs: Fix MaxWaitBetweenGuildAvailablesBeforeReady docs string

Signed-off-by: Still Hsu <dev@stillu.cc>

* docs: Add minor tweaks to DiscordSocketConfig docs strings

* docs: Fix the missing "In This Article" section

* Temporarily disable StyleCops until all the fixes are impl'd

* fix: Invite and InviteMetadata properties (discord-net#1639)

* fixes discord-net#1495

* keep obsolete properties and return types for compatibility

* missing properties for SocketInvite

* Restore xml docs and change obsolete message

Co-authored-by: Paulo <pnmanjos@hotmail.com>

* docs: Add alternative documentation link

* fix: IMessage.Embeds docs remarks

* fix: Move and fix internal AllowedMentions object (discord-net#1727)

* misc: VoiceRegions and related changes (discord-net#1720)

* feature: Add role tags (discord-net#1721)

* feature: Add user public flags (discord-net#1722)

* feature: Add MessageFlags and AllowedMentions to message modify (discord-net#1724)

* feature: Add MessageFlags and AllowedMentions to Modify

* Change exception message

* feature: Add GuildUser IsPending property (discord-net#1731)

* Implemented Pending property

* Implemented changes

* fix: Missing MessageReference when sending files

* meta: 2.3.0

* meta: Bump version to 2.3.1-dev

* fix: Deadlock in DiscordShardedClient when Ready is never received (discord-net#1761)

* fixed a deadlock in DiscordShardedClient during a failed Identify due to InvalidSession

* fixed log

* Don't wait ready before releasing semaphore

Co-authored-by: Paulo <pnmanjos@hotmail.com>

* fix: Private methods aren't added as commands (discord-net#1773)

Fix breaking change introduced by discord-net#1521

Co-authored-by: Samuel <33796679+orchidalloy@users.noreply.github.com>
Co-authored-by: Samuel <33796679+Samrux@users.noreply.github.com>
Co-authored-by: Matt Smith <me@mattthedev.codes>
Co-authored-by: Radka Gustavsson <radka.janek@redhat.com>
Co-authored-by: bakabaka.bunbun <54648150+bakabun@users.noreply.github.com>
Co-authored-by: Joe4evr <jii.geugten@gmail.com>
Co-authored-by: Jack Fox <0xdeadbeef1@gmail.com>
Co-authored-by: Joel Liechti <52202086+Joelius300@users.noreply.github.com>
Co-authored-by: vrachv <52053491+vrachv@users.noreply.github.com>
Co-authored-by: Still Hsu <dev@stillu.cc>
Co-authored-by: Daniel Baynton <49287178+230Daniel@users.noreply.github.com>
Co-authored-by: Still Hsu <5843208+Still34@users.noreply.github.com>
Co-authored-by: Fyers <Fyers@web.de>
Co-authored-by: quinchs <49576606+quinchs@users.noreply.github.com>
Co-authored-by: Yeba <31899118+yebafan@users.noreply.github.com>
Co-authored-by: Antonio Zdravkov Nikolov <antonioznikolov@gmail.com>
  • Loading branch information
17 people committed Feb 11, 2021
1 parent 579f59b commit fa0cd18
Show file tree
Hide file tree
Showing 161 changed files with 2,646 additions and 497 deletions.
5 changes: 2 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ publish/
# Publish Web Output
*.[Pp]ublish.xml
*.azurePubxml
# TODO: Comment the next line if you want to checkin your web deploy settings
# TODO: Comment the next line if you want to checkin your web deploy settings
# but database connection strings (with potential passwords) will be unencrypted
*.pubxml
*.publishproj
Expand All @@ -151,7 +151,6 @@ AppPackages/
# Others
*.[Cc]ache
ClientBin/
[Ss]tyle[Cc]op.*
~$*
*~
*.dbmdl
Expand Down Expand Up @@ -206,4 +205,4 @@ docs/api/\.manifest
\.idea/

# Codealike UID
codealike.json
codealike.json
91 changes: 91 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,96 @@
# Changelog

## [2.3.0] - 2021-01-28
### Added
- #1491 Add INVITE_CREATE and INVITE_DELETE events (1ab670b)
- #1520 Support reading multiple activities (421a0c1)
- #1521 Allow for inherited commands in modules (a51cdf6)
- #1526 Add Direction.Around to GetMessagesAsync (f2130f8)
- #1537 Implement gateway ratelimit (ec673e1)
- #1544 Add MESSAGE_REACTION_REMOVE_EMOJI and RemoveAllReactionsForEmoteAsync (a89f076)
- #1549 Add GetUsersAsync to SocketGuild (30b5a83)
- #1566 Support Gateway Intents (d5d10d3)
- #1573 Add missing properties to Guild and deprecate GuildEmbed (ec212b1)
- #1581 Add includeRoleIds to PruneUsersAsync (a80e5ff)
- #1588 Add GetStreams to AudioClient (1e012ac)
- #1596 Add missing channel properties (2d80037)
- #1604 Add missing application properties (including Teams) (10fcde0)
- #1619 Add "View Guild Insights" to GuildPermission (2592264)
- #1637 Added CultureInvariant RegexOption to WebhookUrlRegex (e3925a7)
- #1659 Add inline replies (e3850e1)
- #1688 Send presence on Identify payload (25d5d36)
- #1721 Add role tags (6a62c47)
- #1722 Add user public flags (c683b29)
- #1724 Add MessageFlags and AllowedMentions to message modify (225550d)
- #1731 Add GuildUser IsPending property (8b25c9b)
- #1690 Add max bitrate value to SocketGuild (aacfea0)

### Fixed
- #1244 Missing AddReactions permission for DM channels. (e40ca4a)
- #1469 unsupported property causes an exception (468f826)
- #1525 AllowedMentions and AllowedMentionTypes (3325031)
- #1531 Add AllowedMentions to SendFileAsync (ab32607)
- #1532 GuildEmbed.ChannelId as nullable per API documentation (971d519)
- #1546 Different ratelimits for the same route (implement discord buckets) (2f6c017)
- #1548 Incomplete Ready, DownloadUsersAsync, and optimize AlwaysDownloadUsers (dc8c959)
- #1555 InvalidOperationException at MESSAGE_CREATE (bd4672a)
- #1557 Sending 2 requests instead of 1 to create a Guild role. (5430cc8)
- #1571 Not using the new domain name. (df8a0f7)
- #1578 Trim token before passing it to the authorization header (42ba372)
- #1580 Stop TaskCanceledException from bubbling up (b8fa464)
- #1599 Invite audit log without inviter (b95b95b)
- #1602 Add AllowedMentions to webhooks (bd4516b)
- #1603 Cancel reconnection when 4014 (f396cd9)
- #1608 Voice overwrites and CategoryId remarks (43c8fc0)
- #1614 Check error 404 and return null for GetBanAsync (ae9fff6)
- #1621 Parse mentions from message payload (366ca9a)
- #1622 Do not update overwrite cache locally (3860da0)
- #1623 Invoke UserUpdated from GuildMemberUpdated if needed (3085e88)
- #1624 Handle null PreferredLocale in rare cases (c1d04b4)
- #1639 Invite and InviteMetadata properties (dd2e524)
- #1642 Add missing permissions (4b389f3)
- #1647 handicap member downloading for verified bots (fa5ef5e)
- #1652 Update README.MD to reflect new discord domain (03b831e)
- #1667 Audio stream dispose (a2af985)
- #1671 Crosspost throwing InvalidOperationException (9134443)
- #1672 Team is nullable, not optional (be60d81)
- #1681 Emoji url encode (04389a4)
- #1683 SocketGuild.HasAllMembers is false if a user left a guild (47f571e)
- #1686 Revert PremiumSubscriptionCount type (97e71cd)
- #1695 Possible NullReferenceException when receiving InvalidSession (5213916)
- #1702 Rollback Activities to Game (9d7cb39)
- #1727 Move and fix internal AllowedMentions object (4a7f8fe)
- limit request members batch size (084db25)
- UserMentions throwing NullRef (5ed01a3)
- Wrong author for SocketUserMessage.ReferencedMessage (1e9b252)
- Discord sends null when there's no team (05a1f0a)
- IMessage.Embeds docs remarks (a4d32d3)
- Missing MessageReference when sending files (2095701)

### Misc
- #1545 MutualGuilds optimization (323a677)
- #1551 Update webhook regex to support discord.com (7585789)
- #1556 Add SearchUsersAsync (57880de)
- #1561 Minor refactor to switch expression (42826df)
- #1576 Updating comments for privileged intents (c42bfa6)
- #1678 Change ratelimit messages (47ed806)
- #1714 Update summary of SocketVoiceChannel.Users (e385c40)
- #1720 VoiceRegions and related changes (5934c79)
- Add updated libraries for LastModified (d761846)
- Add alternative documentation link (accd351)
- Temporarily disable StyleCops until all the fixes are impl'd (36de7b2)
- Remove redundant CreateGuildRoleParams (3df0539)
- Add minor tweaks to DiscordSocketConfig docs strings (2cd1880)
- Fix MaxWaitBetweenGuildAvailablesBeforeReady docs string (e31cdc7)
- Missing summary tag for GatewayIntents (3a10018)
- Add new method of role ID copy (857ef77)
- Resolve inheritdocs for IAttachment (9ea3291)
- Mark null as a specific langword in summary (13a41f8)
- Cleanup GatewayReconnectException docs (833ee42)
- Update Docfx.Plugins.LastModified to v1.2.4 (28a6f97)
- Update framework version for tests to Core 3.1 to comply with LTS (4988a07)
- Move bulk deletes remarks from <summary> to <remarks> (62539f0)

## [2.2.0] - 2020-04-16
### Added
- #1247 Implement Client Status Support (9da11b4)
Expand Down
8 changes: 4 additions & 4 deletions Discord.Net.targets
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<VersionPrefix>2.3.0</VersionPrefix>
<VersionPrefix>2.3.1</VersionPrefix>
<VersionSuffix>dev</VersionSuffix>
<LangVersion>latest</LangVersion>
<Authors>Discord.Net Contributors</Authors>
<PackageTags>discord;discordapp</PackageTags>
<PackageProjectUrl>https://github.com/RogueException/Discord.Net</PackageProjectUrl>
<PackageProjectUrl>https://github.com/Discord-Net/Discord.Net</PackageProjectUrl>
<PackageLicenseUrl>http://opensource.org/licenses/MIT</PackageLicenseUrl>
<PackageIconUrl>https://github.com/RogueException/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png</PackageIconUrl>
<PackageIconUrl>https://github.com/Discord-Net/Discord.Net/raw/dev/docs/marketing/logo/PackageLogo.png</PackageIconUrl>
<RepositoryType>git</RepositoryType>
<RepositoryUrl>git://github.com/RogueException/Discord.Net</RepositoryUrl>
<RepositoryUrl>git://github.com/Discord-Net/Discord.Net</RepositoryUrl>
</PropertyGroup>
<PropertyGroup Condition=" '$(BuildNumber)' == '' ">
<VersionSuffix Condition=" '$(VersionSuffix)' != ''">$(VersionSuffix)-dev</VersionSuffix>
Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,12 @@

An unofficial .NET API Wrapper for the Discord client (https://discord.com).

Check out the [documentation](https://discord.foxbot.me/) or join the [Discord API Chat](https://discord.gg/jkrBmQR).
## Documentation

- [Stable](https://discord.foxbot.me/)
- Hosted by @foxbot
- [Nightly](https://docs.stillu.cc/)
- [Latest CI repo](https://github.com/discord-net/docs-static)

## Installation
### Stable (NuGet)
Expand Down
9 changes: 9 additions & 0 deletions StyleAnalyzer.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- <ItemGroup>
<PackageReference Include="StyleCop.Analyzers" Version="1.2.0-beta.205" PrivateAssets="all" />
</ItemGroup>
<PropertyGroup>
<EnforceCodeStyleInBuild>true</EnforceCodeStyleInBuild>
</PropertyGroup> -->
</Project>
Binary file not shown.
Binary file modified docs/_template/last-modified/plugins/LibGit2Sharp.dll
Binary file not shown.
6 changes: 3 additions & 3 deletions docs/_template/last-modified/plugins/LibGit2Sharp.dll.config
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<configuration>
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="git2-a904fc6" target="lib/linux-x64/libgit2-a904fc6.so" />
<dllmap os="osx" cpu="x86,x86-64" dll="git2-a904fc6" target="lib/osx/libgit2-a904fc6.dylib" />
<configuration>
<dllmap os="linux" cpu="x86-64" wordsize="64" dll="git2-ef5a385" target="lib/linux-x64/libgit2-ef5a385.so" />
<dllmap os="osx" cpu="x86,x86-64" dll="git2-ef5a385" target="lib/osx/libgit2-ef5a385.dylib" />
</configuration>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
3 changes: 2 additions & 1 deletion docs/_template/light-dark-theme/partials/affix.tmpl.partial
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@
</div>
{{/_disableContribution}}
<nav class="bs-docs-sidebar hidden-print hidden-xs hidden-sm affix" id="affix">
<!-- <p><a class="back-to-top" href="#top">Back to top</a><p> -->
<h5>{{__global.inThisArticle}}</h5>
<div></div>
</nav>
</div>
</div>
7 changes: 5 additions & 2 deletions docs/faq/basics/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ it will return the user ID of the aforementioned user.
Several common ways to do this:

1. Make the role mentionable and mention the role, and escape it
1. (Easiest) Right click on the role either in the Server Settings
or in the user's role list.
![Roles](images/role-copy.png)
2. Make the role mentionable and mention the role, and escape it
using the `\` character in front.
2. Inspect the roles collection within the guild via your debugger.
3. Inspect the roles collection within the guild via your debugger.
Binary file added docs/faq/basics/images/role-copy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion src/Discord.Net.Commands/Builders/ModuleClassBuilder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private static void BuildModule(ModuleBuilder builder, TypeInfo typeInfo, Comman
builder.Name = typeInfo.Name;

// Get all methods (including from inherited members), that are valid commands
var validCommands = typeInfo.GetMethods().Where(IsValidCommandDefinition);
var validCommands = typeInfo.GetMethods(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic).Where(IsValidCommandDefinition);

foreach (var method in validCommands)
{
Expand Down
1 change: 1 addition & 0 deletions src/Discord.Net.Commands/Discord.Net.Commands.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Discord.Net.targets" />
<Import Project="../../StyleAnalyzer.targets"/>
<PropertyGroup>
<AssemblyName>Discord.Net.Commands</AssemblyName>
<RootNamespace>Discord.Commands</RootNamespace>
Expand Down
5 changes: 3 additions & 2 deletions src/Discord.Net.Commands/ModuleBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,10 @@ public abstract class ModuleBase<T> : IModuleBase
/// Specifies if notifications are sent for mentioned users and roles in the <paramref name="message"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// </param>
protected virtual async Task<IUserMessage> ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null)
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
protected virtual async Task<IUserMessage> ReplyAsync(string message = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null)
{
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions).ConfigureAwait(false);
return await Context.Channel.SendMessageAsync(message, isTTS, embed, options, allowedMentions, messageReference).ConfigureAwait(false);
}
/// <summary>
/// The method to execute before executing the command.
Expand Down
6 changes: 5 additions & 1 deletion src/Discord.Net.Core/Audio/IAudioClient.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Discord.Audio
Expand All @@ -20,6 +21,9 @@ public interface IAudioClient : IDisposable
/// <summary> Gets the estimated round-trip latency, in milliseconds, to the voice UDP server. </summary>
int UdpLatency { get; }

/// <summary>Gets the current audio streams.</summary>
IReadOnlyDictionary<ulong, AudioInStream> GetStreams();

Task StopAsync();
Task SetSpeakingAsync(bool value);

Expand Down
23 changes: 22 additions & 1 deletion src/Discord.Net.Core/CDN.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ namespace Discord
/// </summary>
public static class CDN
{
/// <summary>
/// Returns a team icon URL.
/// </summary>
/// <param name="teamId">The team identifier.</param>
/// <param name="iconId">The icon identifier.</param>
/// <returns>
/// A URL pointing to the team's icon.
/// </returns>
public static string GetTeamIconUrl(ulong teamId, string iconId)
=> iconId != null ? $"{DiscordConfig.CDNUrl}team-icons/{teamId}/{iconId}.jpg" : null;

/// <summary>
/// Returns an application icon URL.
/// </summary>
Expand Down Expand Up @@ -62,11 +73,21 @@ public static string GetGuildIconUrl(ulong guildId, string iconId)
/// <param name="guildId">The guild snowflake identifier.</param>
/// <param name="splashId">The splash icon identifier.</param>
/// <returns>
/// A URL pointing to the guild's icon.
/// A URL pointing to the guild's splash.
/// </returns>
public static string GetGuildSplashUrl(ulong guildId, string splashId)
=> splashId != null ? $"{DiscordConfig.CDNUrl}splashes/{guildId}/{splashId}.jpg" : null;
/// <summary>
/// Returns a guild discovery splash URL.
/// </summary>
/// <param name="guildId">The guild snowflake identifier.</param>
/// <param name="discoverySplashId">The discovery splash icon identifier.</param>
/// <returns>
/// A URL pointing to the guild's discovery splash.
/// </returns>
public static string GetGuildDiscoverySplashUrl(ulong guildId, string discoverySplashId)
=> discoverySplashId != null ? $"{DiscordConfig.CDNUrl}discovery-splashes/{guildId}/{discoverySplashId}.jpg" : null;
/// <summary>
/// Returns a channel icon URL.
/// </summary>
/// <param name="channelId">The channel snowflake identifier.</param>
Expand Down
1 change: 1 addition & 0 deletions src/Discord.Net.Core/Discord.Net.Core.csproj
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
<Project Sdk="Microsoft.NET.Sdk">
<Import Project="../../Discord.Net.targets" />
<Import Project="../../StyleAnalyzer.targets"/>
<PropertyGroup>
<AssemblyName>Discord.Net.Core</AssemblyName>
<RootNamespace>Discord</RootNamespace>
Expand Down
9 changes: 6 additions & 3 deletions src/Discord.Net.Core/Entities/Channels/IMessageChannel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,12 @@ public interface IMessageChannel : IChannel
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
/// </returns>
Task<IUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null);
Task<IUserMessage> SendMessageAsync(string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
/// <summary>
/// Sends a file to this message channel with an optional caption.
/// </summary>
Expand Down Expand Up @@ -63,11 +64,12 @@ public interface IMessageChannel : IChannel
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
/// </returns>
Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
Task<IUserMessage> SendFileAsync(string filePath, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);
/// <summary>
/// Sends a file to this message channel with an optional caption.
/// </summary>
Expand Down Expand Up @@ -96,11 +98,12 @@ public interface IMessageChannel : IChannel
/// Specifies if notifications are sent for mentioned users and roles in the message <paramref name="text"/>.
/// If <c>null</c>, all mentioned roles and users will be notified.
/// </param>
/// <param name="messageReference">The message references to be included. Used to reply to specific messages.</param>
/// <returns>
/// A task that represents an asynchronous send operation for delivering the message. The task result
/// contains the sent message.
/// </returns>
Task<IUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null);
Task<IUserMessage> SendFileAsync(Stream stream, string filename, string text = null, bool isTTS = false, Embed embed = null, RequestOptions options = null, bool isSpoiler = false, AllowedMentions allowedMentions = null, MessageReference messageReference = null);

/// <summary>
/// Gets a message from this message channel.
Expand Down
9 changes: 9 additions & 0 deletions src/Discord.Net.Core/Entities/Channels/INewsChannel.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
namespace Discord
{
/// <summary>
/// Represents a generic news channel in a guild that can send and receive messages.
/// </summary>
public interface INewsChannel : ITextChannel
{
}
}
22 changes: 22 additions & 0 deletions src/Discord.Net.Core/Entities/Gateway/BotGateway.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
namespace Discord
{
/// <summary>
/// Stores the gateway information related to the current bot.
/// </summary>
public class BotGateway
{
/// <summary>
/// Gets the WSS URL that can be used for connecting to the gateway.
/// </summary>
public string Url { get; internal set; }
/// <summary>
/// Gets the recommended number of shards to use when connecting.
/// </summary>
public int Shards { get; internal set; }
/// <summary>
/// Gets the <see cref="SessionStartLimit"/> that contains the information
/// about the current session start limit.
/// </summary>
public SessionStartLimit SessionStartLimit { get; internal set; }
}
}
Loading

0 comments on commit fa0cd18

Please sign in to comment.