Skip to content

Commit

Permalink
Mail read
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Jun 26, 2024
1 parent 8b0b5e1 commit e932cdd
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ public IMessageBuilder commandButton(String command, String message) {
command = id + "";
remapLongCommands.put(command, cmdLong);
}
if (message.equalsIgnoreCase("cancel")) {
if (message.equalsIgnoreCase("cancel") || message.equalsIgnoreCase("dismiss")) {
buttons.add(Button.danger(command, message));
} else {
buttons.add(Button.primary(command, message));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,16 @@ public String renameButton(@Me User user, @Me IMessageIO io, @Me Guild guild, @M

DiscordMessageBuilder msg = new DiscordMessageBuilder(message.getChannel(), message);
msg.clearButtons();
for (Map.Entry<String, String> entry : reactions.entrySet()) {
msg.commandButton(entry.getValue(), entry.getKey());

if (reactions != null) {
for (Map.Entry<String, String> entry : reactions.entrySet()) {
msg.commandButton(entry.getValue(), entry.getKey());
}
}
for (Button button : message.getButtons()) {
if (!button.getId().equalsIgnoreCase(button.getLabel())) {
msg.commandButton(button.getId(), button.getLabel());
}
}
msg.send();
io.create().embed("Deleted Button", "Done! Renamed button `" + label + "` to " + rename_to + "\n" +
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ public void onMailReceived(MailReceivedEvent event) throws IOException {
DBNation receiver = Locutus.imp().getNationDB().getNationByLeader(event.getMail().leader);
CM.mail.reply mailCmd = CM.mail.reply.cmd.receiver(receiver.getId() + "").url(event.getUrl()).message("").sender(event.getAuth().getNationId() + "");
builder.modal(CommandBehavior.DELETE_PRESSED_BUTTON, mailCmd, "\uD83D\uDCE7 Reply");

builder.commandButton(CM.mail.read.cmd.messageId(event.getMail().id + "").account(receiver.getId() + ""), "Read");
builder.send();

processCommands(Locutus.imp().getGuildDB(guild), guild, outputBuilder, event);
Expand Down

0 comments on commit e932cdd

Please sign in to comment.