fixes for command arguments
parent
60550ee5b8
commit
0f39b55669
|
@ -15,6 +15,7 @@ export default class Ban extends Command {
|
|||
|
||||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||
const member = this.client.util.resolveMember(args[0], this.client.guilds.get(this.client.config.guildID));
|
||||
let user: User;
|
||||
if (!member) {
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class NPM extends Command {
|
|||
|
||||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
if (!args[0]) return this.error(message.channel, 'You need to specify a module name.');
|
||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||
|
||||
const res = await axios.get(`https://registry.npmjs.com/${args[0]}`, { validateStatus: (_) => true });
|
||||
|
||||
|
|
|
@ -15,7 +15,7 @@ export default class Roleinfo extends Command {
|
|||
|
||||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
if (!args[0]) return this.error(message.channel, 'You need to specify a role ID or a role name.');
|
||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||
|
||||
let role: Role = this.client.guilds.get(this.client.config.guildID).roles.find((r: Role) => r.id === args[0]);
|
||||
if (!role) { // if it's a role name
|
||||
|
|
|
@ -14,6 +14,7 @@ export default class Unban extends Command {
|
|||
|
||||
public async run(message: Message, args: string[]) {
|
||||
try {
|
||||
if (!args[0]) return this.client.commands.get('help').run(message, [this.name]);
|
||||
let user: User;
|
||||
try {
|
||||
user = await this.client.getRESTUser(args[0]);
|
||||
|
|
Loading…
Reference in New Issue