|
|
@@ -6,7 +6,6 @@ import discord4j.core.event.domain.message.MessageCreateEvent; |
|
|
|
import discord4j.core.object.entity.GuildMessageChannel; |
|
|
|
import discord4j.core.object.entity.Member; |
|
|
|
import discord4j.core.object.util.Snowflake; |
|
|
|
import io.github.norbipeti.gcdc.Application; |
|
|
|
import org.springframework.beans.factory.annotation.Value; |
|
|
|
import org.springframework.stereotype.Component; |
|
|
|
import org.springframework.web.context.request.async.DeferredResult; |
|
|
@@ -43,9 +42,9 @@ public class DiscordService { |
|
|
|
client.getChannelById(Snowflake.of(channel)).cast(GuildMessageChannel.class) |
|
|
|
.flatMap(ch -> getUsername(user, ch) |
|
|
|
.flatMap(name -> ch.createEmbed(ecs -> ecs.setAuthor(name, null, null) |
|
|
|
.setColor(Color.BLUE).setDescription(message)))) |
|
|
|
.setColor(Color.BLUE).setDescription(message)).map(msg -> name))) |
|
|
|
.doOnError(result::setErrorResult) |
|
|
|
.subscribe(msg -> result.setResult(Application.RESULT_OK)); |
|
|
|
.subscribe(name -> result.setResult(Map.of("response", "OK", "username", name))); |
|
|
|
return result; |
|
|
|
} |
|
|
|
|
|
|
|