Skip to content

Commit

Permalink
test
Browse files Browse the repository at this point in the history
  • Loading branch information
xdnw committed Jul 24, 2024
1 parent 3663a33 commit 14c299f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public void onMailReceived(MailReceivedEvent event) throws IOException {
builder.embed(event.getTitle(), body.toString());
if (receiver.getId() != authId) {
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.modal(CommandBehavior.UNPRESS, mailCmd, "\uD83D\uDCE7 Reply");
}

builder.commandButton(CommandBehavior.UNPRESS, CM.mail.read.cmd.message_id(event.getMail().id + "").account(authId + ""), "Read");
Expand Down
22 changes: 16 additions & 6 deletions src/main/java/link/locutus/discord/web/test/TestCommands.java
Original file line number Diff line number Diff line change
Expand Up @@ -20,12 +20,15 @@
import link.locutus.discord.db.entities.DBNation;
import link.locutus.discord.db.entities.Transaction2;
import link.locutus.discord.user.Roles;
import link.locutus.discord.util.ImageUtil;
import link.locutus.discord.util.MathMan;
import link.locutus.discord.util.PW;
import link.locutus.discord.util.StringMan;
import link.locutus.discord.util.*;
import link.locutus.discord.util.discord.DiscordUtil;
import net.dv8tion.jda.api.entities.Guild;
import net.dv8tion.jda.api.entities.Message;
import net.dv8tion.jda.api.entities.Webhook;
import net.dv8tion.jda.api.entities.channel.ChannelType;
import net.dv8tion.jda.api.entities.channel.concrete.NewsChannel;
import net.dv8tion.jda.api.entities.channel.concrete.TextChannel;
import net.dv8tion.jda.api.entities.channel.middleman.GuildMessageChannel;
import org.json.JSONObject;

import java.io.IOException;
Expand All @@ -39,7 +42,14 @@

public class TestCommands {
// @Command
// public String test(@Me IMessageIO io) throws IOException {
public String test(@Me Guild guild, TextChannel channel, NewsChannel subscribe) throws IOException {
Webhook.WebhookReference ref = RateLimitUtil.complete(subscribe.follow(channel));
if (ref == null) {
return "Failed to subscribe to " + subscribe.getAsMention() + " in " + channel.getAsMention();
}
return "Subscribed to " + subscribe.getAsMention() + " in " + channel.getAsMention() + "\n" +
"Webhook: " + ref.toString();

// List<CommandRef> refs = List.of(
// CM.embed.update.cmd.desc("{description}\ntest"),
// CM.fun.say.cmd.msg("Hello World")
Expand All @@ -51,7 +61,7 @@ public class TestCommands {
////// "- " + CM.fun.borg.cmd.toSlashMention() + "\n" +
////// "- " + CM.fun.borg.cmd.create("Hello World").toSlashCommand(true);
// return "Arg ";
// }
}

@Command(desc = "Dummy command. No output")
public String dummy() {
Expand Down

0 comments on commit 14c299f

Please sign in to comment.