Commit Graph

3064 Commits

Author SHA1 Message Date
Chris Johnston
794eba5d1a feature: Add ChannelFollowAdd MessageType (#1358)
Adds the new MessageType for system messages indicating that a webhook for a news channel has been added to a text channel.
2019-08-18 22:37:58 +00:00
Kieran Boyle
15b2a36790 [ci skip] Removed duplicate "any" from the readme (#1353) 2019-08-12 13:34:00 +01:00
Saulius Šaltenis
af79ed54a1 docs: Fixed a spelling error. (#1349) 2019-07-30 15:22:43 -04:00
Christopher Felegy
2981d6bd80 ci: build and deploy docs automatically
commit ed3dac1cc7cb57b00e158273ab1487d5fb3e4eb3
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:38:26 2019 -0400

    merge docs into Windows_deploy

commit de7768e2ff710cf183310e8d843cffb2e50285d4
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:31:12 2019 -0400

    clone via ssh

commit 3b25b4508ae1476d17d91e6394c5bacf2721a1fc
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:27:15 2019 -0400

    use proper \ in folder command

commit 6a78a662ab21681fce2d9186888e92a3790752c0
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:24:37 2019 -0400

    nugget

commit 13064a6184b63ebafda540514391301412407638
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:17:26 2019 -0400

    yes, i am sure

commit 604b784e64fbbe24d8111bbfc53d59016871b244
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:12:49 2019 -0400

    use proper \ in windows commands

commit dd3954071433a1c10f42e8510bb7961d20a089d1
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 21:09:35 2019 -0400

    install docfx.console from NuGetCommand

commit 769693d834921217a51e15ef4ad34d0d7d612b33
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 20:59:58 2019 -0400

    fix syntax error

commit c8c4ea5439610f0591edbc56ee17384f6e87a162
Author: Christopher Felegy <foxbot@protonmail.com>
Date:   Sun Jul 21 20:57:31 2019 -0400

    ci: build docs
2019-07-21 21:39:38 -04:00
gab
120c0f72cb fix: Remove null coalescing on ToEmbedBuilder Color (#1333)
Very simple change, removes the null coalescing operator on the EmbedBuilder's Color property in ToEmbedBuilder.
2019-06-29 19:10:10 -04:00
Casino Boyale
4edda5b729 fix: Fixed attempting to access a non-present optional value (#1337) 2019-06-29 19:09:01 -04:00
Chris Johnston
9da11b4184 [ifcbrk] feature: Implement Client Status Support (#1247)
* Implement Client Status Support

Adds support for using the client_status as sent as part of the Presence model. This value can be used to determine if a user is active on the native desktop app, the mobile app, or the website.

* lint: whitespace in IPresence

* Remove breaking change to IPresence interface with a note for 2.1

* update comment to not reference 2.1

* re-add interface break to IPresence

* add example payload for client_status

* use inline declaration for Enum.TryParse
2019-06-22 23:46:20 -04:00
Christopher Felegy
c870e672a2 debug: temporary sanity checking in SocketGuild 2019-06-22 17:03:59 -04:00
Casino Boyale
c88b1dada7 [ifcbrk] feature: id overload for RemoveReactionAsync (#1310)
* Added id overload for RemoveReactionAsync

* Fixed the docs strings
2019-06-21 17:35:40 -04:00
Chris Johnston
faf23dee35 [ifcbrk] feature: BOOST (#1319)
* add new MessageTypes

* Add new properties to the updated models

* add the SystemChannelMessageDeny

unsure if there would be a better name for this enum, given it's inverted nature, open for suggestions

* add PremiumTier flag, add Guild description property

* add method for getting vanity image from CDN

* make the size of GetGuildVanityUrl optional

* lint: remove commented out code from prev commit

* add a None flag to SystemChannelMessage enum

* implement the new modify guild params

* implement additional model properties in IGuild types

* implement GuildMember PremiumSince

* docs: reword size param explanation

* add extension methods that make it easier to check the SystemChannelMessage flags for end users

because the flag is inverted, this ideally should make it easier for the user. it may also be useful to do something similar for modifying this property

* docs: correct typo from copy-paste

* add the premium_subscription_count property

* fix vanity url code and banner switchup

a mistake was made somewhere, that's all I know for sure

* clarify remark on inverted logic for system channel flags

* fix PremiumSubscriptionCount optional value

* add another example to the systemchannelflags xmldoc remark

* docs: fix typos, clarify wording

* use DateTimeOffset for PremiumSince, follow conventions from other prop
2019-06-21 17:34:45 -04:00
Christopher Felegy
d6d4429c3d fix: include MessageFlags and SuppressEmbedParams 2019-06-21 17:27:00 -04:00
Still Hsu
363d1c6da6 docs: Fix invalid cref values in docs (#1329)
Signed-off-by: Still Hsu <341464@gmail.com>
2019-06-21 17:23:02 -04:00
Casino Boyale
9fede346d3 feature: Added a Rest property to DiscordShardedClient (#1326)
* Added a Rest property to DiscordShardedClient

* Moved the rest client onto the BaseSocketClient
2019-06-21 17:22:32 -04:00
Passive
c864f48c3b lint: Fix spelling mistake in ExclusiveBulkDelete warning (#1330) 2019-06-21 17:21:22 -04:00
Alex Gravely
0484fe8e9d docs: Change token explanation (#1331)
man I wish people read more
2019-06-21 17:20:19 -04:00
Christopher Felegy
cd288923c3 [ifcbrk] feature: suppress messages
yeah man I support the first amendment
2019-06-21 17:18:29 -04:00
Passive
1e8aa080ab Fix #1327 Color.ToString returns wrong value (#1328)
* Match debugger display value

https://github.com/discord-net/Discord.Net/issues/1327

* Use string.format to convert raw value to hex

* Remove nested string.format
2019-06-21 16:28:44 +01:00
Chris Johnston
a797be9ca0 test: Split Unit and Integration tests into separate projects (#1290)
* Squashed commit of test rewrite changes

fix missing priority speaker flag

rewrite the TestChannelPermissionModify test

add test for GuildPermission modify

separate unit and integration tests, start writing channel and guild permission tests

copy over the color tests

copy over the emote tests

copy the token utils tests

make the mocked entities sealed classes

copy the TypeReaderTests class

properly dispose the CommandService in the TypeReaderTests

start writing tests for EmbedBuilder and related classes

test that properties throw ArgumentException when invalid

add tests for the embed length property

add withFooter tests

finish adding tests to EmbedBuilder

fix bug in value validation of EmbedFieldBuilder

hey, these tests actually found a bug!

add tests for the MentionUtils class

add tests for the Format util class

remove all of the old tests

add analyzer tests (copied from old tests)

add tests for the SnowflakeUtils class

add integration tests

these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then

remove unnecessary launchSettings.json

update outdated string

don't create a new guild each time, as that can result in errors

this can happen if a bot creates too many guilds without properly deleting them

add some tests that show that guild can be modified

await async assert

add more measures that created channels are deleted when done

remove "Test" prefix from test method names

I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant

Remove mention of old test project

fix an issue from forgetting to await Assert.ThrowsAsync

explicitly disable parallelization on integration tests

add test for GuildPermission modify

separate unit and integration tests, start writing channel and guild permission tests

copy over the color tests

copy over the emote tests

make the mocked entities sealed classes

properly dispose the CommandService in the TypeReaderTests

fix bug in value validation of EmbedFieldBuilder

hey, these tests actually found a bug!

add tests for the MentionUtils class

add tests for the Format util class

remove all of the old tests

add analyzer tests (copied from old tests)

add tests for the SnowflakeUtils class

add integration tests

these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then

remove unnecessary launchSettings.json

update outdated string

don't create a new guild each time, as that can result in errors

this can happen if a bot creates too many guilds without properly deleting them

add more measures that created channels are deleted when done

remove "Test" prefix from test method names

I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant

Remove mention of old test project

fix an issue from forgetting to await Assert.ThrowsAsync

explicitly disable parallelization on integration tests

update the azure CI build script

separate execution of test projects so that if one fails the other will not pass

one of the unit tests failed, but the analzyer tests passed

fix test that would break in different timezones

enable the integration tests (only on dev branch)

* Squashed commit of test rewrite changes

fix missing priority speaker flag

rewrite the TestChannelPermissionModify test

add test for GuildPermission modify

separate unit and integration tests, start writing channel and guild permission tests

copy over the color tests

copy over the emote tests

copy the token utils tests

make the mocked entities sealed classes

copy the TypeReaderTests class

properly dispose the CommandService in the TypeReaderTests

start writing tests for EmbedBuilder and related classes

test that properties throw ArgumentException when invalid

add tests for the embed length property

add withFooter tests

finish adding tests to EmbedBuilder

fix bug in value validation of EmbedFieldBuilder

hey, these tests actually found a bug!

add tests for the MentionUtils class

add tests for the Format util class

remove all of the old tests

add analyzer tests (copied from old tests)

add tests for the SnowflakeUtils class

add integration tests

these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then

remove unnecessary launchSettings.json

update outdated string

don't create a new guild each time, as that can result in errors

this can happen if a bot creates too many guilds without properly deleting them

add some tests that show that guild can be modified

await async assert

add more measures that created channels are deleted when done

remove "Test" prefix from test method names

I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant

Remove mention of old test project

fix an issue from forgetting to await Assert.ThrowsAsync

explicitly disable parallelization on integration tests

add test for GuildPermission modify

separate unit and integration tests, start writing channel and guild permission tests

copy over the color tests

copy over the emote tests

make the mocked entities sealed classes

properly dispose the CommandService in the TypeReaderTests

fix bug in value validation of EmbedFieldBuilder

hey, these tests actually found a bug!

add tests for the MentionUtils class

add tests for the Format util class

remove all of the old tests

add analyzer tests (copied from old tests)

add tests for the SnowflakeUtils class

add integration tests

these get around the issue of state persisting between tests by creating and deleting a guild for each set of tests. these shouldn't be run excessively because of the rate limits, but should be fine every now and then

remove unnecessary launchSettings.json

update outdated string

don't create a new guild each time, as that can result in errors

this can happen if a bot creates too many guilds without properly deleting them

add more measures that created channels are deleted when done

remove "Test" prefix from test method names

I think that this prefix when already displayed under a class with a suffix of "Tests" is redundant

Remove mention of old test project

fix an issue from forgetting to await Assert.ThrowsAsync

explicitly disable parallelization on integration tests

update the azure CI build script

separate execution of test projects so that if one fails the other will not pass

one of the unit tests failed, but the analzyer tests passed

fix test that would break in different timezones

enable the integration tests (only on dev branch)

* Update mocked channels for changed SendFileAsync signature

* comment out the integration tests from the build script

no bot token is provided to this script, and use of integration tests in CI is questionable here

* force rebuild because Azure linux build broke
2019-06-12 16:08:03 -04:00
Chris Johnston
40844b9e13 feature(binbrk): Add properties missing from User and Activity models (#1237)
* WIP commit, update IActivity and IUser with missing types

* incomplete implementation of interfaces

* Add implementation of activity flags, and extension method to check flag

* remove usings that were not required

* clean up files and add documentation where missing

* remove unused usings

* Add remark saying that premium_type info may be inaccessible to bots

it seems that this information can not be accessed by any user,
and may require the identity oauth scope

* Add locale property to the user model

adds the locale property to the user model, which appears not to be
specified for bots

* rename ActivityFlags

* Add incomplete xmldoc to ActivityFlag

Added xmldoc to the ActivityFlag type, excluded flags that i was unsure about

* rename the UserFlags file

* Add incomplete xmldoc to UserFlag enum

* Remove unnecessary extension methods and use built-in functionality

* use <c> tag for xmldoc 'null's

* Add xmldoc for JoinRequest ActivityFlag

* improve the PremiumType xmldoc

* Add zero activityflag

* Add summary tag verbs, example of IUser locale

* Rename Flag enum types to use Properties suffix

* Expose the details field in the Game model

* update Activity extension methods to support Details field

* Use inherited Details implementation in RichGame

* lint: remove commented out code from debugging

* Fix issue in previous commit

* Move oauth-only user fields to SelfUser classes

Moves the implementation of the Flags, PremiumType, and Locale user fields to ISelfUser classes. In testing, it seemed that normal bot accounts did not have this information supplied to them. When tested with a Bearer token in the Rest client, these fields are set.

* remove old HypeSquadEvents flag that appears to have been replaced with the new HypeSquad flags
2019-06-12 16:00:30 -04:00
Christopher Felegy
10463cfdd2 meta: bump version to v2.2.0-dev, update CHANGELOG 2019-06-08 23:13:11 -04:00
Christopher Felegy
dfd82a5ab7 meta: v2.1.1 2019-06-08 20:14:45 -04:00
Christopher Felegy
d287ed1d4c fix: add EmbedTypeConverter with unknown handling
Prevents messages with an unknown EmbedType from failing to unmarshal
2019-06-08 19:40:07 -04:00
Casino Boyale
1cc5d7321b fix: fixed optionals having IsSpecified true when objects weren't in cache (#1323)
* Fixed optionals having IsSpecified true when objects weren't in cache

* Removed double null check
2019-06-06 16:22:34 -04:00
Christopher Felegy
2e95c4913b fix: ignore escape behavior on remainder parameters (#994)
Co-authored-by: Quahu <quahu@gmail.com>
2019-06-05 17:13:29 -04:00
Christopher Felegy
a8c853f1ec Revert "Merge remote-tracking branch 'quahu/dev' into dev"
This reverts commit 8fb0d5dc13, reversing
changes made to 3e65e03b85.
2019-06-05 17:11:06 -04:00
Christopher Felegy
8fb0d5dc13 Merge remote-tracking branch 'quahu/dev' into dev 2019-06-05 17:07:42 -04:00
Christopher Felegy
3e65e03b85 meta: bump Ix.Net to 3.2.0 2019-06-05 16:47:57 -04:00
Christopher Felegy
46da3523d0 docs: update TextChannelProperties to 6-hour slow mode 2019-06-05 16:37:55 -04:00
Chris Johnston
fc48c6606d feature: Disconnect guild members from voice channels (#1311)
* Feature: Disconnect users from voice channels

Updates GuildUserProperties to allow for setting either Channel or ChannelId to null, which will disconnect users from voice channels.

The type of ChannelId has been updated from a ulong to ulong?, which matches the latest api documentation.

* docs: update xmldoc wording

* breaking workaround, revert ChannelId to ulong

This is a workaround to prevent this PR from being a breaking
change. Reverts the type of GuildUserProperties#ChannelId to a
ulong from a ulong?. Guild Users may no longer be kicked by
setting this property to null, but setting
GuildUserProperties#Channel should still work.
2019-06-05 13:41:18 -04:00
Jyrka98
4433ca741b fix: Update maximum value for SlowModeInterval (#1320)
Discord allows the slow mode to be up to 6 hours.
2019-06-05 11:55:50 -04:00
Christopher Felegy
63ccd05faa lint: newline on Emote#GetHashCode 2019-06-04 14:05:59 -04:00
Tiago Cabral
1b54883896 fix: Changed Emote GetHashCode to not include Name (#1317)
Continuation of commit abf3e90 attempt to fix Emote comparisons,
as Hash comparisons are done before Equals in Comparers
2019-06-04 14:04:53 -04:00
Casino Boyale
abf3e905f2 fix: Changed Emote equals to not compare emote names (#1316)
In reference to what was discussed in the dnet channel.
2019-06-03 13:14:20 -04:00
Chris Johnston
1f55f01866 feature(internal): Set the @everyone IRole for @everyone and @here tags (#1313)
* Set the @everyone IRole for @everyone and @here tags

Adds support for setting the IRole corresponding to @everyone or @here in a the tags of a message. Previously this would only set the TagType, but leave the value as null.

This does not distinguish between @everyone and @here, as that's done using TagType. The values of both will be the same.

This issue was suggested by @TheCasino

* use the EveryoneRole property

oops

* use null conditional operator instead of a null check
2019-06-02 19:53:26 -04:00
Christopher Felegy
4d7de176d0 meta: add versioning guarantees to README 2019-06-02 19:52:39 -04:00
Christopher Felegy
c78a6790b1 fix: don't raise REST log events twice
The DiscordSocketClient and DiscordSocketRestClient share the same
backing API client, so the Log events on both clients will be raised
from the same API calls. Proxying log events from the
DiscordSocketRestClient then means that the Log event the user hooks
into will be raised twice for a single log message.

Thanks to @TheCasino for noticing this.
2019-05-19 12:16:37 -04:00
Christopher Felegy
bc66d7ea4e meta: bump version to 2.1.1-dev 2019-05-19 12:14:36 -04:00
Christopher Felegy
c9e2c034f8 ci: use buildTag variable 2019-05-19 10:43:37 -04:00
Christopher Felegy
89da65af96 ci: deploy on tags 2019-05-19 10:42:19 -04:00
Christopher Felegy
8118c11efe ci: build/tag includes must be a list 2019-05-19 10:36:08 -04:00
Christopher Felegy
53e0202677 meta: CI should build tag commits as well 2019-05-19 10:33:05 -04:00
Christopher Felegy
63381f1204 meta: v2.1.0
happy patch saturday
2019-05-18 22:26:16 -04:00
Christopher Felegy
03304ff364 lint: ClientExtensions should be a member of Discord.Rest 2019-05-18 17:42:57 -04:00
Alex Gravely
1356ea9736 feature: Add AddGuildUserAsync guild ID extension method. (#1240) 2019-05-18 17:40:04 -04:00
Alex Gravely
655a0069a1 docs: Add Webhook example. (#1241)
* Add Webhook example.

* Fix spacing.

* Update to use webhook URL ctor.
2019-05-18 17:24:06 -04:00
Chris Johnston
4eb958dcee test: Fix broken ChannelPermissions test, refactor TestChannelPermissionModify (#1287)
* fix missing priority speaker flag

* rewrite the TestChannelPermissionModify test
2019-05-18 17:21:24 -04:00
Christopher Felegy
f6e320053b fix: ensure that exceptions will be logged
Resolves #1238.

I'm not sure where this bug came from, a git blame revealed no change to
the timed event handler code since it was initiall written two years
ago.

I've found that when the event handler times out, the handler task will
be manually completed (as opposed to within Task.WhenAny), which then
bubbles the exception and allows the error to be logged.

Ensuring that the handler is completed individually, regardless of
whether or not the timeout task completed, seems to fix this problem.
2019-05-18 09:42:37 -04:00
Christopher Felegy
a44c13af78 fix: call OnLogin/OnLogout on DiscordSocketRestClient
Resolves #1277.
2019-05-18 09:32:49 -04:00
Chris Johnston
f3b20b2b6d feature: Add support for spoiler formatting & attachments (#1255)
Resolves #1216.

* Add support for spoiler formatting

* Implement support for sending message attachments that are spoilers

* use consistent naming

* update docstring for new isSpoiler param

* move extension method to be under core project, make spoiler prefix a const

* typo fix

* update missing xmldocs

* move SpoilerPrefix const outside of interface

* Add isSpoiler support to webhook client

adds the isSpoiler field to uploading files with a webhook, which will only
insert "SPOILER_" to the start of the filename. This does not include other
fields in the payload, as this is not in the documentation, and was not observed
like in the regular client
2019-05-17 19:28:40 -04:00
Christopher Felegy
76f82d687b perf: only allocate cacheableList once 2019-05-17 19:20:55 -04:00