Commit Graph

2749 Commits

Author SHA1 Message Date
Christopher F
9979a027d5 Change default InviteAge to 24 hours
Resolves #859
2017-11-10 15:39:33 -05:00
Christopher F
8d533930fa Move CommandExecuted invoking up a scope for generic Task commands
Resovles #870
2017-11-10 15:26:58 -05:00
Christopher F
623d60fe51 Merge remote-tracking branch 'origin/dev' into dev 2017-11-06 20:41:08 -05:00
Christopher F
676be4081b Ignore messages with an ID of 0 when calculating age 2017-11-06 20:40:59 -05:00
Chris Johnston
dec7cb2b5b Fix GuildPermission Modify, Add Missing Permission to AllowAll (#866)
* Use named parameters in GuildPermission constructor, fix ordering of parmeters in Modify constructor call

* fix missing constructor parameter

* Added missing Webhook permission for the all text permissions value

* Resolves #869 Add UseExternalEmojis permission to GuildPermissions.All
2017-11-05 22:06:41 -05:00
Joe4evr
e30fd29085 Tweaks to audio docs (#867)
* Tweaks to audio docs

* Make it more obvious that -1 means infinity
2017-11-05 22:06:28 -05:00
enzosk8
da335b95c4 Fix general typos (#852) 2017-11-05 22:05:19 -05:00
Alex Gravely
dc151e8998 Update VS Code csproj example to target version 1.0.2. (#849)
* Update target version to 1.0.2.

* Change to target latest 1.x stable.
2017-11-05 22:05:09 -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
Chris Johnston
f9963380a7 Proposed Solution for #674 Permissions Changes (#743)
* Initial commit of changes. Changed permissions from bitwise index to use bitwise flags instead. Modified relevant methods involved

* Revised enum value naming

* Added FlagsAttribute to ChannelPermission, GuildPermission

* Added comments per Joe4evr suggestion

* Added underlines to hex value digits for readability per Joe4evr suggestion

* updated names to better reflect actual permission names as per SubZero0 suggestion

* fix for 236775c2d8aca9481d6c51c674f5727f97adec04

* Replaced Math.Pow with left shift operator

* Cleaned up the formatting of ChannelPermission and GuildPermission enums to make it easier to read
2017-10-25 20:39:26 -04:00
Finite Reality
759db34146 Remove payload compression, use stream compression (#853) 2017-10-21 13:51:20 -04:00
Christopher F
14fbe40cbc Add Async suffix to command-related Tasks (#804)
commit b7fb44a94fb1e75f696f281d6b201eba3f48e864
Author: Hsu Still <341464@gmail.com>
Date:   Sat Sep 2 14:34:18 2017 +0800

    Fix more async naming violation

commit e6912e2d020c69325826dbfa62c07cd1ef2cc45f
Author: Hsu Still <341464@gmail.com>
Date:   Sat Sep 2 14:23:04 2017 +0800

    Fix incorrect null xmldocs string

commit da8d23222d207853375c3512232d1d7fd3629cad
Author: Hsu Still <341464@gmail.com>
Date:   Sat Sep 2 14:17:12 2017 +0800

    Fix CheckPreconditionsAsync

commit 992407407a42fec9087c9ed18e0bf5de30dff82c
Author: Hsu Still <341464@gmail.com>
Date:   Sat Sep 2 14:07:12 2017 +0800

    Add Async suffix to abstract Task methods
2017-10-09 19:45:12 -04:00
Alan Schapira
d8c4b7537b Client is global variable (#789)
In the previous section of the tutorial https://github.com/RogueException/Discord.Net/blob/dev/docs/guides/getting_started/samples/intro/client.cs, the client it a global variable with an underscore
2017-10-03 20:09:06 -04:00
Joe4evr
88c9964b54 Minor Quickstart tweaks (#783)
* Remove saving Console.ForegroundColor to a local

* Add message handler checks

* Add comment explaining that there's two differently named methods to add modules

* Add comment about the Commands package

* Add Exception property to log handler
2017-10-03 20:07:54 -04:00
Vollrat
71e8b88514 Improve upon Property Summaries in CommandServiceConfig (#839)
* Improve Boolean Property Summaries

Having the `CaseSensitiveCommands` property summary asking a question whenever Intellisense is invoked seems a bit nonessential instead of *properly* explaining what exactly it does. It would be better if instead, it stated it's use to be more comprehensible to the reader.

### Changes

- Edits the summaries of `CaseSensitiveCommands` and `ThrowOnError` to follow a more methodical convention for boolean property summaries (`Determines whether X ...` rather than `Should X be ... ?`).

This is just a small change to improve upon the current documentation, so it shouldn't conflict with anything.

* "DefaultRunMode should also be "Gets or sets blah blah blah" to be consistent."
2017-10-03 20:04:38 -04:00
Hsu Still
22d79c1004 Improve library documentation (#826)
* Improve the Command Service documentation

The following changes have been added to this PR:
•	Fix minor grammatical errors.
•	Capitalize terms such as Commands, Modules and such, as the context is specific to the lib.
•	Wrap methods and properties in code blocks.

The docs page currently has several issues that remains to be fixed.

1. 
```md
>[!WARNING]
>This article is out of date and has not been rewritten yet.
Information is not guaranteed to be accurate.
```

The docs doesn't necessarily seem "out of date" as the warning claims. The basics seem pretty relevant to the latest version of the lib.

2.
>“To manually load a module, invoke [CommandService.AddModuleAsync], by passing in the generic type of your module and optionally, a dependency map.”

The latter part of the sentence seems off. Where should the user pass the dependency map to? It seems to suggest that `AddModuleAsync` has an argument to pass the dependency to. If it is referring to `AddModuleAsync(Type type)`, then I feel like it should be clarified here - or perhaps change the wording of the sentence.

3.
>“First, you need to create an @System.IServiceProvider You may create your own IServiceProvider if you wish.” 

Any mention of @System.IServiceProvider is currently broken on the docs.

4.
>“Submodules are Modules that reside within another one. Typically, submodules are used to create nested groups (although not required to create nested groups).”

Clarification on the part after "although?"

5.
>“Finally, pass the map into the LoadAssembly method. Your modules will automatically be loaded with this dependency map.”

Where is this `LoadAssembly` method?

6.
```md
>[!NOTE]
>Preconditions can be applied to Modules, Groups, or Commands.
```

The docs should mention `ParameterPreconditionAttribute`'s existence.

* Update line breaks to comply with docs standard

* Change "you should..." to "instead, ..."

* Trim trailing spaces

* Change "inherits" to "inherit"

* Fix Context warning note and add ReplyAsync xref

* Fix broken xrefs

* Fix [Command Service] xref

* Fix consistency between TypeReaders and Preconditions returns

* Add missing semi-colons in ServiceProvider sample

* Change CommandContext to SocketCommandContext & change variable naming

* Cleanup TypeReader section

* Wrap [DontInject] in code block

* Fix commands docs linking in intro

* Improve Getting Started - Installation

- Fix character misalignment to comply with docs standard.
- Fix image numbering issues by moving the tooltips above some of the steps.
- Add codeblocks to search terms like `Discord.Net`.
- Remove broken `addons` reference.
- Specify `.NET 4.6.1` as `.NET Framework 4.6.1`.
- Minor cross-reference cleanup.

* Fix Getting Started - Intro

- Minor grammartical fixes.
- Wrap mentions of the methods, properties, and events in code block.
- Replace `Discord.Net` to `Discord.NET`.
- Fix steps numbering under `Creating a Discord Bot` and `Adding your bot to a server`.
- Change `Task-based Asynchronous Pattern ([TAP])` linking to mark the entire term instead.
- Change code block of `Pong!` to quotation mark instead.

* Fix cross references in Sending Voice

* Mention parameter precondition attribute

* Change `Discord.NET` to `Discord.Net` for consistency

* Wrap project names in code blocks & minor fixes in Terminology

* Change `add-ons` to `addons` for consistency

* Fix cross references in Logging

* Fix minor grammatical issues in "Working with Events"

* Missed a tilda

* Remove out-of-date warning in Commands

* Minor grammatical fixes for Entities

* Fix broken xref in Logging

* Adjust service collection sample

...according to f89aecb7bf (r141530227)

* Update Command Handler sample

- Update Main for C# 7.1.
- Inject CommandService and DiscordSocketClient into the service collection.
- Add Async suffix to asynchronous methods.

* Minor grammatical fixes in Events

* Revert 2 incorrect grammar corrections

* Revert async Main sample

* Add hardcode token notice in sample

* Fix missing method for Command Handler

* Modify module samples to use SocketCommandContext instead

* Emphasize CommandContext and SocketCommandContext

* Fix formatting for module sample

* Add SocketCommandContext for Groups sample

* Remove comma

* Fix DepMap sample formatting

* Replace [DontInject] with DontInjectAttribute with cross reference

* Remove connection logic note

There is no reason that this note should still be here since Ready event exists.

* Add a new warning message informing the users the existence of CommandService

* Make command handler private

excellent change
2017-10-03 16:48:05 -04: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
Chris Johnston
f8108871d6 Typo fix for SocketGuildUser.Hierarchy description (#831) 2017-09-28 16:26:23 -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
Christopher F
fc5adca94e Obsolete TokenType.User 2017-09-27 18:17:48 -04:00
Chris Johnston
30e867a183 Implement welcome message channels (#819) 2017-09-23 17:00:08 -04:00
Joe4evr
e25054bb3b Update WS4Net dependency to 0.15.0 (#812)
Also changes target to NetStandard1.3
2017-09-10 23:14:45 -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
Hsu Still
0de5d5b02b Added SendFileAsync (#774) 2017-08-29 16:57:47 -04:00
Joe4evr
94f7dd2ab8 Remove EmbedBuilder -> Embed implicit conversion (#801) 2017-08-29 16:51:41 -04:00
Christopher F
e991715bac Added CommandService.CommandExecuted (#747) 2017-08-29 16:50:32 -04:00
Christopher F
0fdb2d2c3b Bump version to 2.0.0-alpha 2017-08-29 16:49:44 -04:00
Izumemori
9c81ab9fe4 changed NameAttribute to work for parameter (#765) 2017-08-29 16:45:30 -04:00
Alex Gravely
cb0ff7817d Add NullableTypeReader (#785)
* Add NullableTypeReader.

Primitives now also load a NullableTypeReader<T> and any value types that get a typereader added will also have a NullableTypeReader<T> added for it.

* Remove unnecessary null check.

* Added docstrings.
2017-08-29 16:38:11 -04:00
Christopher F
4205d68b5a Don't throw when receiving a presence for a user that doesn't exist (#746) 2017-08-29 16:26:31 -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
RogueException
361bfc1a90 Bumped version to 1.1.0-alpha 2017-08-28 16:07:39 -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
RogueException
f997089174 Try to pull DM channels from cache on CHANNEL_CREATE 2017-08-17 02:54:19 -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
22b969cbc7 Test the Discord.Color structure (#786)
This provides tests to ensure the following:
- Creating a Color
- Creating a Default Color
- Accessing a Color's Raw Value
- Accessing a Color's translated RGB values
2017-08-17 02:44:37 -03:00
Christopher F
95b78df9f0 URL-Encode reasons on Kick/Ban (#787)
This resolves #784
2017-08-17 02:43:00 -03:00
RogueException
dfcb4b39fb Allow duplicate RequireBotPermissionAttribute 2017-08-17 02:41:42 -03:00
Alex Gravely
c4dcb9dc17 Update client.cs (#752)
* Update client.cs

Let's not have the client be a local variable, hm?

* Update complete.cs

* Update complete.cs

* Update client.cs and complete.cs

Let's not have the client be a local variable, hm?
2017-07-16 11:33:01 -04:00
Hsu Still
b59c48b9ec Added IServiceProvider (#753) 2017-07-16 11:32:49 -04:00
Joe4evr
0bdc2455bc Add line to show subscribing to CommandService#Log (#756) 2017-07-16 11:32:31 -04:00