Compare commits

..

3 Commits

Author SHA1 Message Date
7ae4790d5c Add bot owner info to botinfo command
All checks were successful
continuous-integration/drone/push Build is passing
2022-11-22 00:45:58 +01:00
51de18206e Refactor clearchat class 2022-11-22 00:35:10 +01:00
d3db53a451 Cleanup imports 2022-11-22 00:34:37 +01:00
6 changed files with 10 additions and 7 deletions

View File

@ -2,9 +2,9 @@ package wtf.beatrice.hidekobot;
import net.dv8tion.jda.api.interactions.commands.Command; import net.dv8tion.jda.api.interactions.commands.Command;
import org.jetbrains.annotations.Nullable; import org.jetbrains.annotations.Nullable;
import wtf.beatrice.hidekobot.datasource.ConfigurationSource;
import wtf.beatrice.hidekobot.datasource.DatabaseSource; import wtf.beatrice.hidekobot.datasource.DatabaseSource;
import wtf.beatrice.hidekobot.listeners.MessageLogger; import wtf.beatrice.hidekobot.listeners.MessageLogger;
import wtf.beatrice.hidekobot.datasource.ConfigurationSource;
import wtf.beatrice.hidekobot.util.Logger; import wtf.beatrice.hidekobot.util.Logger;
import java.awt.*; import java.awt.*;

View File

@ -6,6 +6,7 @@ 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.requests.GatewayIntent; import net.dv8tion.jda.api.requests.GatewayIntent;
import sun.misc.Signal; import sun.misc.Signal;
import wtf.beatrice.hidekobot.datasource.ConfigurationSource;
import wtf.beatrice.hidekobot.datasource.DatabaseSource; import wtf.beatrice.hidekobot.datasource.DatabaseSource;
import wtf.beatrice.hidekobot.listeners.ButtonInteractionListener; import wtf.beatrice.hidekobot.listeners.ButtonInteractionListener;
import wtf.beatrice.hidekobot.listeners.MessageListener; import wtf.beatrice.hidekobot.listeners.MessageListener;
@ -14,7 +15,6 @@ import wtf.beatrice.hidekobot.listeners.SlashCommandListener;
import wtf.beatrice.hidekobot.runnables.CommandsUpdateTask; import wtf.beatrice.hidekobot.runnables.CommandsUpdateTask;
import wtf.beatrice.hidekobot.runnables.ExpiredMessageTask; import wtf.beatrice.hidekobot.runnables.ExpiredMessageTask;
import wtf.beatrice.hidekobot.runnables.HeartBeatTask; import wtf.beatrice.hidekobot.runnables.HeartBeatTask;
import wtf.beatrice.hidekobot.datasource.ConfigurationSource;
import wtf.beatrice.hidekobot.util.Logger; import wtf.beatrice.hidekobot.util.Logger;
import wtf.beatrice.hidekobot.util.SlashCommandUtil; import wtf.beatrice.hidekobot.util.SlashCommandUtil;

View File

@ -34,7 +34,10 @@ public class BotInfoCommand
if(botAvatarUrl != null) embedBuilder.setThumbnail(botAvatarUrl); if(botAvatarUrl != null) embedBuilder.setThumbnail(botAvatarUrl);
// help field // help field
embedBuilder.addField("Getting started", "Type `/help` for help!", false); long ownerId = Cache.getBotOwnerId();
embedBuilder.addField("Getting started",
"This instance is run by <@" + ownerId + ">.\nType `/help` for help! ",
false);
// commands list field // commands list field
StringBuilder commandsListBuilder = new StringBuilder(); StringBuilder commandsListBuilder = new StringBuilder();

View File

@ -17,7 +17,7 @@ import wtf.beatrice.hidekobot.Cache;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
public class ClearChatCommand public class ClearCommand
{ {
public void runSlashCommand(@NotNull SlashCommandInteractionEvent event) public void runSlashCommand(@NotNull SlashCommandInteractionEvent event)

View File

@ -2,7 +2,7 @@ package wtf.beatrice.hidekobot.listeners;
import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent; import net.dv8tion.jda.api.events.interaction.component.ButtonInteractionEvent;
import net.dv8tion.jda.api.hooks.ListenerAdapter; import net.dv8tion.jda.api.hooks.ListenerAdapter;
import wtf.beatrice.hidekobot.commands.slash.ClearChatCommand; import wtf.beatrice.hidekobot.commands.slash.ClearCommand;
import wtf.beatrice.hidekobot.commands.slash.CoinFlipCommand; import wtf.beatrice.hidekobot.commands.slash.CoinFlipCommand;
public class ButtonInteractionListener extends ListenerAdapter public class ButtonInteractionListener extends ListenerAdapter
@ -18,7 +18,7 @@ public class ButtonInteractionListener extends ListenerAdapter
case "coinflip_reflip" -> new CoinFlipCommand().buttonReFlip(event); case "coinflip_reflip" -> new CoinFlipCommand().buttonReFlip(event);
// clearchat command // clearchat command
case "clear_dismiss" -> new ClearChatCommand().dismissMessage(event); case "clear_dismiss" -> new ClearCommand().dismissMessage(event);
} }

View File

@ -14,7 +14,7 @@ public class SlashCommandListener extends ListenerAdapter
switch (event.getName().toLowerCase()) { switch (event.getName().toLowerCase()) {
case "avatar" -> new AvatarCommand().runSlashCommand(event); case "avatar" -> new AvatarCommand().runSlashCommand(event);
case "botinfo" -> new BotInfoCommand().runSlashCommand(event); case "botinfo" -> new BotInfoCommand().runSlashCommand(event);
case "clear" -> new ClearChatCommand().runSlashCommand(event); case "clear" -> new ClearCommand().runSlashCommand(event);
case "coinflip" -> new CoinFlipCommand().runSlashCommand(event); case "coinflip" -> new CoinFlipCommand().runSlashCommand(event);
case "die" -> new DieCommand().runSlashCommand(event); case "die" -> new DieCommand().runSlashCommand(event);
case "help" -> new HelpCommand().runSlashCommand(event); case "help" -> new HelpCommand().runSlashCommand(event);