Skip to content

Commit

Permalink
Add support for user-installable Apps
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Sep 22, 2024
1 parent a678efe commit 3ee8953
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 24 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.schlaubi.votebot.api.authentication

import io.jsonwebtoken.JwtException
import io.ktor.client.plugins.*
import io.ktor.http.auth.*
import io.ktor.server.application.*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,13 @@ import dev.kord.common.entity.Permission
import dev.kord.core.behavior.edit
import dev.schlaubi.mikbot.plugin.api.util.discordError
import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.client.request.forms.ChannelProvider
import jdk.internal.joptsimple.internal.Messages.message
import space.votebot.command.poll
import space.votebot.commands.vote.create.guildOnlyCommand
import space.votebot.commands.vote.create.voteCommandContext
import space.votebot.core.VoteBotDatabase
import space.votebot.core.VoteBotModule
import space.votebot.core.close
import space.votebot.core.findOneByMessage
import space.votebot.core.pieChartService
import space.votebot.core.toEmbed
import space.votebot.core.toPieChartCreateRequest

private val LOG = KotlinLogging.logger { }

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package space.votebot.commands.vote.create

import com.kotlindiscord.kord.extensions.DiscordRelayedException
import com.kotlindiscord.kord.extensions.commands.Arguments
import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext
import com.kotlindiscord.kord.extensions.commands.application.slash.PublicSlashCommandContext
Expand All @@ -14,7 +13,6 @@ import dev.kord.core.behavior.interaction.response.FollowupPermittingInteraction
import dev.kord.core.entity.channel.GuildMessageChannel
import dev.kord.rest.builder.message.MessageBuilder
import dev.schlaubi.mikbot.plugin.api.util.Confirmation
import dev.schlaubi.mikbot.plugin.api.util.Translator
import dev.schlaubi.mikbot.plugin.api.util.confirmation
import dev.schlaubi.mikbot.plugin.api.util.discordError
import kotlinx.datetime.Clock
Expand All @@ -26,7 +24,6 @@ import space.votebot.util.checkPermissions
import space.votebot.util.voteSafeGuild
import kotlin.time.Duration
import kotlin.time.Duration.Companion.minutes
import kotlin.time.Duration.Companion.seconds

suspend fun <A> SlashCommandContext<*, A, *>.createVote(response: FollowupPermittingInteractionResponseBehavior)
where A : Arguments, A : CreateSettings = createVote(response) { arguments }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import com.kotlindiscord.kord.extensions.components.types.emoji
import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand
import com.kotlindiscord.kord.extensions.parsers.DurationParser
import com.kotlindiscord.kord.extensions.parsers.DurationParserException
import com.kotlindiscord.kord.extensions.utils.getJumpUrl
import dev.kord.common.asJavaLocale
import dev.kord.common.entity.ApplicationIntegrationType
import dev.kord.common.entity.ButtonStyle
Expand Down
4 changes: 0 additions & 4 deletions plugin/src/main/kotlin/space/votebot/core/Renderer.kt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,10 @@ import dev.kord.common.entity.Permission
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.GuildBehavior
import dev.kord.core.behavior.channel.asChannelOf
import dev.kord.core.behavior.channel.asChannelOfOrNull
import dev.kord.core.behavior.interaction.response.EphemeralMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.edit
import dev.kord.core.builder.components.emoji
import dev.kord.core.entity.ReactionEmoji
import dev.kord.core.entity.channel.TopGuildMessageChannel
import dev.kord.core.entity.channel.thread.ThreadChannel
import dev.kord.rest.builder.component.ActionRowBuilder
import dev.kord.rest.builder.component.MessageComponentBuilder
import dev.kord.rest.builder.message.EmbedBuilder
Expand Down
5 changes: 0 additions & 5 deletions plugin/src/main/kotlin/space/votebot/core/VoteExecutor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,13 @@ import dev.kord.common.entity.Permission
import dev.kord.common.entity.Snowflake
import dev.kord.core.Kord
import dev.kord.core.behavior.GuildBehavior
import dev.kord.core.behavior.channel.asChannelOf
import dev.kord.core.behavior.interaction.response.EphemeralMessageInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.createEphemeralFollowup
import dev.kord.core.behavior.interaction.response.edit
import dev.kord.core.behavior.interaction.updatePublicMessage
import dev.kord.core.entity.channel.GuildChannel
import dev.kord.core.entity.channel.GuildMessageChannel
import dev.kord.core.entity.channel.TopGuildMessageChannel
import dev.kord.core.entity.channel.thread.ThreadChannel
import dev.kord.core.event.interaction.ButtonInteractionCreateEvent
import dev.kord.core.event.interaction.GuildButtonInteractionCreateEvent
import dev.kord.gateway.Event
import dev.kord.x.emoji.Emojis
import dev.schlaubi.mikbot.plugin.api.util.MessageSender
import dev.schlaubi.mikbot.plugin.api.util.Translator
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package space.votebot.core

import com.kotlindiscord.kord.extensions.commands.application.slash.EphemeralSlashCommandContext
import com.kotlindiscord.kord.extensions.commands.application.slash.SlashCommandContext
import dev.kord.common.annotation.KordExperimental
import dev.kord.common.annotation.KordUnsafe
import dev.kord.common.entity.ALL
Expand All @@ -12,15 +11,13 @@ import dev.kord.core.Kord
import dev.kord.core.KordObject
import dev.kord.core.behavior.MessageBehavior
import dev.kord.core.behavior.channel.GuildMessageChannelBehavior
import dev.kord.core.behavior.channel.asChannelOf
import dev.kord.core.behavior.channel.createMessage
import dev.kord.core.behavior.edit
import dev.kord.core.behavior.interaction.followup.FollowupMessageBehavior
import dev.kord.core.behavior.interaction.followup.PublicFollowupMessageBehavior
import dev.kord.core.behavior.interaction.followup.edit
import dev.kord.core.behavior.interaction.response.FollowupPermittingInteractionResponseBehavior
import dev.kord.core.behavior.interaction.response.createPublicFollowup
import dev.kord.core.entity.channel.GuildMessageChannel
import dev.kord.core.entity.channel.TopGuildMessageChannel
import dev.kord.core.entity.channel.thread.ThreadChannel
import dev.kord.rest.builder.message.create.MessageCreateBuilder
Expand Down
2 changes: 0 additions & 2 deletions plugin/src/main/kotlin/space/votebot/util/PollMessageUtil.kt
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
package space.votebot.util

import dev.kord.core.behavior.channel.GuildMessageChannelBehavior
import dev.kord.core.behavior.channel.asChannelOf
import dev.kord.core.entity.Message
import dev.kord.core.entity.channel.GuildChannel
import space.votebot.common.models.Poll

fun Message.toPollMessage() = Poll.Message(
Expand Down

0 comments on commit 3ee8953

Please sign in to comment.