fix welcome msg

This commit is contained in:
Lee 2024-07-05 19:40:01 +01:00
parent 5b917af1ca
commit b5b306cc6d

@ -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 </%s> command to see all the commands I have to offer!
To get started, use the </%s:%s> command to see all the commands I have to offer!
Most of my features are disabled by default, view my features with </%s %s:%s>
Most of my features are disabled by default, view my features with </%s:%s %s:%s>
""".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()