Skip to content

Commit

Permalink
feat(goldenframe): server avatar option
Browse files Browse the repository at this point in the history
  • Loading branch information
leomotors committed Sep 10, 2023
1 parent 5079e04 commit 7ff1cc4
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

Previous changelog before 4.0.605 may not be noted here.

## [4.1.701] - 2023-09-10

- feat(goldenframe): option to choose between server avatar and default avatar

## [4.1.700] - 2023-09-10

- feat: kaede
Expand Down
7 changes: 6 additions & 1 deletion apps/bot/src/commands/main.slash.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ export class Main extends CogSlashClass {
frame: Param.String.Type,
@Param.User("Who to put in the golden frame", { required: false })
who: Param.User.Nullable,
@Param.Boolean("Use real profile image rather than server", {
required: false,
})
real_image: Param.Boolean.Nullable,
@Param.Attachment("Image to put in the frame", { required: false })
img: Param.Attachment.Nullable,
) {
Expand All @@ -81,7 +85,8 @@ export class Main extends CogSlashClass {

let url: string | null;
if (who) {
url = who.avatarURL({ size: 4096, forceStatic: true });
const options = { size: 4096, forceStatic: true } as const;
url = (real_image ? who.avatarURL : who.displayAvatarURL)(options);
if (!url) {
await ctx.followUp(
"Golden Frame Failed: Target user has no profile picture!",
Expand Down
2 changes: 1 addition & 1 deletion packages/constants/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
// * Data such as App Version, Waifu Specific Information and common consts
// * will be in this package

export const AppVersion = "4.1.700";
export const AppVersion = "4.1.701";

export const ShortNameEN = "Kaede";
export const ShortNameJA = "かえで";
Expand Down

0 comments on commit 7ff1cc4

Please sign in to comment.