use of de.nikos410.discordbot.framework.PermissionLevel 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.PermissionLevel 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())));
}
use of de.nikos410.discordbot.framework.PermissionLevel in project de-DiscordBot by DACH-Discord.
the class UserLog method command_setUserlogChannel.
@CommandSubscriber(command = "setUserlogChannel", help = "Kanal für Userlog ändern", permissionLevel = PermissionLevel.ADMIN)
public void command_setUserlogChannel(final IMessage message, final String channel) {
final IChannel modlogChannel;
final List<IChannel> channelMentions = message.getChannelMentions();
if (GuildUtils.channelExists(message.getGuild(), channel)) {
// Kanal ID wurde als Parameter angegeben
modlogChannel = message.getGuild().getChannelByID(Long.parseLong(channel));
} else if (channelMentions.size() == 1) {
// ein Kanal wurde erwähnt
modlogChannel = channelMentions.get(0);
} else {
// Kein Kanal angegeben
DiscordIO.sendMessage(message.getChannel(), "Kein gültiger Kanal angegeben!");
return;
}
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
guildJSON.put("channel", modlogChannel.getLongID());
saveUserLogJSON();
// :white_check_mark:
message.addReaction(ReactionEmoji.of("✅"));
}
use of de.nikos410.discordbot.framework.PermissionLevel in project de-DiscordBot by DACH-Discord.
the class UserLog method command_enableUserlog.
@CommandSubscriber(command = "enableUserlog", help = "Userlog aktivieren", permissionLevel = PermissionLevel.ADMIN)
public void command_enableUserlog(final IMessage message) {
final IGuild guild = message.getGuild();
final JSONObject guildJSON = getJSONForGuild(guild);
if (!guildJSON.has("channel")) {
DiscordIO.sendMessage(message.getChannel(), "Es ist noch kein Kanal hinterlegt!");
}
guildJSON.put("on", true);
saveUserLogJSON();
// :white_check_mark:
message.addReaction(ReactionEmoji.of("✅"));
}
Aggregations