Skip to content

Commit 2ef5f49

Browse files
committed
update discordjs
don't try to get starts on bots
1 parent 7283dcf commit 2ef5f49

File tree

4 files changed

+55
-46
lines changed

4 files changed

+55
-46
lines changed

app/services/gamebridge/payloads/AdminNotifyPayload.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -112,25 +112,27 @@ export default class AdminNotifyPayload extends Payload {
112112
.setThumbnail(reportedAvatar)
113113
.setColor(0xc4af21);
114114

115-
const sql = await bridge.container.getService("SQL");
116-
if (!this.reportCache[reportedSteamId64]) {
117-
const res = await sql.queryPool(
118-
`SELECT report_amount FROM playerstats WHERE accountid = ${
119-
new SteamID(reported.steamId).accountid
120-
}`
121-
);
122-
if (res[0]) {
123-
this.reportCache[reportedSteamId64] = res[0].report_amount;
124-
} else {
125-
this.reportCache[reportedSteamId64] = 0;
115+
if (reportedSteamId64 !== "BOT") {
116+
const sql = await bridge.container.getService("SQL");
117+
if (!this.reportCache[reportedSteamId64]) {
118+
const res = await sql.queryPool(
119+
`SELECT report_amount FROM playerstats WHERE accountid = ${
120+
new SteamID(reported.steamId).accountid
121+
}`
122+
);
123+
if (res[0]) {
124+
this.reportCache[reportedSteamId64] = res[0].report_amount;
125+
} else {
126+
this.reportCache[reportedSteamId64] = 0;
127+
}
126128
}
127-
}
128-
this.reportCache[reportedSteamId64]++;
129+
this.reportCache[reportedSteamId64]++;
129130

130-
if (this.reportCache[reportedSteamId64] > 0) {
131-
embed.addFields(
132-
f("Total Report Amount", this.reportCache[reportedSteamId64].toString())
133-
);
131+
if (this.reportCache[reportedSteamId64] > 0) {
132+
embed.addFields(
133+
f("Total Report Amount", this.reportCache[reportedSteamId64].toString())
134+
);
135+
}
134136
}
135137

136138
const row = new Discord.ActionRowBuilder<Discord.ButtonBuilder>();

app/services/gamebridge/payloads/VoteKickPayload.ts

Lines changed: 19 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -108,24 +108,26 @@ export default class NotificationPayload extends Payload {
108108
.setThumbnail(offenderAvatar)
109109
.setColor(0xc4af21);
110110

111-
const sql = await bridge.container.getService("SQL");
112-
if (!this.votekickCache[offenderSteamId64]) {
113-
const res = await sql.queryPool(
114-
`SELECT votekick_amount FROM playerstats WHERE accountid = ${
115-
new SteamID(offender.steamID).accountid
116-
}`
117-
);
118-
if (res[0]) {
119-
this.votekickCache[offenderSteamId64] = res[0].votekick_amount;
120-
} else {
121-
this.votekickCache[offenderSteamId64] = 0;
111+
if (offenderSteamId64 !== "BOT") {
112+
const sql = await bridge.container.getService("SQL");
113+
if (!this.votekickCache[offenderSteamId64]) {
114+
const res = await sql.queryPool(
115+
`SELECT votekick_amount FROM playerstats WHERE accountid = ${
116+
new SteamID(offender.steamID).accountid
117+
}`
118+
);
119+
if (res[0]) {
120+
this.votekickCache[offenderSteamId64] = res[0].votekick_amount;
121+
} else {
122+
this.votekickCache[offenderSteamId64] = 0;
123+
}
124+
}
125+
this.votekickCache[offenderSteamId64]++;
126+
if (this.votekickCache[offenderSteamId64] > 0) {
127+
embed.addFields(
128+
f("Total Votekick Amount", this.votekickCache[offenderSteamId64].toString())
129+
);
122130
}
123-
}
124-
this.votekickCache[offenderSteamId64]++;
125-
if (this.votekickCache[offenderSteamId64] > 0) {
126-
embed.addFields(
127-
f("Total Votekick Amount", this.votekickCache[offenderSteamId64].toString())
128-
);
129131
}
130132

131133
await (notificationsChannel as Discord.TextChannel).send({

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"cookie-parser": "^1.4.7",
3232
"dayjs": "^1.10.6",
3333
"diff": "^8.0.0-beta",
34-
"discord.js": "^14.22.1",
34+
"discord.js": "^14.24.2",
3535
"dotenv": "^16.0.2",
3636
"express": "^5.1.0",
3737
"express-rate-limit": "^7.5.0",

yarn.lock

Lines changed: 16 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -43,15 +43,15 @@
4343
dependencies:
4444
"@jridgewell/trace-mapping" "0.3.9"
4545

46-
"@discordjs/builders@^1.11.2":
47-
version "1.11.2"
48-
resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.11.2.tgz#b96185d05d22f9d6bde89aada2decf45a5c982ce"
49-
integrity sha512-F1WTABdd8/R9D1icJzajC4IuLyyS8f3rTOz66JsSI3pKvpCAtsMBweu8cyNYsIyvcrKAVn9EPK+Psoymq+XC0A==
46+
"@discordjs/builders@^1.13.0":
47+
version "1.13.0"
48+
resolved "https://registry.yarnpkg.com/@discordjs/builders/-/builders-1.13.0.tgz#332963d88f7452fdbfbf156c6afd4ba7eac44e04"
49+
integrity sha512-COK0uU6ZaJI+LA67H/rp8IbEkYwlZf3mAoBI5wtPh5G5cbEQGNhVpzINg2f/6+q/YipnNIKy6fJDg6kMUKUw4Q==
5050
dependencies:
5151
"@discordjs/formatters" "^0.6.1"
5252
"@discordjs/util" "^1.1.1"
5353
"@sapphire/shapeshift" "^4.0.0"
54-
discord-api-types "^0.38.1"
54+
discord-api-types "^0.38.31"
5555
fast-deep-equal "^3.1.3"
5656
ts-mixer "^6.0.4"
5757
tslib "^2.6.3"
@@ -1896,19 +1896,24 @@ discord-api-types@^0.38.16:
18961896
resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.38.22.tgz#89c8e755d1be56dc8cccc2f8e9fc173d850dfe9d"
18971897
integrity sha512-2gnYrgXN3yTlv2cKBISI/A8btZwsSZLwKpIQXeI1cS8a7W7wP3sFVQOm3mPuuinTD8jJCKGPGNH399zE7Un1kA==
18981898

1899-
discord.js@^14.22.1:
1900-
version "14.22.1"
1901-
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.22.1.tgz#aa364cf0108b41bac3eaa9fa1aae836d0882a91c"
1902-
integrity sha512-3k+Kisd/v570Jr68A1kNs7qVhNehDwDJAPe4DZ2Syt+/zobf9zEcuYFvsfIaAOgCa0BiHMfOOKQY4eYINl0z7w==
1899+
discord-api-types@^0.38.31:
1900+
version "0.38.33"
1901+
resolved "https://registry.yarnpkg.com/discord-api-types/-/discord-api-types-0.38.33.tgz#6755dae0fa305c549a7fd6d1ce5125187612138d"
1902+
integrity sha512-oau1V7OzrNX8yNi+DfQpoLZCNCv7cTFmvPKwHfMrA/tewsO6iQKrMTzA7pa3iBSj0fED6NlklJ/1B/cC1kI08Q==
1903+
1904+
discord.js@^14.24.2:
1905+
version "14.24.2"
1906+
resolved "https://registry.yarnpkg.com/discord.js/-/discord.js-14.24.2.tgz#070519dd401cd2cf1f30f86a20d227999b13f610"
1907+
integrity sha512-VMEDbmguRdX/EeMaTsf9Mb0IQA90WdYF2cn4QDfslQFXgQ6LFtmlPn0FSotnS0kcFbFp+JBSIxtnF+bnAHG/hQ==
19031908
dependencies:
1904-
"@discordjs/builders" "^1.11.2"
1909+
"@discordjs/builders" "^1.13.0"
19051910
"@discordjs/collection" "1.5.3"
19061911
"@discordjs/formatters" "^0.6.1"
19071912
"@discordjs/rest" "^2.6.0"
19081913
"@discordjs/util" "^1.1.1"
19091914
"@discordjs/ws" "^1.2.3"
19101915
"@sapphire/snowflake" "3.5.3"
1911-
discord-api-types "^0.38.16"
1916+
discord-api-types "^0.38.31"
19121917
fast-deep-equal "3.1.3"
19131918
lodash.snakecase "4.1.1"
19141919
magic-bytes.js "^1.10.0"

0 commit comments

Comments
 (0)