mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-18 05:49:49 +02:00
Code Improvements
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const stringToBinary = (str) => {
|
||||
const pad = "00000000";
|
||||
const pad = '00000000';
|
||||
return unescape(encodeURIComponent(str))
|
||||
.split('').map(str => {
|
||||
const binary = str.charCodeAt(0).toString(2);
|
||||
return pad.slice(binary.length) + binary;
|
||||
return `${pad.slice(binary.length)}${binary}`;
|
||||
}).join('');
|
||||
};
|
||||
|
||||
|
||||
@@ -21,6 +21,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
}]
|
||||
});
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return this.client.isOwner(msg.author);
|
||||
}
|
||||
@@ -39,8 +40,7 @@ module.exports = class WebhookCommand extends Command {
|
||||
content: text
|
||||
});
|
||||
return null;
|
||||
}
|
||||
catch (err) {
|
||||
} catch (err) {
|
||||
return message.say(':x: Error! Message failed to send!');
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user