Skip to content

Commit

Permalink
Merge branch 'hipperooni-branch' of https://github.com/tripsit/TripBot
Browse files Browse the repository at this point in the history
…into hipperooni-branch
  • Loading branch information
LunaUrsa committed Nov 15, 2023
2 parents a913d11 + 41dc58d commit e8e6380
Show file tree
Hide file tree
Showing 6 changed files with 631 additions and 185 deletions.
24 changes: 12 additions & 12 deletions src/discord/commands/guild/d.levels.ts
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ export const dLevels: SlashCommand = {

// Default Progress Bars Calculate
// const progressText = levelData.TEXT.TOTAL.level_exp / levelData.TEXT.TOTAL.nextLevel;
const progressTotal = levelData.ALL.TOTAL.level_exp / levelData.TEXT.TOTAL.nextLevel;
const progressTotal = levelData.ALL.TOTAL.level_exp / levelData.ALL.TOTAL.nextLevel;
const progressGeneral = levelData.TEXT.GENERAL
? levelData.TEXT.GENERAL.level_exp / levelData.TEXT.GENERAL.nextLevel
: 0;
Expand Down Expand Up @@ -790,27 +790,27 @@ export const dLevels: SlashCommand = {

// Choose and Draw the Level Image
let LevelImagePath = '' as string;
if (levelData.TEXT.TOTAL.level < 10) {
if (levelData.ALL.TOTAL.level <= 9) {
LevelImagePath = 'badgeVip0';
} else if (levelData.TEXT.TOTAL.level < 20) {
} else if (levelData.ALL.TOTAL.level <= 19) {
LevelImagePath = 'badgeVip1';
} else if (levelData.TEXT.TOTAL.level < 30) {
} else if (levelData.ALL.TOTAL.level <= 29) {
LevelImagePath = 'badgeVip2';
} else if (levelData.TEXT.TOTAL.level < 40) {
} else if (levelData.ALL.TOTAL.level <= 39) {
LevelImagePath = 'badgeVip3';
} else if (levelData.TEXT.TOTAL.level < 50) {
} else if (levelData.ALL.TOTAL.level <= 49) {
LevelImagePath = 'badgeVip4';
} else if (levelData.TEXT.TOTAL.level < 60) {
} else if (levelData.ALL.TOTAL.level <= 59) {
LevelImagePath = 'badgeVip5';
} else if (levelData.TEXT.TOTAL.level < 70) {
} else if (levelData.ALL.TOTAL.level <= 69) {
LevelImagePath = 'badgeVip6';
} else if (levelData.TEXT.TOTAL.level < 80) {
} else if (levelData.ALL.TOTAL.level <= 79) {
LevelImagePath = 'badgeVip7';
} else if (levelData.TEXT.TOTAL.level < 90) {
} else if (levelData.ALL.TOTAL.level <= 89) {
LevelImagePath = 'badgeVip8';
} else if (levelData.TEXT.TOTAL.level < 100) {
} else if (levelData.ALL.TOTAL.level <= 99) {
LevelImagePath = 'badgeVip9';
} else if (levelData.TEXT.TOTAL.level >= 100) {
} else if (levelData.ALL.TOTAL.level >= 100) {
LevelImagePath = 'badgeVip10';
}
const LevelImage = await Canvas.loadImage(await imageGet(LevelImagePath));
Expand Down
22 changes: 11 additions & 11 deletions src/discord/commands/guild/d.profile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -514,25 +514,25 @@ export const dProfile: SlashCommand = {

// Choose and Draw the Level Image
let LevelImagePath = '' as string;
if (totalTextData.level < 10) {
if (totalTextData.level <= 9) {
LevelImagePath = 'badgeVip0';
} else if (totalTextData.level < 20) {
} else if (totalTextData.level <= 19) {
LevelImagePath = 'badgeVip1';
} else if (totalTextData.level < 30) {
} else if (totalTextData.level <= 29) {
LevelImagePath = 'badgeVip2';
} else if (totalTextData.level < 40) {
} else if (totalTextData.level <= 39) {
LevelImagePath = 'badgeVip3';
} else if (totalTextData.level < 50) {
} else if (totalTextData.level <= 49) {
LevelImagePath = 'badgeVip4';
} else if (totalTextData.level < 60) {
} else if (totalTextData.level <= 59) {
LevelImagePath = 'badgeVip5';
} else if (totalTextData.level < 70) {
} else if (totalTextData.level <= 69) {
LevelImagePath = 'badgeVip6';
} else if (totalTextData.level < 80) {
} else if (totalTextData.level <= 79) {
LevelImagePath = 'badgeVip7';
} else if (totalTextData.level < 90) {
} else if (totalTextData.level <= 89) {
LevelImagePath = 'badgeVip8';
} else if (totalTextData.level < 100) {
} else if (totalTextData.level <= 99) {
LevelImagePath = 'badgeVip9';
} else if (totalTextData.level >= 100) {
LevelImagePath = 'badgeVip10';
Expand Down Expand Up @@ -681,7 +681,7 @@ export async function getProfilePreview(target: GuildMember, imagePath: string,
context.restore();
}

context.drawImage(Icons, 5, -2, 913, 292);
context.drawImage(Icons, 0, 0);

// Overly complicated avatar clip (STATUS CLIP COMMENTED OUT)
context.save();
Expand Down
Loading

0 comments on commit e8e6380

Please sign in to comment.