我正在尝试创建一个ticketdiscord机器人,它生成一个文本频道并将其放置在一个类别中。以下是我目前的情况:
import net.dv8tion.jda.api.entities.Category;
import net.dv8tion.jda.api.events.message.MessageReceivedEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.internal.entities.TextChannelImpl;
public class Commands extends ListenerAdapter {
public void onMessageReceived(MessageReceivedEvent event) {
if (event.getMessage().getContentRaw().equals(".new")) {
event.getChannel().sendMessage("Created new Ticket");
event.getGuild().createTextChannel("Ticket", "777209975935467541");
}
}
}
它一直告诉我类别(“777209975935467541”)不能是字符串或长字符串。太好了!
1条答案
按热度按时间5sxhfpxr1#
你可以用
category.createTextChannel("ticket").queue()
.例子:
请参阅类别#createtextchannel。