Skip to content

Commit

Permalink
chore: update dependencies and improve error handling
Browse files Browse the repository at this point in the history
  • Loading branch information
EvarinDev committed Nov 18, 2024
1 parent 898508a commit 9d59378
Show file tree
Hide file tree
Showing 7 changed files with 23 additions and 46 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,23 +14,23 @@
"build": "bun x tsc"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@eslint/js": "^9.15.0",
"@types/bun": "latest",
"@types/common-tags": "^1.8.4",
"@types/ws": "^8.5.12",
"eslint": "^9.12.0",
"globals": "^15.11.0",
"typescript-eslint": "^8.8.1",
"@types/ws": "^8.5.13",
"eslint": "^9.15.0",
"globals": "^15.12.0",
"typescript-eslint": "^8.14.0",
"@dep-tree/cli": "^0.23.0"
},
"peerDependencies": {
"typescript": "^5.6.2"
},
"dependencies": {
"@prisma/client": "^5.20.0",
"@prisma/client": "^5.22.0",
"ansi-colors": "^4.1.3",
"common-tags": "^1.8.2",
"discord-api-types": "^0.37.101",
"discord-api-types": "^0.37.105",
"discord-hybrid-sharding": "^2.2.3",
"dotenv": "^16.4.5",
"ioredis": "^5.4.1",
Expand Down
1 change: 0 additions & 1 deletion seyfert.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ const c = require("./dist/config.js");

module.exports = config.bot({
token: c.default.TOKEN ?? "",
debug: true,
intents: ["Guilds", "GuildVoiceStates"],
locations: {
base: "src/client",
Expand Down
4 changes: 2 additions & 2 deletions src/client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ Logger.customize(customLogger);
client.start().then(() => {
client.uploadCommands().then(() => {
client.logger.info("Commands uploaded");
}).catch((err) => {
client.logger.error(err);
}).catch((err: Error) => {
client.logger.error(err.message);
});
//client.redis.connect();
}).catch((err) => {
Expand Down
2 changes: 1 addition & 1 deletion src/client/service/commands/BotinfoCommand.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const Botinfo: ServiceExecute = {
const clusterData = await client.cluster.broadcastEval((c) => {
const users = () => {
let totalMembers = 0;
for (const guild of c.cache.guilds.values()) {
for (const guild of c.cache.guilds.values().filter((g) => g.memberCount)) {
totalMembers += guild.memberCount;
}
return totalMembers;
Expand Down
6 changes: 3 additions & 3 deletions src/client/service/commands/MusicPlay.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ const MusicPlay: ServiceExecute = {
{
const playlist = res.playlist;
await interaction.editOrReply({
components: [config.config.ads_component],
components: [config.config.ads_component || undefined],
embeds: [
{
author: {
Expand Down Expand Up @@ -141,7 +141,7 @@ const MusicPlay: ServiceExecute = {
{
const track = res.tracks[0];
await interaction.editOrReply({
components: [config.config.ads_component],
components: [config.config.ads_component || undefined],
embeds: [
{
author: {
Expand Down Expand Up @@ -202,7 +202,7 @@ const MusicPlay: ServiceExecute = {
player.queue.add(track);

await interaction.editOrReply({
components: [config.config.ads_component],
components: [config.config.ads_component || undefined],
embeds: [
{
author: {
Expand Down
22 changes: 0 additions & 22 deletions src/client/structures/utils/Client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,28 +18,6 @@ export function UpdateStatus(client: UsingClient) {
uptime: data.stats.uptime,
};
}),
cluster: client.cluster.broadcastEval((c) => {
const guilds = c.cache.guilds.count();
const client_id = c.me.id;
const memory = process.memoryUsage().heapUsed;
const ping = c.gateway.latency;
const uptime = c.uptime;
return {
cluster_id: c.cluster.id,
memory,
guilds,
users: (() => {
let totalMembers = 0;
for (const guild of c.cache.guilds.values()) {
totalMembers += guild.memberCount;
}
return totalMembers;
})(),
client_id,
ping,
uptime,
};
}),
}),
).then((d) => {
return d
Expand Down
20 changes: 10 additions & 10 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const config: { [key: string]: IConfig } = {
},
Lavalink: [
{
identifier: "Jirayu.net[0] [recommend]",
host: "lavalink.jirayu.net",
password: "youshallnotpass",
port: 13592,
identifier: "Anantix [recommend]",
host: "lavalink.anantix.network",
password: "pg6|(}7fuD_:7d#QQq?9",
port: 2335,
playback: true,
search: true,
version: "v4",
Expand All @@ -33,12 +33,12 @@ const config: { [key: string]: IConfig } = {
},
Lavalink: [
{
identifier: "Jirayu.net[1]",
host: "lavalink.jirayu.net",
password: "youshallnotpass",
port: 13592,
playback: false,
search: false,
identifier: "Anantix [recommend]",
host: "lavalink.anantix.network",
password: "pg6|(}7fuD_:7d#QQq?9",
port: 2335,
playback: true,
search: true,
version: "v4",
},
],
Expand Down

0 comments on commit 9d59378

Please sign in to comment.