Archiviert
1
0
Add MuteCommand
Dieser Commit ist enthalten in:
yoyosource 2021-07-29 17:22:50 +02:00
Ursprung d9c819d096
Commit 54499a7c3e
3 geänderte Dateien mit 74 neuen und 0 gelöschten Zeilen

Datei anzeigen

@ -20,6 +20,8 @@
package de.steamwar.bungeecore.bot;
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.events.EventManager;
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.entities.Activity;
import net.dv8tion.jda.api.hooks.ListenerAdapter;
import net.dv8tion.jda.api.requests.restaction.CommandListUpdateAction;
import net.dv8tion.jda.api.utils.MemberCachePolicy;
import net.md_5.bungee.api.ProxyServer;
@ -90,6 +93,11 @@ public class SteamwarDiscordBot {
announcementListener = new AnnouncementListener();
ingameChatListener = new IngameChatListener();
serverTeamChatListener = new ServerTeamChatListener();
CommandListUpdateAction commands = jda.updateCommands();
commands.addCommands(new MuteCommand());
commands.addCommands(new BanCommand());
commands.complete();
}
private int index = 0;

Datei anzeigen

@ -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);
}
}

Datei anzeigen

@ -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);
}
}