Commit Graph

3419 Commits

Author SHA1 Message Date
Quin Lynch
9ba64f62d1 Interaction Service Complex Parameters (#2155)
* Interaction Service Complex Parameters

* add complex parameters

* add complex parameters

* fix build errors

* add argument parsing

* add nested complex parameter checks

* add inline docs

* add preferred constructor declaration

* fix autocompletehandlers for complex parameters

* make GetConstructor private

* use flattened params in ToProps method

* make DiscordType of SlashParameter nullable

* add docs to Flattened parameters collection and move the GetComplexParameterCtor method

* add inline docs to SlashCommandParameterBuilder.ComplexParameterFields

* add check for validating required/optinal parameter order

* implement change requests

* return internal ParseResult as ExecuteResult

Co-Authored-By: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>

* fix merge errors

Co-authored-by: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>
2022-03-02 19:23:39 -04:00
CottageDwellingCat
1fb62de14b Support Sending Message Flags (#2131)
* Add message flags

* Add webhook message flags
2022-03-02 19:23:27 -04:00
Quin Lynch
b3370c33e2 Fix usage of CacheMode.AllowDownload in channels (#2154)
Co-Authored-By:  <25006819+sabihoshi@users.noreply.github.com>

Co-authored-by:  <25006819+sabihoshi@users.noreply.github.com>
2022-03-02 19:22:59 -04:00
Quin Lynch
6bf5818e72 Add IsInvitable and CreatedAt to threads (#2153)
* Add IsInvitable and CreatedAt to threads

* Update src/Discord.Net.Core/Entities/Channels/IThreadChannel.cs

Co-Authored-By: Jared L <48422312+lhjt@users.noreply.github.com>

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>
2022-03-02 19:22:29 -04:00
Quin Lynch
1dc473c7e4 Add Image property to Guild Scheduled Events (#2151)
* Add Image property to create and modify events

* Add CDN routes to get cover image

* Update banner names

* Update CDN.cs

* Update IGuildScheduledEvent.cs
2022-03-02 19:22:08 -04:00
Discord-NET-Robot
202554fdde [Robot] Add missing json error (#2152)
* Add 30046, 40004, 40060, 50068, 50086 Error codes

* Update src/Discord.Net.Core/DiscordErrorCode.cs

Co-authored-by: Discord.Net Robot <robot@elons.sweatshop.stop>
Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
2022-03-02 18:31:52 -04:00
Quin Lynch
5594739135 Clarify Users property on SocketGuildChannel (#2149) 2022-03-02 16:43:33 -04:00
EpicOfficer
8bcd3da9e4 Add self_video to VoiceState (#2137)
* Add self_video to VoiceState

* Update selfVideo flag
2022-03-02 16:27:29 -04:00
Cenk Ergen
3e52fab67b Add return statement to precondition handling (#2062) 2022-03-02 16:25:06 -04:00
Armano den Boef
a13dce2550 FAQ rework, replacing outdated info, better interaction FAQ (#2106)
* FAQ rework, replacing outdated info, better interaction faq

* Update docs/faq/basics/getting-started.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/faq/basics/getting-started.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/faq/int_framework/general.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* fix TOC reference

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>
Co-authored-by: Quin Lynch <lynchquin@gmail.com>
2022-03-02 16:24:34 -04:00
Ilay Nahman
b7f6db96ef Fix docs typos (#2119)
Changed frist to first and dont to don't
2022-03-02 15:09:57 -04:00
Duke
1fc07e742f Guides for Serilog and EFCore (#2134)
* Add serilog guide

* added suggestions from Rozen

* Add efcore guide

* Fix review changes

* Fix grammatical errors & review points
2022-03-02 15:08:51 -04:00
Almighty-Shogun
7d8911bfed Fixed documentation typo's (#2127)
* Fixed typo at line 39

On this code example for the documentation there was a typo on the README.md file at line 39. There was an `;` where there should not be one.

The code that had the typo:

```cs
var tb = new TextInputBuilder()
    .WithLabel("Labeled")
    .WithCustomId("text_input")
    .WithStyle(TextInputStyle.Paragraph)
    .WithMinLength(6); // This ";" does not belong here.
    .WithMaxLength(42)
    .WithRequired(true)
    .WithPlaceholder("Consider this place held.");
```

* Changed `ExecuteAsync` to `ExecuteCommandAsync`

`_interactionService.ExecuteAsync(ctx, serviceProvider);` cannot be executed because the method `ExecuteAsync` does not exists.

* Changed `componBuild()` to `components.Build()`
2022-03-02 15:07:15 -04:00
d4n
f601e9bc34 Fix context menu comand message type (#2128) 2022-03-02 15:06:29 -04:00
CottageDwellingCat
b95b94231c Fix NRE when ratelimmited requests don't return a body (#2135) 2022-03-02 15:03:10 -04:00
sabihoshi
553055b724 feat: Add FromDateTimeOffset in TimestampTag (#2146) 2022-03-02 14:46:51 -04:00
Quin Lynch
a1cfa41953 Fix stream access exception when ratelimited (#2117) 2022-02-16 11:13:36 -04:00
Quin Lynch
92445fb247 meta: bump version 2022-02-16 10:54:21 -04:00
Quin Lynch
84eeb780d1 Revert "Fixes unused creation of REST clients for DiscordShardedClient shards. (#2109)" (#2116)
This reverts commit 6039378c52.
2022-02-16 10:43:04 -04:00
Armano den Boef
1ffe9eeca9 Add DisplayAvatar to IGuildUser (#2115) 2022-02-16 09:49:55 -04:00
Armano den Boef
9a33aa4371 Update bugreport.yml (#2112)
Updates the bugreport format to include heading to the discussions for non-bug related issues
2022-02-16 09:11:40 -04:00
Quin Lynch
62d4598fc9 meta: bump version 2022-02-16 08:40:56 -04:00
Quin Lynch
b2598d37b6 fix: Implement correct ratelimit handles for 429's (#2110)
* init

* fix errors
2022-02-16 08:20:57 -04:00
Armano den Boef
abfba3c4bb Add DisplayName property to IGuildUser. (#2107) 2022-02-16 07:52:08 -04:00
Armano den Boef
169d54f1df Fix being unable to modify AllowedMentions with no embeds set.(#2108) 2022-02-16 07:51:40 -04:00
Armano den Boef
6039378c52 Fixes unused creation of REST clients for DiscordShardedClient shards. (#2109)
* Init

* Remove unnecessary length check

* Swap out for any check

* Final; Check if parentclient was passed
2022-02-16 07:51:15 -04:00
Quin Lynch
fad217e8bc Fix crosspost ratelimits (#2100) 2022-02-12 06:51:36 -04:00
Quin Lynch
503d32aa7e Update interaction summaries (#2099)
* init

* Update RestMessageComponentData.cs

* Update src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Rest/Entities/Interactions/RestApplicationCommandOption.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.WebSocket/Entities/Interaction/SocketBaseCommand/SocketApplicationCommand.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>
2022-02-12 06:51:14 -04:00
Sean
69da238a0f prefer shortened linq update (#2093) 2022-02-11 21:45:54 -04:00
Armano den Boef
01735c82fb Fix ToString() on CommandInfo (#2094) 2022-02-11 21:45:36 -04:00
Quin Lynch
7e1b8c9db0 Fix channel being null in DMs on Interactions (#2098) 2022-02-11 21:43:32 -04:00
Quin Lynch
0352374e74 meta: bump 3.3.0 2022-02-09 00:33:37 -04:00
Quin Lynch
c8f175e11a Feature: Implement modals (#2087)
* Implement Modals (#428)

* Socket Modal Support

* fix shareded client support

* Properly use `HasResponded` instead of `_hasResponded`

* `ModalBuilder` and `TextInputBuilder` validation.

* make orginisation more consistant.

* Rest Modals.

* Docs + add missing methods

* fix message signatures and missing abstract members

* modal changes

* um?????

* update modal docs

* update docs - again for some reason

* cleanup

* fix message signatures

* add modal commands support to interaction service

* Fix _hasResponded

* update to new unsupported standard.

* Sending modals with Interaction service.

* fix spelling in ComponentBuilder

* sending IModals when responding to interactions

* interaction service modals

* fix rest modals

* spelling and minor improvements.

* improve interaction service modal proformance

* use precompiled lambda for interaction service modals

* respect user compiled lambda choice

* changes to modals in the interaction service (more)

* support compiled lambdas in modal properties.

* modal interactions tweaks

* fix inline doc

* more modal docs

* configure responce to faild modal component

* init

* solve runtime errors

* solve build errors

* add default value parsing

* make modal info caching static

* make ModalUtils static

* add inline docs

* fix build errors

* code cleanup

* Introduce Required and Label properties as seperate attributes.

* replace internal dictionary of ModalInfo with a list

* change input building logic of modals

* update RespondWithModalAsync method

* add initial value parameter back to ModalTextInput and fix optional modal field

* add missing inline docs

* dispose the reference modal instance after building

* code cleanup on modalcommandbuilder

* Update docs/guides/int_basics/message-components/text-input.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/message-components/text-input.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_basics/modals/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_framework/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_framework/intro.md

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update docs/guides/int_framework/samples/intro/modal.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/MessageComponents/IComponentInteractionData.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/MessageComponents/TextInputComponent.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/IModalInteraction.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Core/Entities/Interactions/Modals/ModalBuilder.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Interactions/Attributes/Commands/ModalInteractionAttribute.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Interactions/Attributes/Modals/RequiredInputAttribute.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.Interactions/InteractionServiceConfig.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.WebSocket/Entities/Interaction/MessageComponents/SocketMessageComponentData.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Update src/Discord.Net.WebSocket/Entities/Interaction/Modals/SocketModalData.cs

Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* update interaction service modal docs

* implements ExitOnMissingmModalField config option and adds Type field to modal info

* Add WithValue to text input builders

* Fix rare NRE on component enumeration

* Fix RequestOptions being required in some methods

* Use 'OfType' instead of 'Where'

* Remove android unsported warning

* Change publicity of properties in IInputComponeontBuilder.cs

Co-authored-by: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>
Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>

* Remove complex parameter ref

Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com>
Co-authored-by: Cenk Ergen <57065323+Cenngo@users.noreply.github.com>
Co-authored-by: Jared L <48422312+lhjt@users.noreply.github.com>
2022-02-09 00:17:56 -04:00
Quin Lynch
33efd8981d Add support for attachments (#2088)
* Enforce valid button styles

* support command option type 11

* missing '.'

* Added type converter.

Co-authored-by: Cat <lumitydev@gmail.com>
Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com>

Co-authored-by: FeroxFoxxo <feroxfoxxo@gmail.com>
Co-authored-by: Cat <lumitydev@gmail.com>
Co-authored-by: CottageDwellingCat <80918250+CottageDwellingCat@users.noreply.github.com>
2022-02-09 00:13:15 -04:00
Quin Lynch
d142710d2a fix guild feature enum (#2089) 2022-02-09 00:12:54 -04:00
Quin Lynch
6290f75359 Fix attempts to fetch channels in interactions (#2090)
* fix attempts to fetch channels in interactions

* remove test case
2022-02-09 00:12:41 -04:00
Quin Lynch
97e54e1047 Feature: Allow modifying attachments on interactions and extend the module base (#2091) 2022-02-09 00:12:22 -04:00
Quin Lynch
b424bb2019 Fix Current user null on reconnect (#2092) 2022-02-09 00:12:07 -04:00
Quin Lynch
75e94feab0 Add IEnumerable collection parameters instead of arrays for MessageExtensions (#2079) 2022-02-08 21:45:48 -04:00
Armano den Boef
0a672addcf Create bugreport.yml (#2080)
* Create bugreport.yml

Grabbed from Discord.Net-Labs, original by @CottageDwellingCat

* Append faq link

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

* Append migration guide

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

* Append version change

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

* Append body

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

* Fix 5/???

smh I was tired when I committed this and didnt bother making changes assuming it was already good :'')

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>

Co-authored-by: Quin Lynch <49576606+quinchs@users.noreply.github.com>
2022-02-08 21:44:55 -04:00
AlFas
43b20bc73e Simplify code in DiscordComparers (#1713) 2022-02-03 14:34:39 -04:00
Armano den Boef
b45aebf506 fix: Rest message components cannot pass through execute method (#2076)
Line 60 should be equal to line 42 here. Currently rest interactions cant execute the messagecomponent handlers.
2022-02-03 14:04:23 -04:00
Armano den Boef
7d6f4f3b6c fix: Clone being created on updated entity (#2077)
* Patch clone being created on updated entity

* Clone globaluser as its not within the same instance

* Clone the globaluser alongside the guilduser

* Patch, non-assigned

* Update user entities for globaluser setter
2022-02-03 14:03:22 -04:00
quin lynch
9116c9a97c meta: changelog 2022-01-30 03:19:07 -04:00
quin lynch
e19ad2832a Merge branch 'dev' of https://github.com/discord-net/Discord.Net into dev 2022-01-30 03:10:41 -04:00
quin lynch
fddaac9a21 meta: bump version 2022-01-30 03:10:29 -04:00
Quin Lynch
09eb9facba Fix thread member download on create (#2072) 2022-01-30 03:09:41 -04:00
Quin Lynch
82f3879aaf Fix logging a TaskCanceledException out of users control (#2030) 2022-01-30 02:55:32 -04:00
Cenk Ergen
1917961ee3 Fix Channel Types Attribute (#2066)
* fix channeltypes attribute

* fix channeltypes attribute
2022-01-30 02:54:48 -04:00
Quin Lynch
37ada59639 Fix attempt to get application info for non-bot tokens (#2071) 2022-01-30 01:54:19 -04:00