gha, Array.prototype.random broke node-rest-client

TypeError: props[propIndex].split is not a function
https://github.com/aacerox/node-rest-client/issues/154
This commit is contained in:
Lamp 2019-10-08 16:35:47 -07:00
parent 9587037109
commit 3de31864c3
3 changed files with 8 additions and 8 deletions

View File

@ -139,10 +139,10 @@ commands.color = {
var role = colorRoles.findColorRole(message.member);
if (!role) {
if (message.member.presence.status == "offline")
return message.reply([
return message.reply(random([
"You are offline.",
"I can't change your color when you're invisible."
].random());
]));
else {
await colorRoles.update(message.member);
role = colorRoles.findColorRole(message.member);
@ -169,10 +169,10 @@ commands.title = {
var role = colorRoles.findColorRole(message.member);
if (!role) {
if (message.member.presence.status == "offline")
return message.reply([
return message.reply(random([
"You are offline.",
"I can't change your color when you're invisible."
].random());
]));
else {
await colorRoles.update(message.member);
role = colorRoles.findColorRole(message.member);

View File

@ -141,10 +141,10 @@ dClient.on('local_message', async message => {
(res) => {
switch (res) {
case "ENOTBRIDGE":
message.channel.send([
message.channel.send(random([
`This is not a bridged channel.`,
`You can only use this command in a bridged channel.`
].random());
]));
break;
case "EBADUSG":
message.channel.send(`**Usage:** \`!${commandName} ${command.usage}\``);

View File

@ -1,6 +1,6 @@
Array.prototype.random = function () {
return this[Math.floor(Math.random() * this.length)]
global.random = function (array) {
return array[Math.floor(Math.random() * array.length)]
}
global.sanitizeName = function sanitizeName(str){ // for showing names in discord