Skip to content

Commit 9a26921

Browse files
committed
hotfix: admin command exploit
1 parent 8ee8332 commit 9a26921

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

src/events/guild/interactionCreate.ts

+8-2
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,8 @@ export default class {
185185
command.accessableby == Accessableby.Voter &&
186186
isHavePremium &&
187187
client.topgg &&
188-
interaction.user.id != client.owner
188+
interaction.user.id != client.owner &&
189+
!client.config.bot.ADMIN.includes(interaction.user.id)
189190
) {
190191
const voteChecker = await client.topgg.checkVote(interaction.user.id);
191192
if (voteChecker == TopggServiceEnum.ERROR) {
@@ -217,7 +218,12 @@ export default class {
217218
}
218219
}
219220

220-
if (command.accessableby == Accessableby.Premium && isHavePremium && interaction.user.id != client.owner) {
221+
if (
222+
command.accessableby == Accessableby.Premium &&
223+
isHavePremium &&
224+
interaction.user.id != client.owner &&
225+
!client.config.bot.ADMIN.includes(interaction.user.id)
226+
) {
221227
const embed = new EmbedBuilder()
222228
.setAuthor({
223229
name: `${client.getString(language, "error", "no_premium_author")}`,

src/events/guild/messageCreate.ts

+26-2
Original file line numberDiff line numberDiff line change
@@ -169,6 +169,19 @@ export default class {
169169
],
170170
});
171171

172+
if (
173+
command.accessableby == Accessableby.Admin &&
174+
message.author.id != client.owner &&
175+
!client.config.bot.ADMIN.includes(message.author.id)
176+
)
177+
return message.reply({
178+
embeds: [
179+
new EmbedBuilder()
180+
.setDescription(`${client.getString(language, "error", "no_perms", { perm: "dreamvast@admin" })}`)
181+
.setColor(client.color),
182+
],
183+
});
184+
172185
if (
173186
command.accessableby == Accessableby.Manager &&
174187
!message.member!.permissions.has(PermissionFlagsBits.ManageGuild)
@@ -181,7 +194,13 @@ export default class {
181194
],
182195
});
183196

184-
if (command.accessableby == Accessableby.Voter && isHavePremium && client.topgg) {
197+
if (
198+
command.accessableby == Accessableby.Voter &&
199+
isHavePremium &&
200+
client.topgg &&
201+
!client.config.bot.ADMIN.includes(message.author.id) &&
202+
message.author.id != client.owner
203+
) {
185204
const voteChecker = await client.topgg.checkVote(message.author.id);
186205
if (voteChecker == TopggServiceEnum.ERROR) {
187206
const embed = new EmbedBuilder()
@@ -212,7 +231,12 @@ export default class {
212231
}
213232
}
214233

215-
if (command.accessableby == Accessableby.Premium && isHavePremium) {
234+
if (
235+
command.accessableby == Accessableby.Premium &&
236+
isHavePremium &&
237+
!client.config.bot.ADMIN.includes(message.author.id) &&
238+
message.author.id != client.owner
239+
) {
216240
const embed = new EmbedBuilder()
217241
.setAuthor({
218242
name: `${client.getString(language, "error", "no_premium_author")}`,

src/rainlink/Drivers/Nodelink2.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ export enum Nodelink2loadType {
1616
SHOW = "show",
1717
EPISODE = "episode",
1818
STATION = "station",
19-
PODCAST = "podcast"
19+
PODCAST = "podcast",
2020
}
2121

2222
export interface NodelinkGetLyricsInterface {

0 commit comments

Comments
 (0)