Skip to content
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

Kdoc the Kord #729

Closed
wants to merge 23 commits into from
Closed

Conversation

NoComment1105
Copy link
Contributor

@NoComment1105 NoComment1105 commented Nov 21, 2022

This PR aims to close #11 or at least tackle the main part of it, by documenting lots and lots of code :D

Anyone who wants to help is welcome to PR to this branch and hopefully we can document as much as possible.

This will remain as a draft for a long time most likely

Any private or internal classes/functions/variables will not be documented in this PR

What has been documented?
Below is a list of the "parent packages" in each of Kords modules, this is how i categorize the completion of this PR.
These will be checked once complete

  • Common

    • Annotation
    • Entity
    • Exception
    • Ratelimit
    • Serialization
    • Outlying files
  • Core

    • Behavior
    • Builder
    • Cache
    • Entity
    • Event
    • Exception
    • Gateway
    • Live
    • Supplier
    • Outlying files
  • Rest

    • Builder
    • JSON
    • Ratelimit
    • Request
    • Route
    • Service
    • Outlying files
  • Voice

    • Encryption
    • Exception
    • Gateway
    • Handlers
    • IO
    • Streams
    • udp
    • Outlying files

@lukellmann
Copy link
Member

lukellmann commented Nov 21, 2022

I think for classes that only are 1:1 mappings of discord json models (like most things in dev.kord.common.entity) we shouldn't document every property but instead just link to discord's docs. That means we'll have less work keeping them up to date.

@NoComment1105
Copy link
Contributor Author

I think for classes that only are 1:1 mappings of discord json models (like most things in dev.kord.common.entity) we shouldn't document every property but instead just link to discord's docs. That means we'll have less work keeping them up to date.

Sounds good, I'll change my documenting style to that from now on

NoComment1105 and others added 11 commits November 24, 2022 15:18
# Conflicts:
#	core/src/main/kotlin/event/channel/TypingStartEvent.kt
#	core/src/main/kotlin/event/message/MessageBulkDeleteEvent.kt
#	core/src/main/kotlin/event/message/MessageDeleteEvent.kt
#	core/src/main/kotlin/event/message/ReactionAddEvent.kt
#	core/src/main/kotlin/event/message/ReactionRemoveAllEvent.kt
#	core/src/main/kotlin/event/message/ReactionRemoveEvent.kt
@lukellmann lukellmann changed the base branch from 0.8.x to 0.9.x March 25, 2023 17:40
lukellmann and others added 2 commits April 6, 2023 14:27
# Conflicts:
#	core/src/commonMain/kotlin/builder/kord/KordBuilder.kt
#	core/src/commonMain/kotlin/entity/Webhook.kt
#	core/src/commonMain/kotlin/event/channel/ChannelCreateEvent.kt
#	core/src/commonMain/kotlin/event/channel/ChannelDeleteEvent.kt
#	core/src/commonMain/kotlin/event/channel/ChannelUpdateEvent.kt
#	core/src/commonMain/kotlin/exception/EntityNotFoundException.kt
@lukellmann lukellmann changed the base branch from 0.9.x to main June 17, 2023 13:50
@NoComment1105 NoComment1105 changed the title Lets get this show on the road Kdoc the Kord Jul 27, 2023
# Conflicts:
#	core/src/commonMain/kotlin/entity/Guild.kt
#	core/src/commonMain/kotlin/entity/Icon.kt
#	core/src/commonMain/kotlin/entity/PartialGuild.kt
#	core/src/commonMain/kotlin/entity/Role.kt
#	core/src/commonMain/kotlin/entity/Sticker.kt
#	core/src/commonMain/kotlin/entity/User.kt
#	core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt
#	core/src/commonMain/kotlin/event/gateway/Events.kt
#	core/src/commonMain/kotlin/event/message/MessageBulkDeleteEvent.kt
#	core/src/commonMain/kotlin/event/message/MessageDeleteEvent.kt
#	core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt
#	core/src/commonMain/kotlin/event/message/ReactionRemoveAllEvent.kt
#	core/src/commonMain/kotlin/event/message/ReactionRemoveEvent.kt
@Galarzaa90
Copy link
Contributor

I was recently thinking... there's many undocumented classes, specially ___Data classes. And I was thinking of doing this (altought probably in various smaller PRs).

And then I found this 😬

@NoComment1105
Copy link
Contributor Author

I was recently thinking... there's many undocumented classes, specially ___Data classes. And I was thinking of doing this (altought probably in various smaller PRs).

