-
-
Notifications
You must be signed in to change notification settings - Fork 41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DiscordKitBot: Add basic types + a few other things #31
base: main
Are you sure you want to change the base?
Conversation
There's still a lot of convenience methods to write for |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This PR is really amazing and adds so many missing features, thanks!
I understand that it is still a work in progress, and so far it seems very nice. I've left some comments which you could take as suggestions.
Due to the sheer massiveness of this PR, I have spent a reasonable effort reading thru most files but might've missed something.
Thanks for making the recommended changes. Are there other modifications you'd like to make or can I mark this PR as ready for review? |
Yeah go on and review it, I’m not gonna have much time this week to work on stuff, but I’ll get any requested changes done asap. |
|
||
/// The url to jump to this message | ||
public var jumpURL: URL? { | ||
get { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This get {
clause is redundant, should be removed to resolve the lint warning
@@ -42,6 +45,27 @@ public class CommandData { | |||
let token: String | |||
/// The ID of this interaction | |||
public let interactionID: Snowflake | |||
/// The guild member that sent the interaction | |||
public var member: Member? { | |||
get { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The get
keyword should be removed here as well to resolve the following lint warning.
The PR adds types for the following:
It also refactors the
Message
type. All the the types have convenience methods and properties. These changes make it possible to create slightly more complex bots.This PR also makes some changes to
Client
:rest
object is now public, so that advanced users can have access to the discord API, if they so choose.SIGINT
, because we need to intercept the exit call. It also does not work while a debugger is attached.Added a few support methods/classes:
asyncMap()
andasyncCompactMap()
-map()
andcompactMap()
but asyncPaginatedSequence
- AnAsyncSequence
that abstracts away grabbing paginated data.Changes to docs: