Commit Graph

2888 Commits

Author SHA1 Message Date
JustNrik
4259b8cb0c Update CommandAttribute.cs
Nullable<T> is not valid for Attributes, this is my suggested fix.
2018-08-29 17:07:17 +01:00
Still Hsu
db90eab953 Update README.md (#1117)
* Initial commit

* Add alternative suggestion

* Fix typo

* Update README.md
2018-08-20 18:27:50 -04:00
Joe4evr
748e92bcda Allow FromError(Exception) on all IResult types. 2018-08-09 17:39:37 +01:00
Joe4evr
2c3e9193c2 Implement ISnowflakeEntity for Audit Log entries 2018-08-09 17:34:26 +01:00
Christopher F
c1d78189e1 core: add PrioritySpeaker to Permissions 2018-08-01 15:09:46 -04:00
Joe4evr
5dad0fa1a1 Minor fixes around OnModuleBuilding (#1116)
* Don't attempt instantiation of an abstract module
* Attempt associating a TypeReader in case one is registered late (ie. OnModuleBuilding)
2018-08-01 10:10:21 -04:00
Casino Boyale
afc3a9d063 Added GetJumpUrl() as an extension method for IMessage (#1102)
* Added GetJumpUrl() as an IMessage extension method

* Removed extra line for consistency

* Moved the namespace from Discord.Commands to Discord

* lint: remove eof newline

* lint: use TextChannel to get GuildID
2018-07-20 20:31:30 -04:00
Finite Reality
aadd6f639f Add missing fields to new MemberInfo type (#1107) 2018-07-20 20:07:29 -04:00
Still Hsu
245806fe3d Initial refactor (#1103) 2018-07-11 20:44:00 -04:00
Still Hsu
b2f0043952 Fix typo in audit log interface declaration (#1104) 2018-07-10 19:32:29 -04:00
Christopher F
beb3d46e08 gateway: Ignore PRESENCES_REPLACE dispatch
This dispatch is undocumented and only used by user accounts.
2018-07-02 21:26:07 -04:00
Still Hsu
ffe994a9df Mark guild optional in invite & general invite improvement (#1094)
* Mark guild as optional for invite

* Mark partial InviteMetadata members as Optional<T>

* Some of them aren't sent when requesting through the general GET invite endpoint

* Remove GetInviteParams

* It was kinda stupid in the first place, might as well always get the count instead of having to ask the user whether they want the two fields filled or not.

* Add ChannelType property

* Add vanity invite support
2018-07-02 17:02:38 -04:00
HelpfulStranger999
4bc06a0a54 Patch lazy default readers not getting replaced (#1083) 2018-07-02 16:29:42 -04:00
ComputerMaster1st
322d46e47b Solved 4003 Authentication Error (Race Condition) (#1093)
* Solved 4003 Authentication Error (Race Condition)

* Set static interval & removed hello case
2018-06-22 21:20:53 -04:00
Builderb
aff4512fcd Update Discord.Net.Core.csproj (#1081) 2018-06-18 16:02:08 -04:00
HelpfulStranger999
033d31294f Creates full guild user object, resolves #1047 (#1078) 2018-06-18 16:00:40 -04:00
HelpfulStranger999
93878e4a90 Refactors an unused parameter in CommandService#Search (#1025) 2018-06-18 15:57:58 -04:00
NovusTheory
48fed064d4 Add missing VoiceServerUpdated event (#1089) 2018-06-16 23:34:12 -04:00
NovusTheory
890904f32c Allow external VoiceChannel client API implementation (#1057)
* ConnectAsync(bool external) API implemented

This allows developers to handle the AudioClient externally (for example with Lavalink)

* Modify ConnectAsync API and add DisconnectAsync to IAudioChannel

* Update summary message on IAudioChannel.DisconnectAsync()

* Review changes:
- Fix `if (!external)` styling
- Remove unecessary ConnectAsync overload

* SocketVoiceChannel overload update

* Update IAudioChannel.ConnectAsync()
- Remove ConfigAction from parameters
- Add SelfDeafen/SelfMute to parameters

* Remove SocketVoiceChannel.ConnectAsync() default params (Inherit)
2018-05-31 22:21:57 +01:00
HelpfulStranger999
3acf2a9a6b Refactors readMessages, fixing from #1033 (#1075) 2018-05-28 15:59:30 -04:00
Christopher F
513a489bf8 codefix: add VoiceAPIVersion constant to DiscordConfig 2018-05-28 15:45:42 -04:00
Christopher F
9ba38d7796 api: upgrade audio client to VoiceWS v3 2018-05-28 15:35:59 -04:00
Christopher F
64d8938ed5 fix: Discord does not always send the member on VOICE_STATE_UPDATE
some guilds aren't on g250k yet? not sure
2018-05-28 15:25:46 -04:00
FiniteReality
aeb3095593 Remove Debug.Print call causing tests to fail
Forgot to hit save properly... Whoops.
2018-05-28 17:48:38 +01:00
Christopher F
a718a7d3c2 cleanup: Remove ChannelHelper#IsNsfw
Closes #1074

This code was not referenced anywhere in the active codebase.
2018-05-28 12:45:49 -04:00
FiniteReality
0c7cb73b06 Fix permission-related ViewChannel tests 2018-05-28 17:41:05 +01:00
FiniteReality
415e2f7739 Fix analyzer warnings with tests
Use (actual, expected) format for Assert.Equal, fixes analyzer warnings
2018-05-28 17:14:18 +01:00
FiniteReality
b0042606b6 Move RpcCategoryChannel into the correct project 2018-05-28 17:13:59 +01:00
FiniteReality
683b3f2701 Mark ChannelHelper.IsNsfw Obsolete
Discord no longer treats channels prefixed with 'nsfw' as NSFW,
so we no longer need to have this check.
2018-05-28 17:12:28 +01:00
Christopher F
237ad0f867 Revert "fix: Properly rethrow exceptions in SocketGuild audio client"
This reverts commit adf4da19fc.

Someone hasn't written c# in a while
2018-05-27 18:00:51 -04:00
Christopher F
adf4da19fc fix: Properly rethrow exceptions in SocketGuild audio client 2018-05-27 17:56:14 -04:00
Christopher F
c0c565fd7e retain fallback case for if user is still null 2018-05-27 16:45:54 -04:00
Christopher F
8fb2c71814 Add new member objects to events 2018-05-27 16:37:17 -04:00
Chris Johnston
a06e21261c Fix ChannelPermissions Modify parameter to be correct default value (#1003)
* fix channel permissions modify parameter to use nullable boolean, correct default value

* Add general tests for the ChannelPermissions.Modify method to test default values

* remove unused cast in tests

* add guildpermission modify no param tests

* Add no-param modify tests for OverwritePermissions

* fix inconsistent parameters in GuildPermissions cstr

* Adjust formatting of methods and cstrs with many parameters

* remove temp file that was included. no idea what that is

* Fix System dependency

I should really stop fixing merge conflicts in the github website.
2018-05-26 14:15:09 -04:00
Chris Johnston
f9cbff5e42 Fix #995, Move Category Implementation from IGuildChannel to INestedChannel (#1004)
* Fix #995 ICategoryChannel.CategoryID throws NotSupportedException

* Add tests

* change run mode of TestChannelCategories

* Add throw for GetCategoryAsync

* Add xml doc explaining why exception is thrown

* Add test coverage for text and voice channel categories

* initial implementation of INestedChannel

* more implementation of INestedChannel design

* Add case in RestChannel Create for Category type

* set the CategoryID for RestVoiceChannel

* rewrite channel category tests to work with existing pattern

* remove outdated todo

* Make IVoiceChannel implement INestedChannel

* remove redundant interface implementation

* Add c#7 feature from feedback

* Remove redundant GetCategoryAsync methods from socket entities

* Added configureawait to async methods

* change signature of interface GetCategoryAsync

* Add check for cachemode in rest channel GetCategory

* remove redundant IGuildChannel interface from ITextChannel and IVoiceChannel
2018-05-26 14:06:35 -04:00
FiniteReality
4d8764e124 Refactor RoleInfo types into separate classes
- Fixes indentation with a few files (looks like a bad copy+paste job)
- Renames RoleInfo to RoleEditInfo
- Moves RoleInfo from MemberRoleAuditLogData into its own class

All of this should improve docs.
2018-05-26 14:11:49 +01:00
Chris Johnston
fa759a22ea Remove Build Warnings for Obsolete Guild Permission Read Messages (#1067)
- Replaces the usages of `ReadMessages` with `ViewChannel`
- Renames the read message parameters of `GuildPermissions#Modify` to be view channel as well
2018-05-25 09:38:59 -04:00
Hawx
bbbac85c46 Update Dependencies and support NS2.0 builds (#1046)
* Update deps, fix test warnings.

* Support ns2.0

* Fix typo

* Remove ns1.1 support

* Net.Http and Net.Websockets.Client are not needed in ns2.0

* Move to net46 per volt

* Remove ns1.3 constants
2018-05-25 08:14:28 -04:00
HelpfulStranger999
5f084adf94 Deprecates ReadMessages, introduces ViewChannel (#1033)
* Deprecates ReadMessages, introduces ViewChannel

* Adds period and comma somehow missed
2018-05-24 20:17:19 -04:00
Still Hsu
bc6009ec72 Implement IMessageChannel#DeleteMessageAsync (#996)
* Implement DeleteMessageAsync

* Refer to MessageHelper instead of duplicating call

* Fix refactor error
2018-05-24 20:08:51 -04:00
Chris Johnston
cee71ef35a Add support for parsing multiple types of quotation marks in commands, Fix #942 (#943)
* Add ability to support different types of quotation marks

* Added normal quotation mark to list of aliases, removed single quote mark

* clean up leftover changes from testing

* change quotation mark parsing to use a map of matching pairs

* remove commented out code

* Fix conventions of the command parser utility functions

* change storage type of alias dictionary to be IReadOnlyDictionary

* revert type of CommandServiceConfig QuotationMarkAliasMap to Dictionary

* minor formatting changes to CommandParser

* remove unnecessary whitespace

* Move aliases outside of CommandInfo class

* copy IReadOnlyDictionary to ImmutableDictionary

* minor syntax changes in CommandServiceConfig

* add newline before namespace for consistency

* newline formatting tweak

* simplification of GetMatch method for CommandParser

* add more quote unicode punctuation pairs

* add check for null value when building ImmutableDictionary

* Move default alias map into a separate source file

* Ensure that the collection passed into command service is not null
2018-05-24 20:07:37 -04:00
Joe4evr
b52af7ae7c Add a dedicated TimeSpan reader so it doesn't suck (#1005)
* Add a dedicated TimeSpan reader so it doesn't suck

* Pass input as lower case
2018-05-24 19:59:32 -04:00
o Acid Chicken (硫硫▒~E▒▒▒~O)
c275e57528 Add support casting System.Drawing.Color to Discord.Color
commit fa3303426766a59e7aa4d67e8b50826cfe7204ec
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sun Apr 29 13:50:56 2018 +0900

    Use built-in symbol

    refs: https://github.com/RogueException/Discord.Net/pull/1043#issuecomment-385223999

commit 27ea82668587960925b73f97c924c9d39ee71f7b
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sun Apr 29 11:29:31 2018 +0900

    Add support casting System.Drawing.Color to Discord.Color

commit 1ab9de24978ff24a018767f80dc95ba19b616988
Merge: f5bb99c7 a4d1e2bc
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sun Apr 29 10:16:46 2018 +0900

    Merge remote-tracking branch 'upstream/dev' into dev

commit f5bb99c77d0fecec21ad769778d17144c047d8b1
Merge: 3be8e40d b8b59d97
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Tue Apr 10 11:07:36 2018 +0900

    Merge remote-tracking branch 'upstream/dev' into dev

commit 3be8e40d3814fe8455af475b8641ee07a8f368d6
Merge: c692306f 9d77a3cd
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sun Jan 7 15:05:31 2018 +0900

    Merge remote-tracking branch 'upstream/dev' into dev

commit c692306fcc1e86ab92dd10683d3719f16c02a249
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sat Nov 11 10:49:00 2017 +0900

    Add target of the internal fields

commit 2d08f9a655b4949c1177f778d0f499047484a537
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sat Nov 11 10:17:42 2017 +0900

    Add some more extension

commit 4f19b835ffe8c64a93a9b4659e60b03ac797760f
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sat Nov 11 01:19:11 2017 +0900

    Add naming rules

commit af756cd9feb630baadbf6025cbb079cd9e1f45cb
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Sat Nov 11 00:35:30 2017 +0900

    Add basic .NET style rules

commit 503ece558b4f07bd8008157d3aeb6a4e7100d349
Author: Acid Chicken (硫酸鶏) <root@acid-chicken.com>
Date:   Fri Nov 10 22:36:52 2017 +0900

    Add EditorConfig
2018-05-24 19:52:25 -04:00
Christopher F
5023357a60 codefix #1020: RequestOptions should always be sorted last 2018-05-24 19:36:33 -04:00
Joe4evr
bf5275e071 Add ability to specify parameters on channel creation (#1020)
commit 07bca5b31a3580d55278878eabb56a82973f8c8f
Author: Joe4evr <jii.geugten@gmail.com>
Date:   Fri Apr 6 09:44:50 2018 +0200

    Add ability to specify parameters on channel creation
2018-05-24 19:36:00 -04:00
HelpfulStranger999
0ba8b063ad Makes text parameter of sending messages optional (#1042)
commit 114e5b431b26669bcdaac9f84792a216ad67186f
Author: HelpfulStranger999 <helpfulstranger999@gmail.com>
Date:   Sat Apr 28 19:08:35 2018 -0500

    Fixes lack of default value for tts

commit 1fd8c70c5346ff0c4fdb0093c0fc7fb4b3c8db2c
Author: HelpfulStranger999 <helpfulstranger999@gmail.com>
Date:   Sat Apr 28 15:21:11 2018 -0500

    Makes text parameter of sending messages optional
2018-05-24 19:23:44 -04:00
HelpfulStranger999
79811d0e61 Paginate reactions - solved #1007 (#1022)
* Cleaned up and refactored slightly

* Resolves #971

* Adds support for default avatars and resolves #971

* Amendment

* Final amendment

* Paginating reactions

* Amendments based on feedback

* Further amendment based on review

* Final(?) amendment

* Removes default limit and after user id

* Removes fromUserId; cleans up model creation; replaces function with individual parameters
2018-05-24 18:35:38 -04:00
Quahu
e764dafe08 Add ViewChannel to Voice channel permissions (#1059)
Previously, Voice channels did not have ViewChannel in their "all" permissions
2018-05-13 14:34:40 +01:00
Alex Gravely
32fc2df21b Remove unused field in EmbedFieldBuilder. (#1018) 2018-05-12 20:47:44 -04:00
Finite Reality
39dffe8585 Audit Logs implementation (#1055)
* Copy audit logs impl from old branch and clean up

I suck at using git, so I'm gonna use brute force.

* Remove unnecessary TODOs

Category channels do not provide any new information, and the other
I forgot to remove beforehand

* Add invite update data, clean up after feedback

* Remove TODOs, add WebhookType enum for future use

WebhookType is a future-use type, as currently audit logs are the only
thing which may return it.
2018-05-12 20:46:07 -04:00