Commit Graph

3179 Commits

Author SHA1 Message Date
Paulo
be60d813f7 fix: Team is nullable, not optional (#1672) 2020-11-09 15:39:08 -03:00
Paulo
05a1f0a709 fix: Discord sends null when there's no team 2020-11-09 12:31:17 -03:00
Paulo
9134443494 fix: Crosspost throwing InvalidOperationException (#1671)
* Add INewsChannel

* Renaming variable to match the new type
2020-11-08 19:29:15 -03:00
Jack Fox
1e012ac0b8 feature: Add GetStreams to AudioClient (#1588)
* Added GetStreams

* Change return type

* Change return type on the interface

Co-authored-by: Paulo <pnmanjos@hotmail.com>
2020-11-08 18:21:51 -03:00
Paulo
10fcde0a32 feature: Add missing application properties (including Teams) (#1604)
* Add missing application properties

Add IsBotPublic, BotRequiresCodeGrant, and Team properties to IApplication

* To immutable list

* Change list to array
2020-11-08 18:13:41 -03:00
Paulo
1ab670b3fc feature: Add INVITE_CREATE and INVITE_DELETE events (#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>
2020-11-08 17:33:37 -03:00
Paulo
a2af9857ca fix: Audio stream dispose (#1667)
* Fix audio dispose

* Missed a few
2020-11-07 16:15:46 -03:00
bakabaka.bunbun
2592264acb feature: Add "View Guild Insights" to GuildPermission (#1619)
* feature: Add "View Guild Insights" permission

* Add missing summary

Co-authored-by: Paulo <pnmanjos@hotmail.com>
2020-11-07 16:10:13 -03:00
Radka Gustavsson
a80e5ff940 (ifcbrk) feature: Add includeRoleIds to PruneUsersAsync (#1581)
* Implemented include_roles for guilds/id/prune get&post

* Unnecessary using

Co-authored-by: Paulo <pnmanjos@hotmail.com>
2020-11-07 15:55:14 -03:00
Matt Smith
971d519e35 fix: GuildEmbed.ChannelId as nullable per API documentation (#1532) 2020-11-07 15:44:33 -03:00
Samuel
e40ca4a422 fix: Missing AddReactions permission for DM channels. (#1244)
Co-authored-by: Samuel <33796679+Samrux@users.noreply.github.com>
2020-11-07 15:26:33 -03:00
Paulo
084db253f3 fix: limit request members batch size
Discord is actually enforcing v8 limits on v6 according to https://github.com/discord/discord-api-docs/issues/2184
2020-11-06 11:30:42 -03:00
Paulo
ae9fff6380 fix: Check error 404 and return null for GetBanAsync (#1614) 2020-10-28 18:03:08 -03:00
Paulo
bd4516b035 (ifcbrk) fix: Add AllowedMentions to webhooks (#1602) 2020-10-28 17:52:06 -03:00
Paulo
43c8fc0535 fix: Voice overwrites and CategoryId remarks (#1608)
* Add overwrites to voice and change CategoryId docs

* Let's not forget another one
2020-10-28 17:51:16 -03:00
Alex Howe
03b831e691 fix: Update README.MD to reflect new discord domain (#1652)
The first link does not point to the correct discord domain, it seems the commit that should have fixed this missed this link.
2020-10-28 15:26:48 -04:00
Paulo
f396cd9b92 fix: Cancel reconnection when 4014 (#1603)
* Cancel reconnection when 4014

* Missed an else
2020-10-14 18:23:00 -04:00
mathewsjwh
e3925a77a3 feature: Added CultureInvariant RegexOption to WebhookUrlRegex (#1637)
Co-authored-by: Jake Mathews <jwm5vv@virginia.edu>
2020-10-14 18:21:42 -04:00
Paulo
fa5ef5e1c6 fix: handicap member downloading for verified bots (#1647) 2020-10-14 18:20:30 -04:00
Paulo
4b389f3ecf fix: Add missing permissions (#1642) 2020-10-14 18:05:59 -04:00
Paulo
3085e883b7 fix: Invoke UserUpdated from GuildMemberUpdated if needed (#1623) 2020-10-14 18:05:35 -04:00
Paulo
3860da002f fix: Do not update overwrite cache locally (#1622) 2020-10-14 18:04:43 -04:00
Samuel
c1d04b4d1a fix: Handle null PreferredLocale in rare cases (#1624)
Sometimes Discord messes up and leaves a guild with a null PreferredLocale, causing an error to be thrown. This fixes that from Discord.Net's end even though it's Discord's fault.
2020-10-14 18:03:13 -04:00
Paulo
366ca9a562 fix: Parse mentions from message payload (#1621) 2020-10-14 18:02:33 -04:00
Bram
df8a0f7cd6 Fix: Not using the new domain name. (#1571)
* Fix: Using the correct discord domain.

* Fix: Using the correct discord domain.

* Docs: Using the correct discord domain.

* Fix: Changed canary and ptb to the new domain.
2020-09-04 17:56:05 +01:00
Paulo
b95b95bdcb fix: Invite audit log without inviter (#1599)
* Fix possible invite without inviter

* Prevent the same for InviteCreate

* Update Creator property docs
2020-08-05 20:16:59 -04:00
Paulo
2f6c0175c8 fix: Different ratelimits for the same route (implement discord buckets) (#1546)
* Don't disable when there's no resetTick

Sometimes Discord won't send any ratelimit headers, disabling the semaphore for endpoints that should have them.

* Undo changes and change comment

* Add HttpMethod to BucketIds

* Add X-RateLimit-Bucket

* BucketId changes

- BucketId is it's own class now
- Add WebhookId as a major parameter
- Add shared buckets using the hash and major parameters

* Add webhookId to BucketIds

* Update BucketId and redirect requests

* General bugfixes

* Assign semaphore and follow the same standard as Reset for ResetAfter
2020-08-05 20:16:21 -04:00
Paulo
421a0c12cc feature: support reading multiple activities (#1520) 2020-08-01 12:43:56 -04:00
Paulo
2d80037f6b feature: Add missing channel properties (#1596) 2020-08-01 01:26:24 -04:00
Paulo
42ba3720e3 fix: Trim token before passing it to the authorization header (#1578)
* Trim token

* Trim when assigning to AuthToken
2020-07-18 13:52:23 -04:00
Mustafa Salih ASLIM
468f8264d0 fix: unsupported property causes an exception (#1469)
fix for: https://github.com/discord-net/Discord.Net/issues/1436

`SlowModeInterval` property causes an exception for Announcement Channel feature if it is enabled on discord. Should be checked whether it is specified or not before set to property.
2020-07-10 00:13:46 -04:00
Paulo
b8fa464125 fix: Stop TaskCanceledException from bubbling up (#1580) 2020-07-10 00:13:01 -04:00
JT
4fa6393329 meta: Fix CI/CD (#1583)
* Update build.yml

* Update azure-pipelines.yml

* Update examples to NC3.1
2020-06-27 15:20:30 -04:00
moiph
c42bfa6f4f docs: updating comments for privileged intents (#1576)
* Updating comments for privileged intents

* Moving updated comments to remarks

* Formatting
2020-06-20 19:48:55 -04:00
Paulo
dc8c95931e fix: Incomplete Ready, DownloadUsersAsync, and optimize AlwaysDownloadUsers (#1548)
* Fix Ready and AlwaysDownloadUsers

Ready could fire before downloading all guild data and downloading guild users one guild per time without gateway intents is a waste of a gateway request that can support up to 1000.

* Reduce batchSize and fix count

* Fix typo

* Split xml docs line

Co-authored-by: Christopher Felegy <cfelegy@riseup.net>
2020-06-18 00:00:10 -04:00
OhB00
a51cdf60a2 feature: allow for inherited commands in modules (#1521) 2020-06-17 23:53:26 -04:00
Paulo
ab32607bcc (ifcbrk) fix: Add AllowedMentions to SendFileAsync (#1531)
* Add AllowedMentions to SendFileAsync

* Update xml reference and mocked channels
2020-06-17 23:51:50 -04:00
Paulo
f2130f8513 feature: Add Direction.Around to GetMessagesAsync (#1526)
* Add Direction.Around to GetMessagesAsync

* Reuse the method

* Reuse GetMany

* Fix limit when getting from cache without message id

* Fix limit when getting from rest without message id

* Change cache return

It will return in a similar way to REST
2020-06-17 23:48:45 -04:00
moiph
d5d10d32cf feature: Support Gateway Intents (#1566)
* Support Gateway Intents

Allows supplying gateway intents through DiscordSocketConfig which will be passed through the IDENTIFY payload, in order to choose what gateway events you want to receive.

* Fixing enum casing

* Feedback

* Updating comment for GuildSubscriptions

* Comment update
2020-06-17 23:40:10 -04:00
Christopher Felegy
5227241ba5 ci: force dotnet restore to run without cache 2020-06-16 00:59:16 -04:00
Paulo
3325031f04 fix: AllowedMentions and AllowedMentionTypes (#1525)
* Give proper values to flag enum

* Add zero value

* Initialize lists

* Update xml docs
2020-06-16 00:45:19 -04:00
Christopher Felegy
3df05399ea nit: remove redundant CreateGuildRoleParams
CreateGuildRoleParams is identical to ModifyGuildRoleParams, so just use
the latter when creating new roles.
2020-06-15 00:29:16 -04:00
Bram
5430cc8df9 fix: Sending 2 requests instead of 1 to create a Guild role. (#1557)
The GuildHelper.CreateRoleAsync() was sending 2 requests to create a role. One to create the role, and one to modify the role that was created. This can be done in one request. So i have moved it to a single request to lower the amount of requests send to the api. This will also solve issue #1451.
2020-06-15 00:11:05 -04:00
Paulo
a89f0761f4 feature: Add MESSAGE_REACTION_REMOVE_EMOJI and RemoveAllReactionsForEmoteAsync (#1544)
* Add event and method

* Simplify convert to IEmote
2020-06-15 00:04:34 -04:00
Joe4evr
42826df5e4 nit: minor refactor to switch expression (#1561) 2020-06-15 00:03:23 -04:00
Paulo
bd4672ae21 fix: InvalidOperationException at MESSAGE_CREATE (#1555)
## Summary

If PartyId isn't present, Discord.Net will throw an InvalidOperationException and not raise `MessageReceived`.
Got this a few times with my bot, stacktrace:
```
System.InvalidOperationException: This property has no value set.
   at Discord.Optional`1.get_Value() in ...\Discord.Net\src\Discord.Net.Core\Utils\Optional.cs:line 20
   at Discord.WebSocket.SocketMessage.Update(ClientState state, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketMessage.cs:line 157
   at Discord.WebSocket.SocketUserMessage.Update(ClientState state, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketUserMessage.cs:line 58
   at Discord.WebSocket.SocketUserMessage.Create(DiscordSocketClient discord, ClientState state, SocketUser author, ISocketMessageChannel channel, Message model) in ...\Discord.Net\src\Discord.Net.WebSocket\Entities\Messages\SocketUserMessage.cs:line 53
   at Discord.WebSocket.DiscordSocketClient.ProcessMessageAsync(GatewayOpCode opCode, Nullable`1 seq, String type, Object payload) in ...\Discord.Net\src\Discord.Net.WebSocket\DiscordSocketClient.cs:line 1210
```

After looking all properties, this is the only one that could be blamed and was already fixed for `RestMessage`s, see #1337 

## Changes

- `Value` to `GetValueOrDefault()` for `PartyId`
2020-06-15 00:02:51 -04:00
Paulo
57880de5b8 (ifcbrk) Add SearchUsersAsync (#1556) 2020-06-15 00:02:23 -04:00
Paulo
323a6775ee misc: MutualGuilds optimization (#1545)
* Check Dictionary

Check Dictionary instead of creating a new IReadOnlyCollection and looping in it

* Add Remark to MutualGuilds
2020-05-24 23:38:25 -04:00
Paulo
30b5a833d2 feature: Add GetUsersAsync to SocketGuild (#1549)
* Add GetUsersAsync to SocketGuild

* Fix IGuild return

* Do not download unless needed
2020-05-24 23:37:21 -04:00
moiph
758578955e misc: update webhook regex to support discord.com (#1551)
* Updating webhook regex for discord.com

Updates webhook URL regex matching for discordapp.com and discord.com

* Fixing comment

* Whitespace
2020-05-24 23:36:05 -04:00