mirror of
https://github.com/Sheldan/abstracto.git
synced 2026-04-15 04:02:53 +00:00
[AB-xxx] fixing not considering allowed mentions for interactions
This commit is contained in:
@@ -58,9 +58,6 @@ public class InteractionServiceBean implements InteractionService {
|
|||||||
@Autowired
|
@Autowired
|
||||||
private TemplateService templateService;
|
private TemplateService templateService;
|
||||||
|
|
||||||
@Autowired
|
|
||||||
private FileService fileService;
|
|
||||||
|
|
||||||
public static final CounterMetric EPHEMERAL_MESSAGES_SEND = CounterMetric
|
public static final CounterMetric EPHEMERAL_MESSAGES_SEND = CounterMetric
|
||||||
.builder()
|
.builder()
|
||||||
.name(DISCORD_API_INTERACTION_METRIC)
|
.name(DISCORD_API_INTERACTION_METRIC)
|
||||||
@@ -296,6 +293,10 @@ public class InteractionServiceBean implements InteractionService {
|
|||||||
action = action.setEphemeral(messageToSend.getEphemeral());
|
action = action.setEphemeral(messageToSend.getEphemeral());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Set<Message.MentionType> allowedMentions = allowedMentionService.getAllowedMentionsFor(callback.getMessageChannel(), messageToSend);
|
||||||
|
if(action != null) {
|
||||||
|
action.setAllowedMentions(allowedMentions);
|
||||||
|
}
|
||||||
|
|
||||||
if(action == null) {
|
if(action == null) {
|
||||||
throw new AbstractoRunTimeException("The callback did not result in any message.");
|
throw new AbstractoRunTimeException("The callback did not result in any message.");
|
||||||
@@ -312,7 +313,8 @@ public class InteractionServiceBean implements InteractionService {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public CompletableFuture<Message> replyString(String text, InteractionHook interactionHook) {
|
public CompletableFuture<Message> replyString(String text, InteractionHook interactionHook) {
|
||||||
return interactionHook.sendMessage(text).submit();
|
Set<Message.MentionType> allowedMentions = allowedMentionService.getAllowedMentionsFor(interactionHook.getInteraction().getMessageChannel(), null);
|
||||||
|
return interactionHook.sendMessage(text).setAllowedMentions(allowedMentions).submit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@PostConstruct
|
@PostConstruct
|
||||||
|
|||||||
Reference in New Issue
Block a user