Skip to content

Commit 7bb152f

Browse files
committed
Paths and cool stuff
1 parent b84bed6 commit 7bb152f

14 files changed

Lines changed: 106 additions & 34 deletions

File tree

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "boostify",
3-
"version": "1.0.0beta1",
3+
"version": "1.0.1",
44
"description": "",
55
"main": "dist/index.js",
66
"type": "module",
@@ -31,5 +31,9 @@
3131
"pg": "^8.20.0",
3232
"tsx": "^4.21.0",
3333
"zod": "^4.4.3"
34+
},
35+
"imports": {
36+
"#/*": ["./dist/*"],
37+
"#database": ["./dist/libs/database.js"]
3438
}
3539
}

src/base/classes/command.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import {
88
SlashCommandOptionsOnlyBuilder,
99
SlashCommandSubcommandsOnlyBuilder,
1010
} from 'discord.js';
11-
import { logger } from '../../libs/logger.js';
11+
import { logger } from '#/libs/logger.js';
1212

1313
type DiscordSlashCommandBuilder =
1414
| SlashCommandBuilder

src/commands/booster.ts

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ import {
1414
getActiveBoosters,
1515
getTotalBoosts,
1616
registerBoost,
17-
} from "../services/boosterService.js";
18-
import { Command } from "../base/classes/command.js";
17+
} from "#/services/boosterService.js";
18+
import { Command } from "#/base/classes/command.js";
1919

