izy521 / discord.io

A small, single-file library for creating DiscordApp clients from Node.js or the browser
https://discord.gg/0MvHMfHcTKVVmIGP
MIT License
535 stars 155 forks source link

I cant start my bot #318

Closed KAMILUKA closed 5 years ago

KAMILUKA commented 5 years ago

![image](https://user-images.githubusercontent.com/53615766/62375104-cf79a880-

b53d-11e9-86c8-8afaf2c314c3.png) const token = '' const Discord = require('discord.js') const client = new Discord.Client()

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// //kick komanda

let kick = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0])); if(!kick) return message.channel.send("can't find user!"); let razlog = args.join(" ").slice(22); if(!message.member.hasPermission(MANAGE_MESSAGES)) return message.channel.send("No can do pal!"); let kickembed = new Discord.RichEmbed() if(kick.hasPermission("MANAGE_MESSAGES")) return message.channel.send("That person can't be kicked!") .setDescription ("~Kick~") .setColor("#fc0303") .addField("Kicked User", ${kick} with ID ${kick.id}) .addField("Kicked By", <@${message.author.id}> with ID ${message.author.id}) .addField("Kicked In", message.channel) .addfield("Time", message.createdAt) .addfield("Reason", kickreason); let kickChannel = message.guild.channels.find(name, "hags") if(!kickChannel) return message.channel.send("can't find hag channel.")

message.guild.member(kick).kick(kickreason); kickChannel.send(kickembed);

return; //////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////////////// //ban komanda

if(cmd === ${prefix}ban){

let ban = message.guild.member(message.mentions.users.first() || message.guild.members.get(args[0]));
if(!ban) return message.channel.send("Can't find user!");
let banReason = args.join(" ").slice(22);
if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.channel.send("No can do pal!");
if(ban.hasPermission("MANAGE_MESSAGES")) return message.channel.send("That person can't be kicked!");

let banEmbed = new Discord.RichEmbed()
.setDescription("~Ban~")
.setColor("#bc0000")
.addField("Banned User", `${bUser} with ID ${bUser.id}`)
.addField("Banned By", `<@${message.author.id}> with ID ${message.author.id}`)
.addField("Banned In", message.channel)
.addField("Time", message.createdAt)
.addField("Reason", bReason);

let incidentchannel = message.guild.channels.find(`name`, "hag");
if(!incidentchannel) return message.channel.send("Can't find hag channel.");

message.guild.member(ban).ban(bReason);
incidentchannel.send(banEmbed);

return;

} //////////////////////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////////////////////// //add role/remove role

module.exports.run = async (bot, message, args) => { if(!message.member.hasPermission("MANAGE_MEMBERS")) return message.reply("Sorry pal, you can't do that."); let rMember = message.guild.member(message.mentions.users.first()) || message.guild.members.get(args[0]); if(!rrole) return message.reply("Couldn't find that user, yo."); let role = args.join(" ").slice(22); if(!role) return message.reply("Specify a role!"); let grole = message.guild.roles.find(name, role); if(!grole) return message.reply("Couldn't find that role.");

if(!rrole.roles.has(gRole.id)) return message.reply("They don't have that role."); await(rrole.removeRole(gRole.id));

try{ await rrole.send(RIP, you lost the ${grole.name} role.) }catch(e){ message.channel.send(RIP to <@${rrole.id}>, We removed ${grole.name} from them. We tried to DM them, but their DMs are locked.) } }

module.exports.help = { name: "removerole" }

client.on('ready', () => { console.log('Your bot is now connected'); });

client.login(token);

Hunman commented 5 years ago

Not sure if publicly posting your token is a good idea

cloudrac3r commented 5 years ago

I cant start my bot

const Discord = require('discord.js')

Sounds about right.

KAMILUKA commented 5 years ago

idk what is wrong in my code...

cloudrac3r commented 5 years ago

GitHub issues are not the place to report your own incompetence. Please close this issue, and then join the discord.js help server: https://discord.gg/bRCvFy9