Add BanCommand
Add MuteCommand
Dieser Commit ist enthalten in:
Ursprung
d9c819d096
Commit
54499a7c3e
@ -20,6 +20,8 @@
|
|||||||
package de.steamwar.bungeecore.bot;
|
package de.steamwar.bungeecore.bot;
|
||||||
|
|
||||||
import de.steamwar.bungeecore.BungeeCore;
|
import de.steamwar.bungeecore.BungeeCore;
|
||||||
|
import de.steamwar.bungeecore.bot.commands.BanCommand;
|
||||||
|
import de.steamwar.bungeecore.bot.commands.MuteCommand;
|
||||||
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
|
import de.steamwar.bungeecore.bot.config.SteamwarDiscordBotConfig;
|
||||||
import de.steamwar.bungeecore.bot.events.EventManager;
|
import de.steamwar.bungeecore.bot.events.EventManager;
|
||||||
import de.steamwar.bungeecore.bot.listeners.*;
|
import de.steamwar.bungeecore.bot.listeners.*;
|
||||||
@ -33,6 +35,7 @@ import net.dv8tion.jda.api.JDABuilder;
|
|||||||
import net.dv8tion.jda.api.OnlineStatus;
|
import net.dv8tion.jda.api.OnlineStatus;
|
||||||
import net.dv8tion.jda.api.entities.Activity;
|
import net.dv8tion.jda.api.entities.Activity;
|
||||||
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
import net.dv8tion.jda.api.hooks.ListenerAdapter;
|
||||||
|
import net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction;
|
||||||
import net.dv8tion.jda.api.utils.MemberCachePolicy;
|
import net.dv8tion.jda.api.utils.MemberCachePolicy;
|
||||||
import net.md_5.bungee.api.ProxyServer;
|
import net.md_5.bungee.api.ProxyServer;
|
||||||
|
|
||||||
@ -90,6 +93,11 @@ public class SteamwarDiscordBot {
|
|||||||
announcementListener = new AnnouncementListener();
|
announcementListener = new AnnouncementListener();
|
||||||
ingameChatListener = new IngameChatListener();
|
ingameChatListener = new IngameChatListener();
|
||||||
serverTeamChatListener = new ServerTeamChatListener();
|
serverTeamChatListener = new ServerTeamChatListener();
|
||||||
|
|
||||||
|
CommandListUpdateAction commands = jda.updateCommands();
|
||||||
|
commands.addCommands(new MuteCommand());
|
||||||
|
commands.addCommands(new BanCommand());
|
||||||
|
commands.complete();
|
||||||
}
|
}
|
||||||
|
|
||||||
private int index = 0;
|
private int index = 0;
|
||||||
|
33
src/de/steamwar/bungeecore/bot/commands/BanCommand.java
Normale Datei
33
src/de/steamwar/bungeecore/bot/commands/BanCommand.java
Normale Datei
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bungeecore.bot.commands;
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
|
||||||
|
|
||||||
|
public class BanCommand extends CommandData {
|
||||||
|
|
||||||
|
public BanCommand() {
|
||||||
|
super("ban", "Ban a user. Requires permission to ban users.");
|
||||||
|
|
||||||
|
addOption(OptionType.STRING, "user", "The user to bam", true);
|
||||||
|
addOption(OptionType.STRING, "duration", "The time to ban until", true);
|
||||||
|
}
|
||||||
|
}
|
33
src/de/steamwar/bungeecore/bot/commands/MuteCommand.java
Normale Datei
33
src/de/steamwar/bungeecore/bot/commands/MuteCommand.java
Normale Datei
@ -0,0 +1,33 @@
|
|||||||
|
/*
|
||||||
|
* This file is a part of the SteamWar software.
|
||||||
|
*
|
||||||
|
* Copyright (C) 2020 SteamWar.de-Serverteam
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU Affero General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU Affero General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU Affero General Public License
|
||||||
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.steamwar.bungeecore.bot.commands;
|
||||||
|
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.OptionType;
|
||||||
|
import net.dv8tion.jda.api.interactions.commands.build.CommandData;
|
||||||
|
|
||||||
|
public class MuteCommand extends CommandData {
|
||||||
|
|
||||||
|
public MuteCommand() {
|
||||||
|
super("mute", "Mute a user. Requires permission to mute users.");
|
||||||
|
|
||||||
|
addOption(OptionType.STRING, "user", "The user to mute", true);
|
||||||
|
addOption(OptionType.STRING, "duration", "The time to mute until", true);
|
||||||
|
}
|
||||||
|
}
|
In neuem Issue referenzieren
Einen Benutzer sperren