mirror of
https://github.com/Sheldan/OnePlusBot.git
synced 2026-01-06 09:20:08 +00:00
[OPB-15] removing spaces before > for news posts, because of formatting issue of discord
This commit is contained in:
@@ -26,6 +26,8 @@ public class News extends AbstractConditionableCommand {
|
||||
@Override
|
||||
public CompletableFuture<CommandResult> executeAsync(CommandContext commandContext) {
|
||||
String text = (String) commandContext.getParameters().getParameters().get(0);
|
||||
// workaround for Discord formatting issue
|
||||
text = text.replace("\n >", "\n>");
|
||||
return newsServiceBean.sendNewsPost(text, commandContext.getMessage())
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ public class UpdateNews extends AbstractConditionableCommand {
|
||||
List<Object> parameters = commandContext.getParameters().getParameters();
|
||||
Long messageId = (Long) parameters.get(0);
|
||||
String postText = (String) parameters.get(1);
|
||||
// workaround for Discord formatting issue
|
||||
postText = postText.replace("\n >", "\n>");
|
||||
return newsServiceBean.updateNewsPostViaId(messageId, postText, commandContext.getMessage())
|
||||
.thenApply(unused -> CommandResult.fromSuccess());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user