From b5b306cc6d137cb96004226468677412a4d2142e Mon Sep 17 00:00:00 2001 From: Liam Date: Fri, 5 Jul 2024 19:40:01 +0100 Subject: [PATCH] fix welcome msg --- .../cc/fascinated/bat/service/GuildService.java | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/main/java/cc/fascinated/bat/service/GuildService.java b/src/main/java/cc/fascinated/bat/service/GuildService.java index 1db5755..bff59a5 100644 --- a/src/main/java/cc/fascinated/bat/service/GuildService.java +++ b/src/main/java/cc/fascinated/bat/service/GuildService.java @@ -13,6 +13,7 @@ import com.mongodb.client.model.Filters; import lombok.Getter; import lombok.NonNull; import lombok.extern.log4j.Log4j2; +import net.dv8tion.jda.api.entities.Member; import net.dv8tion.jda.api.entities.channel.concrete.TextChannel; import net.dv8tion.jda.api.entities.channel.unions.DefaultGuildChannelUnion; import net.dv8tion.jda.api.events.guild.GuildJoinEvent; @@ -119,15 +120,22 @@ public class GuildService extends ListenerAdapter implements EventListener { TextChannel channel = defaultChannel.asTextChannel(); BatCommand featureCommand = CommandService.INSTANCE.getCommand(FeatureCommand.class); BatCommand listSubCommand = featureCommand.getSubCommand(ListSubCommand.class); + BatCommand helpCommand = CommandService.INSTANCE.getCommand(HelpCommand.class); + Member owner = guild.getDiscordGuild().getOwner(); + if (owner != null) { + channel.sendMessage(owner.getAsMention()).queue(); + } channel.sendMessageEmbeds(EmbedUtils.genericEmbed() .setDescription(""" Hello! I'm %s, thank you for inviting me to your server! - To get started, use the command to see all the commands I have to offer! + To get started, use the command to see all the commands I have to offer! - Most of my features are disabled by default, view my features with + Most of my features are disabled by default, view my features with """.formatted( DiscordService.JDA.getSelfUser().getAsMention(), - CommandService.INSTANCE.getCommand(HelpCommand.class).getSnowflake(), + helpCommand.getInfo().getName(), + helpCommand.getSnowflake(), + featureCommand.getInfo().getName(), featureCommand.getSnowflake(), listSubCommand.getInfo().getName(), listSubCommand.getSnowflake()