use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class UserGroups method command_removeGroup.
@CommandSubscriber(command = "removeGroup", help = "Gruppe entfernen", pmAllowed = false, permissionLevel = PermissionLevel.MODERATOR)
public void command_removeGroup(final IMessage message, final String groupName) {
final IGuild guild = message.getGuild();
// Validate group first
validateGroup(guild, groupName);
final JSONObject guildJSON = getJSONForGuild(guild);
if (!guildJSON.has(groupName)) {
DiscordIO.sendMessage(message.getChannel(), String.format(":x: Gruppe `%s` nicht gefunden!", groupName));
return;
}
final IRole role = guild.getRoleByID(guildJSON.getLong(groupName));
role.delete();
guildJSON.remove(groupName);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), String.format(":white_check_mark: Gruppe `%s` entfernt.", groupName));
LOG.info(String.format("%s deleted group %s.", UserUtils.makeUserString(message.getAuthor(), guild), groupName));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_enableWelcome.
@CommandSubscriber(command = "enableWelcome", help = "Begrüßungsnachricht aktivieren", permissionLevel = PermissionLevel.ADMIN, pmAllowed = false)
public void command_enableWelcome(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("on", true);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), ":white_check_mark: Aktiviert!");
LOG.info(String.format("%s enabled welcome messages for server %s (ID: %s)", UserUtils.makeUserString(message.getAuthor(), message.getGuild()), guild.getName(), guild.getStringID()));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_disableWelcome.
@CommandSubscriber(command = "disableWelcome", help = "Begrüßungsnachricht deaktivieren", permissionLevel = PermissionLevel.ADMIN, pmAllowed = false)
public void command_disableWelcome(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("on", false);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), ":white_check_mark: Deaktiviert!");
LOG.info(String.format("%s disabled welcome messages for server %s (ID: %s)", UserUtils.makeUserString(message.getAuthor(), message.getGuild()), guild.getName(), guild.getStringID()));
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_regeln.
@CommandSubscriber(command = "regeln", help = "Die Regeln dieses Servers", pmAllowed = false)
public void command_regeln(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
if (guildJSON.has("rulesDE")) {
DiscordIO.sendMessage(message.getAuthor().getOrCreatePMChannel(), guildJSON.getString("rulesDE"));
if (!message.getChannel().isPrivate()) {
DiscordIO.sendMessage(message.getChannel(), ":mailbox_with_mail:");
}
} else {
DiscordIO.sendMessage(message.getChannel(), "Keine Regeln für diesen Server hinterlegt.");
}
}
use of de.nikos410.discordbot.framework.annotations.CommandSubscriber in project de-DiscordBot by DACH-Discord.
the class Rules method command_setRules.
@CommandSubscriber(command = "setRules", help = "Regeln (englisch) ändern", permissionLevel = PermissionLevel.ADMIN, pmAllowed = false)
public void command_setRules(final IMessage message, final String rulesEN) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("rulesEN", rulesEN);
saveJSON();
DiscordIO.sendMessage(message.getChannel(), ":white_check_mark: Regeln (EN) geändert:");
DiscordIO.sendMessage(message.getChannel(), rulesEN);
LOG.info(String.format("%s changed rules. (EN)", UserUtils.makeUserString(message.getAuthor(), message.getGuild())));
}
Aggregations