And then I found this 😬

Yeah this PR is quite old now, I need to split it down into smaller ones to reduce the size of the PR required. Thanks for reminding me I can do this now :)

@Galarzaa90
Copy link
Contributor

I was recently thinking... there's many undocumented classes, specially ___Data classes. And I was thinking of doing this (altought probably in various smaller PRs).
And then I found this 😬

Yeah this PR is quite old now, I need to split it down into smaller ones to reduce the size of the PR required. Thanks for reminding me I can do this now :)

Yeah I was interested in doing this, but I think it would be better if I wait for this to be merged so I could check whatever was left missing (or added later). Glad I decided to do a search before starting 😅

@NoComment1105
Copy link
Contributor Author

I was recently thinking... there's many undocumented classes, specially ___Data classes. And I was thinking of doing this (altought probably in various smaller PRs).
And then I found this 😬

Yeah this PR is quite old now, I need to split it down into smaller ones to reduce the size of the PR required. Thanks for reminding me I can do this now :)

Yeah I was interested in doing this, but I think it would be better if I wait for this to be merged so I could check whatever was left missing (or added later). Glad I decided to do a search before starting 😅

Haha yeah, I'm currently bringing the PR up to date and will then make some smaller PRs to make it easier :)

# Conflicts:
#	core/src/commonMain/kotlin/entity/Icon.kt
#	core/src/commonMain/kotlin/entity/Member.kt
#	core/src/commonMain/kotlin/entity/User.kt
#	core/src/commonMain/kotlin/event/channel/thread/ThreadListSyncEvent.kt
#	core/src/commonMain/kotlin/event/interaction/ApplicationCommandCreate.kt
#	core/src/commonMain/kotlin/event/interaction/ApplicationCommandDelete.kt
#	core/src/commonMain/kotlin/event/interaction/ApplicationCommandUpdate.kt
#	core/src/commonMain/kotlin/event/message/ReactionAddEvent.kt
Copy link
Contributor

@Galarzaa90 Galarzaa90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Some small typos and suggestions.

@@ -99,9 +102,15 @@ public class Kord(

override val coroutineContext: CoroutineContext = SupervisorJob() + dispatcher

/**
* Returns a [Flow] of [Region]s know to the bot.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

know -> known

Line 112 too

public fun autoModerationRule(guildId: Snowflake, ruleId: Snowflake): AutoModerationRuleBehavior =
AutoModerationRuleBehaviorImpl(guildId, ruleId, kord)

/**
* Returns an [KeywordAutoModerationRuleBehavior] for a given [guildId].
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

article: an -> a

@@ -140,6 +142,9 @@ public open class Invite(
/**
* An instance of a [Discord Invite](https://discord.com/developers/docs/resources/invite) with
* [extra information](https://discord.com/developers/docs/resources/invite#invite-metadata-object).
*
* @param kord The Kord instance that created this object
* @param supplier THe supplier used to request entities
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

THe -> The

@@ -11,20 +11,30 @@ import dev.kord.core.exception.EntityNotFoundException
import dev.kord.core.supplier.EntitySupplier
import dev.kord.core.supplier.EntitySupplyStrategy

/**
* Represents a user's current state on a guild.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think "current status" would be more appropiate.

@@ -15,8 +15,14 @@ import dev.kord.gateway.GatewayCloseCode
import kotlinx.coroutines.flow.Flow
import kotlinx.coroutines.flow.filter

/**
* A Gateway recieved an event.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

recieved -> received

* 2. When a Guild becomes available again to the client
* 3. When the current user joins a new Guild.
*
* _Scenarios 1 and 3 may be marked unavailable during an outage_
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

While this is true, kord does not support this unavailable flag in this event, so that should be noted here until it is implemented.

@@ -131,37 +133,37 @@ public class InviteCreateEvent(
* Requests to get the [Channel] this invite is for.
*
* @throws [RequestException] if anything went wrong during the request.
* @throws [EntityNotFoundException] if the wasn't present.
* @throws [EntityNotFoundException] if the wasn't present.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing word here: if the channel wasn't present.

@@ -4,6 +4,13 @@ import dev.kord.core.Kord
import dev.kord.core.entity.application.*
import dev.kord.core.event.Event

/**
* The event dispatched when an [GuildApplicationCommand] is updated.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

article: an -> a

@Galarzaa90
Copy link
Contributor

Damn it, I thought I was looking at the new PR 😭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Lots of places lack full documentation
3 participants