Skip to content

Commit

Permalink
Small cleanups and fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
gdude2002 committed Dec 10, 2023
1 parent 681eebf commit afe77a8
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 16 deletions.
2 changes: 0 additions & 2 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ import dev.kord.common.entity.ApplicationCommandType
import dev.kord.common.entity.Permission
import dev.kord.common.entity.Permissions
import dev.kord.common.entity.Snowflake
import dev.kord.core.behavior.GuildBehavior
import dev.kord.core.event.interaction.InteractionCreateEvent
import org.koin.core.component.inject
import dev.kord.common.Locale as KLocale
Expand Down Expand Up @@ -80,7 +79,7 @@ public abstract class ApplicationCommand<E : InteractionCreateEvent>(
public open var allowInDms: Boolean = extension.allowApplicationCommandInDMs
get() {
if (guildId != null) {
return true
return false
}

return field
Expand Down Expand Up @@ -140,20 +139,10 @@ public abstract class ApplicationCommand<E : InteractionCreateEvent>(
}

/** Specify a specific guild for this application command to be locked to. **/
public open fun guild(guild: Snowflake) {
public open fun guild(guild: Snowflake?) {
this.guildId = guild
}

/** Specify a specific guild for this application command to be locked to. **/
public open fun guild(guild: Long) {
this.guildId = Snowflake(guild)
}

/** Specify a specific guild for this application command to be locked to. **/
public open fun guild(guild: GuildBehavior) {
this.guildId = guild.id
}

/**
* Define a check which must pass for the command to be executed.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import com.kotlindiscord.kord.extensions.annotations.AlwaysPublicResponse
import com.kotlindiscord.kord.extensions.annotations.UnexpectedBehaviour
import com.kotlindiscord.kord.extensions.pagination.BaseButtonPaginator
import com.kotlindiscord.kord.extensions.pagination.builders.PaginatorBuilder
import dev.kord.core.behavior.interaction.response.InteractionResponseBehavior
import dev.kord.core.entity.interaction.followup.FollowupMessage
import dev.kord.core.entity.interaction.response.MessageInteractionResponse
import dev.kord.rest.builder.message.create.FollowupMessageCreateBuilder
Expand All @@ -35,7 +36,7 @@ public typealias GenericInteractionContext = InteractionContext<*, *, *, *>
* @param OppositeFollowupType Generic representing the opposite follow-up type for the current interaction type.
*/
public interface InteractionContext<
ResponseBehavior,
ResponseBehavior : InteractionResponseBehavior,
ResponseType : MessageInteractionResponse,
FollowupType : FollowupMessage,
OppositeFollowupType : FollowupMessage,
Expand Down

0 comments on commit afe77a8

Please sign in to comment.