2020
export default new Command({
2121
info: new SlashCommandBuilder()
@@ -164,7 +164,6 @@ export default new Command({
164164
}
165165

166166
const boostWord = amount === 1 ? "boost" : "boosts";
167-
const countWord = updated.boostCounts === 1 ? "boost" : "boosts";
168167
const container = new ContainerBuilder()
169168
.setAccentColor(0xe642a4)
170169
.addTextDisplayComponents(

src/commands/info.ts

Lines changed: 68 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ import {
66
ActionRowBuilder,
77
} from "discord.js";
88
import axios from "axios";
9-
import { Command } from "../base/classes/command.js";
9+
import { Command } from "#/base/classes/command.js";
10+
import packageInfo from "../../package.json" with { type: "json" };
1011

1112
interface GithubRes {
1213
login: string,
@@ -24,6 +25,14 @@ export default new Command({
2425
"https://api.github.com/repos/teamboostify/boostify/contributors"
2526
);
2627

28+
const uptime = interaction.client.uptime;
29+
const days = Math.floor(uptime / 86400000);
30+
const hours = Math.floor(uptime / 3600000) % 24;
31+
const minutes = Math.floor(uptime / 60000) % 60;
32+
const seconds = Math.floor(uptime / 1000) % 60;
33+
34+
const uptimeString = `${days}d ${hours}h ${minutes}m ${seconds}s`;
35+
2736
const embed = new EmbedBuilder()
2837
.setColor(16712630)
2938
.setThumbnail(interaction.client.user.displayAvatarURL({ size: 2048 }))
@@ -35,43 +44,94 @@ export default new Command({
3544
{
3645
name: "Developers",
3746
value: info.data
38-
.map((user) => `[${user.login}](${user.html_url})`)
47+
.map((user) => `[@${user.login}](${user.html_url})`)
3948
.join("\n"),
4049
inline: true,
4150
},
51+
{
52+
name: "Version",
53+
value: `\`v${packageInfo.version}\``,
54+
inline: true,
55+
},
56+
{
57+
name: "Uptime",
58+
value: uptimeString,
59+
inline: true,
60+
},
4261
{
4362
name: "How was I made?",
4463
value: "I was built using TypeScript and discord.js.",
4564
inline: false,
65+
},
66+
{
67+
name: "Statistics",
68+
value: `**Servers:** ${interaction.client.guilds.cache.size}\n` +
69+
`**Users:** ${interaction.client.users.cache.size}\n`,
70+
inline: true,
71+
},
72+
{
73+
name: "Ping",
74+
value: `${Math.round(interaction.client.ws.ping)}ms`,
75+
inline: true,
76+
},
77+
{
78+
name: "Created On",
79+
value: `<t:${Math.floor(interaction.client.user.createdTimestamp / 1000)}:D>`,
80+
inline: true,
81+
},
82+
{
83+
name: "Node.js Version",
84+
value: process.version,
85+
inline: true,
86+
},
87+
{
88+
name: "discord.js Version",
89+
value: packageInfo.dependencies["discord.js"] || "Unknown",
90+
inline: true,
4691
}
4792
)
93+
.setFooter({
94+
text: `Requested by ${interaction.user.tag}`,
95+
iconURL: interaction.user.displayAvatarURL()
96+
})
4897
.setTimestamp();
4998

5099
const website = new ButtonBuilder()
51100
.setStyle(ButtonStyle.Link)
52-
.setLabel("Our Website")
101+
.setLabel("Website")
53102
.setURL("https://boostify.breaddevv.cc/");
54103

55104
const terms = new ButtonBuilder()
56105
.setStyle(ButtonStyle.Link)
57-
.setLabel("Terms of Service")
106+
.setLabel("Terms")
58107
.setURL("https://boostify.breaddevv.cc/terms");
59108

60109
const privacy = new ButtonBuilder()
61110
.setStyle(ButtonStyle.Link)
62-
.setLabel("Privacy Policy")
111+
.setLabel("Privacy")
63112
.setURL("https://boostify.breaddevv.cc/privacy");
64113

114+
const support = new ButtonBuilder()
115+
.setStyle(ButtonStyle.Link)
116+
.setLabel("Support Server")
117+
.setURL("https://boostify.breaddevv.cc/discord");
118+
119+
const repo = new ButtonBuilder()
120+
.setStyle(ButtonStyle.Link)
121+
.setLabel("Our Repository")
122+
.setURL("https://boostify.breaddevv.cc/github");
123+
65124
const actionBar = new ActionRowBuilder<ButtonBuilder>().setComponents(
66125
website,
67126
terms,
68-
privacy
127+
privacy,
128+
support,
129+
repo
69130
);
70131

71132
await interaction.editReply({
72133
embeds: [embed],
73134
components: [actionBar],
74135
});
75136
},
76-
})
77-
137+
})

src/commands/reload.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import "../libs/loadVariables.js";
1+
import "#/libs/loadVariables.js";
22
import {
33
SlashCommandBuilder,
44
MessageFlags,
55
} from "discord.js";
6-
import { loadCommands } from "../libs/loadCommands.js";
7-
import { Command } from "../base/classes/command.js";
6+
import { loadCommands } from "#/libs/loadCommands.js";
7+
import { Command } from "#/base/classes/command.js";
88

99
export default new Command({
1010
info: new SlashCommandBuilder()

src/commands/role.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ import {
55
TextDisplayBuilder,
66
MessageFlags,
77
} from "discord.js";
8-
import { ensureBoosterWhileBoosting, getBooster } from "../services/boosterService.js";
8+
import { ensureBoosterWhileBoosting, getBooster } from "#/services/boosterService.js";
99
import {
1010
createCustomRole,
1111
updateCustomRole,
1212
deleteCustomRole,
13-
} from "../services/roleService.js";
14-
import { Command } from "../base/classes/command.js";
13+
} from "#/services/roleService.js";
14+
import { Command } from "#/base/classes/command.js";
1515

1616
const ACCENT = 0xe642a4;
1717

src/commands/settings.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import {
44
ChannelType,
55
LabelBuilder,
66
} from "discord.js";
7-
import { Command } from "../base/classes/command.js";
7+
import { Command } from "#/base/classes/command.js";
88

99
export default new Command({
1010
info: new SlashCommandBuilder()

src/commands/setup.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,10 @@ import {
55
LabelBuilder,
66
MessageFlags,
77
ContainerBuilder,
8-
Colors,
98
} from "discord.js";
10-
import { Command } from "../base/classes/command.js";
11-
import { prisma } from "../libs/database.js";
12-
import { SystemColors } from "../libs/colors.js";
9+
import { Command } from "#/base/classes/command.js";
10+
import { prisma } from "#/libs/database.js";
11+
import { SystemColors } from "#/libs/colors.js";
1312

1413
export default new Command({
1514
info: new SlashCommandBuilder()

src/events/clientReady.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { Client, Events } from "discord.js";
2-
import { logger } from "../libs/logger.js";
2+
import { logger } from "#/libs/logger.js";
33

44
export default {
55
name: Events.ClientReady,

src/events/guildMemberUpdate.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import "../libs/loadVariables.js";
1+
import "#/libs/loadVariables.js";
22
import {
33
Client,
44
EmbedBuilder,
@@ -11,13 +11,13 @@ import {
1111
removeBoost,
1212
scheduleCustomRoleDeletionAfterGrace,
1313
clearPendingCustomRoleDeletion,
14-
} from "../services/boosterService.js";
14+
} from "#/services/boosterService.js";
1515
import {
1616
assignLevelRoles,
1717
removeAllLevelRoles,
18-
} from "../services/roleService.js";
19-
import { logger } from "../libs/logger.js";
20-
import { prisma } from "../libs/database.js";
18+
} from "#/services/roleService.js";
19+
import { logger } from "#/libs/logger.js";
20+
import { prisma } from "#database";
2121

2222
export default {
2323
name: Events.GuildMemberUpdate,

0 commit comments

Comments
 (0)