Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

I have an issue (not a bug, just need some help) #1235

Closed
marisklava opened this issue Feb 27, 2017 · 1 comment
Closed

I have an issue (not a bug, just need some help) #1235

marisklava opened this issue Feb 27, 2017 · 1 comment

Comments

@marisklava
Copy link

marisklava commented Feb 27, 2017

I am still fairly new to javascript and it's basics, but i still wanted to try my hand at building a discord bot, when i tried to make a simple ban command i ran into an issue.
See, every time i try to run it i run into some errors like these:
(node:1104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: B ad Request (node:1104) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise r ejections that are not handled will terminate the Node.js process with a non-zero exit code. (node:1104) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 3): TypeErro r: Cannot read property 'username' of undefined

This is my code:

const discord = require('discord.js');
const commando = require('discord.js-commando');
class BanCommand extends commando.Command {

constructor(client) {
    super(client, {

name: 'ban',
group: 'random',
memberName: 'ban',
description: 'bans a user',

args: [
{
key: 'member',
label: 'member',
prompt: 'What user would you like to ban?',
type: 'member'
}
]
});
}
async run(message, args) {
msg.channel.permissionsFor(client.member).isOwner(user);
msg.channel.guild.banMember(member.id, deleteDays);
}
}
module.exports = BanCommand;

thx for helping, i know this is dumb, but please help anyways, since i am a noob.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants