-
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.
- Loading branch information
1 parent
5c6ed1d
commit 5fb4587
Showing
15 changed files
with
91 additions
and
93 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
20 changes: 10 additions & 10 deletions
20
core/src/commonMain/kotlin/behavior/EntryPointCommandBehaviors.kt
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 |
---|---|---|
@@ -1,31 +1,31 @@ | ||
package dev.kord.core.behavior | ||
|
||
import dev.kord.core.cache.data.ApplicationCommandData | ||
import dev.kord.core.entity.application.EntryPointCommand | ||
import dev.kord.core.entity.application.GlobalEntryPointCommand | ||
import dev.kord.core.entity.application.GuildEntryPointCommand | ||
import dev.kord.core.entity.application.PrimaryEntryPointCommand | ||
import dev.kord.core.entity.application.GlobalPrimaryEntryPointCommand | ||
import dev.kord.core.entity.application.GuildPrimaryEntryPointCommand | ||
import dev.kord.rest.builder.interaction.EntryPointModifyBuilder | ||
|
||
public interface EntryPointCommandBehavior : ApplicationCommandBehavior { | ||
public suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): EntryPointCommand | ||
public suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): PrimaryEntryPointCommand | ||
} | ||
|
||
public interface GuildEntryPointCommandBehavior : EntryPointCommandBehavior, GuildApplicationCommandBehavior { | ||
override suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): GuildEntryPointCommand { | ||
val response = service.modifyGuildEntryPointApplicationCommand(applicationId, guildId, id) { | ||
override suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): GuildPrimaryEntryPointCommand { | ||
val response = service.modifyGuildPrimaryEntryPointApplicationCommand(applicationId, guildId, id) { | ||
builder() | ||
} | ||
val data = ApplicationCommandData.from(response) | ||
return GuildEntryPointCommand(data, service) | ||
return GuildPrimaryEntryPointCommand(data, service) | ||
} | ||
} | ||
|
||
public interface GlobalEntryPointCommandBehavior : EntryPointCommandBehavior, GlobalApplicationCommandBehavior { | ||
override suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): GlobalEntryPointCommand { | ||
val response = service.modifyGlobalEntryPointApplicationCommand(applicationId, id) { | ||
override suspend fun edit(builder: suspend EntryPointModifyBuilder.() -> Unit): GlobalPrimaryEntryPointCommand { | ||
val response = service.modifyGlobalPrimaryEntryPointApplicationCommand(applicationId, id) { | ||
builder() | ||
} | ||
val data = ApplicationCommandData.from(response) | ||
return GlobalEntryPointCommand(data, service) | ||
return GlobalPrimaryEntryPointCommand(data, service) | ||
} | ||
} |
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
Oops, something went wrong.