-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* thread gateway/rest implementation * add service endpoints and channel requests * split invite from categorizables * Add threads, thread users, missing routes There's still more modifications to do but hopefully we are close to a milestone in this regards. * more work on this * core events * Almost done (behavior/event handling) * Fix compilation errors * Consider channels with unknown but same structure * implement thread parents behavior into news and text channels * implement missing store functions and enable v9 for gateway * documentation * fix core functions and names * rename publicActiveThreads to activeThreads * remove list prefix from routes * Fix json incorrect and missing fields * Fix incorrect jsons * make a thread modify request a part of channel modify request * remodel thread user * remodel thread user & add missing properties/functions * proper startXThread support * move startPublicThreadWithMessage to thread parents * Cleanup * narrow down the thread channel types * add rest tests * fix rest tests * fix user thread data conversion * add description * register thread user data * add missing behaviors and clean up code * Add missing getter functions * fix withStrategy signiture * remove has_more from ListThreadResponse * paginate thread suppliers * Fix errors and correct method signitures All tests passed * optimize imports * add ThreadParentChannel and cleanup its behavior * add core sync/updates events * handle thread events (broken) * cleanup ChannelData * handle unknown channel type * move thread related events under the same package * correct typo * remove thread events from the channel handlers * clean up and document threads * further documentation * further documentation (2) * Fix markdowns * rename the mis-leading thread-starting functions * Fix cache querying for threads * invert boolean check for public archived threads * apply suggestions * provide default values for durations * provide unsafe thread parent behaviors * support X-Audit-Log
- Loading branch information
Showing
58 changed files
with
1,971 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
package dev.kord.core.behavior | ||
|
||
import dev.kord.common.entity.Snowflake | ||
import dev.kord.core.Kord | ||
import dev.kord.core.behavior.channel.threads.ThreadChannelBehavior | ||
import dev.kord.core.entity.channel.thread.ThreadChannel | ||
import dev.kord.core.supplier.EntitySupplier | ||
import dev.kord.core.supplier.EntitySupplyStrategy | ||
import dev.kord.core.supplier.getChannelOf | ||
import dev.kord.core.supplier.getChannelOfOrNull | ||
|
||
interface ThreadUserBehavior : UserBehavior { | ||
|
||
val threadId: Snowflake | ||
|
||
val thread: ThreadChannelBehavior get() = ThreadChannelBehavior(threadId, kord) | ||
|
||
suspend fun getThread(): ThreadChannel = supplier.getChannelOf(threadId) | ||
|
||
suspend fun getThreadOrNull(): ThreadChannel? = supplier.getChannelOfOrNull(threadId) | ||
|
||
override fun withStrategy(strategy: EntitySupplyStrategy<*>): UserBehavior { | ||
return ThreadUserBehavior(id, threadId, kord, strategy.supply(kord)) | ||
|
||
} | ||
} | ||
|
||
fun ThreadUserBehavior( | ||
id: Snowflake, | ||
threadId: Snowflake, | ||
kord: Kord, | ||
supplier: EntitySupplier = kord.defaultSupplier | ||
): ThreadUserBehavior { | ||
return object : ThreadUserBehavior { | ||
override val id: Snowflake | ||
get() = id | ||
override val threadId: Snowflake | ||
get() = threadId | ||
override val kord: Kord | ||
get() = kord | ||
override val supplier: EntitySupplier | ||
get() = supplier | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.