fix owner checks
This commit is contained in:
parent
db9b70bf66
commit
c841b53bdd
18 changed files with 23 additions and 23 deletions
|
@ -4,7 +4,7 @@ const mentionRegex = /^<?[@#]?[&!]?(\d+)>?$/;
|
|||
class AvatarCommand extends Command {
|
||||
async run() {
|
||||
const member = this.options.member ?? this.args[0];
|
||||
const self = this.client.users.get(this.author.id) ?? await this.client.rest.users.get(this.author.id);
|
||||
const self = this.client.users.get(this.author) ?? await this.client.rest.users.get(this.author);
|
||||
if (this.type === "classic" && this.message.mentions.users[0]) {
|
||||
return this.message.mentions.users[0].avatarURL(null, 512);
|
||||
} else if (member && member > 21154535154122752n) {
|
||||
|
|
|
@ -6,7 +6,7 @@ class BannerCommand extends Command {
|
|||
// this command sucks
|
||||
async run() {
|
||||
const member = this.options.member ?? this.args[0];
|
||||
const self = await this.client.rest.users.get(this.author.id); // banners are only available over REST
|
||||
const self = await this.client.rest.users.get(this.author); // banners are only available over REST
|
||||
if (this.type === "classic" && this.message.mentions.users[0] && this.message.mentions.users[0].banner) {
|
||||
return this.client.util.formatImage(Routes.BANNER(this.message.mentions.users[0].id, this.message.mentions.users[0].banner), null, 512);
|
||||
} else if (member && member > 21154535154122752n) {
|
||||
|
|
|
@ -5,7 +5,7 @@ import { endBroadcast, startBroadcast } from "../../utils/misc.js";
|
|||
class BroadcastCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can broadcast messages!";
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import Command from "../../classes/command.js";
|
|||
class EvalCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can use eval!";
|
||||
}
|
||||
|
|
|
@ -7,7 +7,7 @@ import Command from "../../classes/command.js";
|
|||
class ExecCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can use exec!";
|
||||
}
|
||||
|
@ -15,7 +15,7 @@ class ExecCommand extends Command {
|
|||
const code = this.options.cmd ?? this.args.join(" ");
|
||||
try {
|
||||
const execed = await exec(code);
|
||||
if (execed.stderr) return `\`ERROR\` \`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``;
|
||||
if (execed.stderr) return `\`\`\`xl\n${await clean(execed.stderr)}\n\`\`\``;
|
||||
const cleaned = await clean(execed.stdout);
|
||||
const sendString = `\`\`\`bash\n${cleaned}\n\`\`\``;
|
||||
if (sendString.length >= 2000) {
|
||||
|
|
|
@ -4,7 +4,7 @@ import { reloadImageConnections } from "../../utils/image.js";
|
|||
class ImageReloadCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can reload the image servers!";
|
||||
}
|
||||
|
|
|
@ -3,12 +3,12 @@ import Command from "../../classes/command.js";
|
|||
class RestartCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can restart me!";
|
||||
}
|
||||
await this.channel.createMessage(Object.assign({
|
||||
content: "esmBot is restarting."
|
||||
content: "mrmBot is restarting."
|
||||
}, this.reference));
|
||||
process.exit(1);
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@ import { reload } from "../../utils/soundplayer.js";
|
|||
class SoundReloadCommand extends Command {
|
||||
async run() {
|
||||
const owners = process.env.OWNER.split(",");
|
||||
if (!owners.includes(this.author.id)) {
|
||||
if (!owners.includes(this.author)) {
|
||||
this.success = false;
|
||||
return "Only the bot owner can reload Lavalink!";
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue