forked from Kord-Extensions/kord-extensions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix sentry error with user command events
- Loading branch information
1 parent
f4dc6f9
commit 99b1ef0
Showing
7 changed files
with
129 additions
and
1 deletion.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
32 changes: 32 additions & 0 deletions
32
...kotlin/com/kotlindiscord/kord/extensions/commands/application/PrimaryEntryPointCommand.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 |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* This Source Code Form is subject to the terms of the Mozilla Public | ||
* License, v. 2.0. If a copy of the MPL was not distributed with this | ||
* file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
*/ | ||
|
||
package com.kotlindiscord.kord.extensions.commands.application | ||
|
||
import com.kotlindiscord.kord.extensions.extensions.Extension | ||
import com.kotlindiscord.kord.extensions.utils.MutableStringKeyedMap | ||
import dev.kord.common.entity.ApplicationCommandType | ||
import dev.kord.common.entity.EntryPointCommandHandlerType | ||
|
||
public open class PrimaryEntryPointCommand(extension: Extension) : ApplicationCommand<Nothing>(extension) { | ||
|
||
public lateinit var handler: EntryPointCommandHandlerType | ||
|
||
/** Command description, as displayed on Discord. **/ | ||
public open lateinit var description: String | ||
|
||
/** | ||
* A [Localized] version of [description]. | ||
*/ | ||
public val localizedDescription: Localized<String> by lazy { localize(description) } | ||
|
||
override val type: ApplicationCommandType = ApplicationCommandType.PrimaryEntryPoint | ||
|
||
override suspend fun call( | ||
event: Nothing, | ||
cache: MutableStringKeyedMap<Any>, | ||
): Nothing = error("Primary entry point commands can't be called") | ||
} |
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