Commit Graph

226 Commits

Author SHA1 Message Date
Christopher F
9979a027d5 Change default InviteAge to 24 hours
Resolves #859
2017-11-10 15:39:33 -05:00
enzosk8
da335b95c4 Fix general typos (#852) 2017-11-05 22:05:19 -05:00
Alex Gravely
5218e6be97 Add IEmbed#ToEmbedBuilder extension method (#863)
* Add IEmbed#ToEmbedBuilder extension method

* Implementing reviewed changes.

* Switch to object initializers for author and footer.
2017-11-05 21:57:24 -05:00
Alex Gravely
e00f17fe55 Move DeleteMessagesAsync from IMessageChannel to ITextChannel (#829) 2017-10-01 15:37:13 -04:00
Christopher F
347c5a0d39 Disable obsolete warnings in files that reference TokenType.User 2017-09-29 17:37:07 -04:00
Alex Gravely
9b7afec4cc Add BaseSocketClient object. (#773)
* Add BaseDiscordClient. Add various missing RequestOptions args.

DiscordSocketClient and DiscordShardedClient's shared members now exist in this abstract class.

* Add ShardReady event.

* Style consistency. Remove extraneous overloads.

Remove extraneous overloads.

* Add BaseSocketClient#DownloadUsersAsync().

Style cleanups.

* Add ShardLatencyUpdated event.

Style cleanup.

* Hook LatencyUpdated for ShardedClient.

* Begone whitespace.

* I'm good at this, I swear. >_>

* Add back DiscordShardedClient.UserPresenceUpdated

* Add ObsoleteAttribute

* Removing the UserPresenceUpdated event.
2017-09-27 18:20:31 -04:00
Chris Johnston
30e867a183 Implement welcome message channels (#819) 2017-09-23 17:00:08 -04:00
Alex Gravely
ec03883e26 Create unspecified channel object for unknown channel types (#811)
* Partial fix of #810, addresses critical connection issues.

* Implement fix for REST.

* Implement fix on RestChannel.
2017-09-09 15:56:03 +01:00
Mark Gross
479361bbea Condense redundant AddField overloads in EmbedBuilder (#790)
* Remove extra AddField overload in EmbedBuilder

* Remove AddInlineField()
2017-08-29 19:38:34 -04:00
Christopher F
4846264074 Add IsNsfw to TextChannelProperties 2017-08-29 17:42:00 -04:00
Christopher F
608bc359ee Removed IChannel#Nsfw, added to ITextChannel 2017-08-29 17:26:36 -04:00
Christopher F
5d7f2fc7ec Add GetReactionUsersAsync(IEmote) overload (#731)
* Add GetReactionUsersAsync(IEmote) overload

Resolves #730

* Remove obsolete GetReactionUsersAsync(string) overload
2017-08-29 17:09:28 -04:00
Joe4evr
94f7dd2ab8 Remove EmbedBuilder -> Embed implicit conversion (#801) 2017-08-29 16:51:41 -04:00
Christopher F
3c1e76615e Preemptive Ratelimits should be logged under Verbose 2017-08-28 17:21:19 -04:00
Christopher F
1ffcd4bfa7 Changed Guild#DefaultChannel to resolve the first accessible channel (#777)
* Changed Guild#DefaultChannel to resolve the first accessible channel

Resolves #776

This change is inline with hammerandchisel/discord-api-docs#329

RestGuild#DefaultChannelId is now obsolete and will throw a
NotSupportedException.

* RestGuild#DefaultChannelId will fall back to the guild ID

Adding an exception here would be a breaking change, so this was agreed
to fall back to the previous behavior, which would just return the guild
ID.
2017-08-28 16:49:16 -04:00
Christopher F
182f00f8ce Reworked IChannel.IsNsfw to support the new API flag (#771)
IChannel.IsNsfw will now return false when being used on any channel
that is not an ITextChannel. When being used on an ITextChannel, this
will now account for the API flag, and fall back to the channel name.

(this is gross design, thanks discord)
2017-08-28 16:45:53 -04:00
Alex Gravely
865080add9 Fix CreateGuildAsync not sending icon stream. (#768)
* Fix CreateGuildAsync not doing anything with the input stream for the guild icon.

Also fixes an issue with potential stream types that throw a NotSupportedException when checking its properties. [Apparently, they exist.](https://github.com/dotnet/corefx/blob/master/src/System.Net.Http.WinHttpHandler/src/System/Net/Http/WinHttpResponseStream.cs)

* Merged with old method

* Removed duplicate decl
2017-08-17 03:19:16 -03:00
Christopher F
506a6c96c9 Throw when attempting to add or remove a member's EveryoneRole (#781)
* Throw when attempting to add or remove a member's EveryoneRole

This resolves #780

* Removed braces
2017-08-17 02:59:58 -03:00
Alex Gravely
6b5a6e7f1f Fix everyone mention. (#755)
* Update RestRole.cs

Fix everyone mention.

* Update SocketRole.cs

Fix everyone mention.

* I'm good at this, I swear.
2017-08-17 02:47:37 -03:00
Jay Malhotra
57a461c9ff NullOrEmpty -> NullOrWhiteSpace (#758)
Seeing as D.NET will warn you about an impending BadRequest if you try and send an empty field, why not make it warn about the impending BadRequest if you try and send a whitespace field?
2017-08-17 02:47:00 -03:00
Christopher F
95b78df9f0 URL-Encode reasons on Kick/Ban (#787)
This resolves #784
2017-08-17 02:43:00 -03:00
Christopher F
8068a0ba0e Merge pull request #654 from ObsidianMinor/dev
Fixed RestGuildUser not updating inherited RestUser properties
2017-07-11 12:13:02 -04:00
Pat Murphy
d89804d7c7 Fix potential nullref in embedBuilder value setter (#734)
* Fix potential nullref in embedBuilder value setter

* Null check on footer iconUrl

* Adding checks for the other URL properties

* Adding IsNullOrUri extension

* Setting StringExtensions as internal
2017-07-05 20:56:43 -03:00
RogueException
ba18179eb8 Fixed compile error 2017-06-29 19:50:07 -03:00
RogueException
3b78817c54 Added int overload to EmbedBuilderExtensions 2017-06-29 19:45:02 -03:00
RogueException
14dfc48df3 Style cleanup 2017-06-29 19:44:32 -03:00
Finite Reality
fdd38c8d7f Add embed builder extensions (#460)
* Add embed builder extensions

People in #dotnet_discord-net suggested that this should be part of
the lib after I demonstrated it

* Move some extensions into EmbedBuilder [2]

Apparently git didn't like that previous commit

* Fix error with EmbedBuilderExtensions

A summary of issues which happened:
- Git decided to add an amend commit (I told it to quit?)
- VS Code thinks everything is an error so it wasn't helpful
- dotnet decided to think there was no error until I deleted all
  build outputs and rebuild

Sometimes I question my ability to use version control properly.
2017-06-29 19:44:08 -03:00
Christopher F
7837c4862c Revert change of all Url types on IEmbed to string (#724) 2017-06-29 17:38:05 -03:00
Christopher F
1ce1c019b3 Add support for audit log reasons (#708)
* Add support for audit log reasons

* Made changes per discussion
2017-06-29 17:01:59 -03:00
Christopher F
256af0b269 Merge remote-tracking branch 'origin/issues/667' into dev 2017-06-23 10:42:19 -04:00
Pat Murphy
5601d00285 Add various property validation in EmbedBuilder (#711)
* Add various property validation in EmbedBuilder

* Embed URI changes

Changes property types for any URLs in Embeds to System.URI.
Adding field name/value null/empty checks.

* including property names in argumentexceptions

* Adds overall embed length check
2017-06-23 11:29:55 -03:00
Christopher F
33e765f8f5 Use StringEnum converter in API model 2017-06-17 19:00:22 -04:00
Christopher F
0708bc5d48 Add EmbedType enum 2017-06-16 22:39:40 -04:00
Christopher F
1942637380 Merge pull request #656 from AntiTcb/fix/GetDMChannelAsync
Remove IUser.CreateDMChannelAsync / Fix SocketGlobalUser.DMChannel
2017-06-16 21:22:56 -04:00
AntiTcb
fb57a61432 Rename to GetOrCreateDMChannelAsync 2017-06-16 20:43:50 -04:00
Alex Gravely
8c2a46e9e7 Add ulong overload to IMessageChannel.DeleteMessagesAsync (#649) 2017-06-15 12:05:41 -03:00
AntiTcb
73611d1fab Remove IUser.CreateDMChannelAsync, implicitly implement IUser.GetDMChannelAsync 2017-05-27 14:47:12 -04:00
ObsidianMinor
652fd30f65 Fixed RestGuildUser not updating RestUser properties 2017-05-16 13:27:43 -05:00
RogueException
feebcb4838 Update System.Net.Http to 4.3.2 2017-05-09 20:55:54 -03:00
RogueException
285a0e5817 Updated deps, cleaned csprojs 2017-05-09 20:51:00 -03:00
Christopher F
d189bb9748 Expose the 'fields' collection on EmbedBuilder (#603)
* remove tip in docs about SocketEntity.Discord

* Expose the 'Fields' collection on EmbedBuilder

After some discussion I decided that there was really no reason to keep this private, and it didn't really go along with the rest of the design of the EmbedBuilder.

This is NOT a breaking change.

Exposing this property should not have any negative effects.

* Don't allow EmbedBuilder's Fields to be set to null
2017-05-04 12:53:40 -03:00
Christopher F
576a52cdc6 Restructure and replace emojis with a new emote system (#619) 2017-05-04 12:52:48 -03:00
Christopher F
7f1fc286cf Add IChannel.Nsfw, RequireNsfw precondition (#633)
* Add IChannel.Nsfw, RequireNsfw precondition

* Refactored IChannel.Nsfw to IsNsfw, removed NsfwUtils

Per pull-request feedback

* proper nsfw channel check
2017-05-04 12:49:32 -03:00
Sindre Langhus
90ac9027cf Replace Where+FirstOrDefault with FirstOrDefault in SocketClient (#636)
* Replace Where.FirstOrDefault with FirstOrDefault

* Replace Where+FirstOrDefault in ClientHelper
2017-04-30 21:29:12 -03:00
RogueException
bd85bbf30a Moved UserAgent to DiscordConfig 2017-04-26 13:06:34 -03:00
RogueException
c6ccddb4ce Added UnstableRestClientProvider 2017-04-26 13:06:13 -03:00
RogueException
a306d83283 Added net45 TFM 2017-04-26 10:25:08 -03:00
RogueException
f8b9acc4a1 Use implicit package references (#626) 2017-04-26 10:03:23 -03:00
Christopher F
431b7fbd9f Visual Studio C#7 suggestions 2017-04-23 15:23:06 -04:00
Christopher F
6000b15c4d C#7 TODOs 2017-04-23 15:13:31 -04:00