Skip to content

Commit

Permalink
Work around a bug in new dotty-cps-async
Browse files Browse the repository at this point in the history
  • Loading branch information
ScoreUnder committed Jan 31, 2022
1 parent 63261a9 commit a92a67c
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/scala/score/discord/canti/functionality/Spoilers.scala
Original file line number Diff line number Diff line change
Expand Up @@ -79,11 +79,14 @@ class Spoilers(spoilerTexts: AsyncMap[ID[Message], String], conversations: Conve
onFail = APIHelper.loudFailure("deleting a message", ctx.invoker.asMessageReceiver)
)

ctx.args.get(spoilerArg) match
case None =>
await(createSpoilerConversation(ctx.invoker))
case Some(trimmed) =>
await(createSpoiler(ctx.invoker.asMessageReceiver, ctx.invoker.user, trimmed))
val futureSpoilerMessage =
ctx.args.get(spoilerArg) match
case None =>
createSpoilerConversation(ctx.invoker)
case Some(trimmed) =>
createSpoiler(ctx.invoker.asMessageReceiver, ctx.invoker.user, trimmed)

await(futureSpoilerMessage)
}

private def createSpoilerConversation(invoker: CommandInvoker): Future[RetrievableMessage] =
Expand Down

0 comments on commit a92a67c

Please sign in to comment.