cleanup and reformat
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2025-09-05 00:06:35 +02:00
parent 14b54501fd
commit fd2970fa59
81 changed files with 1245 additions and 766 deletions

View File

@@ -14,7 +14,8 @@ import wtf.beatrice.hidekobot.objects.commands.SlashCommandImpl;
public class AvatarCommand extends SlashCommandImpl
{
@Override
public CommandData getSlashCommandData() {
public CommandData getSlashCommandData()
{
return Commands.slash("avatar", "Get someone's profile picture.")
.addOption(OptionType.USER, "user", "User you want to grab the avatar of.")
.addOption(OptionType.INTEGER, "size", "The size of the returned image.",
@@ -32,26 +33,28 @@ public class AvatarCommand extends SlashCommandImpl
int resolution;
OptionMapping userArg = event.getOption("user");
if(userArg != null)
if (userArg != null)
{
user = userArg.getAsUser();
} else {
} else
{
user = event.getUser();
}
OptionMapping sizeArg = event.getOption("size");
if(sizeArg != null)
if (sizeArg != null)
{
resolution = ProfileImage.parseResolution(sizeArg.getAsInt());
} else {
} else
{
resolution = ProfileImage.parseResolution(512);
}
MessageResponse response = ProfileImage.buildResponse(resolution, user, ProfileImage.ImageType.AVATAR);
if(response.content() != null)
if (response.content() != null)
{
event.getHook().editOriginal(response.content()).queue();
} else if(response.embed() != null)
} else if (response.embed() != null)
{
event.getHook().editOriginalEmbeds(response.embed()).queue();
}