mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
Minor Modifications
This commit is contained in:
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiaobot",
|
"name": "xiaobot",
|
||||||
"version": "31.1.1",
|
"version": "31.1.2",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Shard.js",
|
"main": "Shard.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
@@ -15,19 +15,21 @@ class XiaoCommand extends Command {
|
|||||||
}
|
}
|
||||||
|
|
||||||
hasPermission(msg) {
|
hasPermission(msg) {
|
||||||
if (this.ownerOnly && !this.client.isOwner(msg.author)) return 'This Command can only be used by the bot owner.';
|
if (this.ownerOnly && !this.client.isOwner(msg.author)) {
|
||||||
|
return `The \`${this.name}\` command can only be used by the bot owner.`;
|
||||||
|
}
|
||||||
if (msg.channel.type === 'text') {
|
if (msg.channel.type === 'text') {
|
||||||
if (this.clientPermissions) {
|
if (this.clientPermissions) {
|
||||||
for (const permission of this.clientPermissions) {
|
for (const permission of this.clientPermissions) {
|
||||||
if (!msg.channel.permissionsFor(this.client.user).has(permission)) {
|
if (!msg.channel.permissionsFor(this.client.user).has(permission)) {
|
||||||
return `This Command requires me to have the \`${perms[permission]}\` Permission.`;
|
return `The \`${this.name}\` command requires me to have the \`${perms[permission]}\` Permission.`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.userPermissions) {
|
if (this.userPermissions) {
|
||||||
for (const permission of this.userPermissions) {
|
for (const permission of this.userPermissions) {
|
||||||
if (!msg.channel.permissionsFor(msg.author).has(permission)) {
|
if (!msg.channel.permissionsFor(msg.author).has(permission)) {
|
||||||
return `This Command requires you to have the \`${perms[permission]}\` Permission.`;
|
return `The \`${this.name}\` command requires you to have the \`${perms[permission]}\` Permission.`;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -63,7 +63,7 @@ class Util {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static shuffle(arr) {
|
static shuffle(arr) {
|
||||||
for (let i = arr.length - 1; i > 0; i--) {
|
for (let i = arr.length - 1; i >= 0; i--) {
|
||||||
const j = Math.floor(Math.random() * (i + 1));
|
const j = Math.floor(Math.random() * (i + 1));
|
||||||
const temp = arr[i];
|
const temp = arr[i];
|
||||||
arr[i] = arr[j];
|
arr[i] = arr[j];
|
||||||
|
|||||||
Reference in New Issue
Block a user