use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_setRegeln.
@CommandSubscriber(command = "setRegeln", help = "Regeln (deutsch) ändern", permissionLevel = PermissionLevel.ADMIN, pmAllowed = false)
public void command_setRegeln(final IMessage message, final String rulesDE) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("rulesDE", rulesDE);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), ":white_check_mark: Regeln (DE) geändert:");
DiscordIO.sendMessage(message.getChannel(), rulesDE);
LOG.info(String.format("%s changed rules. (DE)", UserUtils.makeUserString(message.getAuthor(), message.getGuild())));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_setFooter.
@CommandSubscriber(command = "setFooter", help = "Footer der Begüßungsnachricht ändern.", permissionLevel = PermissionLevel.ADMIN, pmAllowed = false)
public void command_setFooter(final IMessage message, final String footer) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("footer", footer);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), ":white_check_mark: Begrüßungs-Footer geändert:");
DiscordIO.sendMessage(message.getChannel(), footer);
LOG.info(String.format("%s changed rules. (DE)", UserUtils.makeUserString(message.getAuthor(), message.getGuild())));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class UserLog method command_userlogTest.
@CommandSubscriber(command = "userlogTest", help = "Userlog-Ausgabe testen", permissionLevel = PermissionLevel.ADMIN)
public void command_userlogTest(final IMessage message) {
final IUser user = message.getAuthor();
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
if (!guildJSON.has("channel")) {
DiscordIO.sendMessage(message.getChannel(), "Fehler! Kein Kanal hinterlegt!");
return;
}
final long channelID = guildJSON.getLong("channel");
final IChannel channel = guild.getChannelByID(channelID);
if (channel != null) {
userJoinNotify(user, channel);
userLeaveNotify(user, channel);
userBanNotify(user, channel);
}
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class UserLog method command_disableUserlog.
@CommandSubscriber(command = "disableUserlog", help = "Userlog deaktivieren", permissionLevel = PermissionLevel.ADMIN)
public void command_disableUserlog(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("on", false);
saveUserLogJSON();
// :white_check_mark:
message.addReaction(ReactionEmoji.of("✅"));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_rules.
@CommandSubscriber(command = "rules", help = "The rules of this server", pmAllowed = false)
public void command_rules(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
if (guildJSON.has("rulesEN")) {
DiscordIO.sendMessage(message.getAuthor().getOrCreatePMChannel(), guildJSON.getString("rulesEN"));
if (!message.getChannel().isPrivate()) {
DiscordIO.sendMessage(message.getChannel(), ":mailbox_with_mail:");
}
} else {
DiscordIO.sendMessage(message.getChannel(), "No rules found for this server.");
}
}
Aggregations