#development
1 messages · Page 362 of 1
Maybe return it?
return;
message.channel.send
That doesn't help
What's the issue then?
Check if the message author is a bot if so return
o it's johnwiggins
Hey
i dont need to check it
🤔
Yes you do
it does that before
My guess is, multiple instances running
Yeah
Might be
What, no?
Yeah
Well thats the only thing i can think of
Change one of them saying hi
Close your console and then try it and see if it does it
What's the actual code?
Loris pls


This truly is a good time to be alive
try using some classical debug strategies
stick a console.log inside your message handler and see what's going on
Maybe try posting the code
is there some sort of industry-standard XSS filtering lib?
ds
‘’’client.on(‘message’, message => {
if(message.content === (“hello”)) {
message.channel.send(“Howdy.”)
}
});’’’
Try something like this.. coded on my phone so may be a bit dodgy but this should be correct. You didn’t tell us the error tho? Is the bot not sending a message?
client.on(‘message’, message => {
if(message.content === (“hello”)) {
message.channel.send(“Howdy.”)
}
});
formatted what @jagged birch said
ty
Can someone tell me how I would go about making a queue system for songs in Discord.NET?
There’s loads of YouTube tutorials out there, try having a look at some.
not in english with a proper queue system
you need a (suprise) queue implementation
Can I do changeable prefixes, custom prefixes, with sqlite? 🤔
Probably
Good enough for me
Depends how your bot Lang handles prefixes
But basically make your prefix a func that takes guild id
And then lookup the valid prefixes
👍
Remember to handle dms & new guilds
Yee
totally forgot that on my own bot
XD
Gg
Going to do testing on one of my side bots that has my music bot code on it 👍
any here has a good code for a uptime command for discord.js
hmm, the status was set to streaming, but in the client it has the correct name, but it says playing
bots response (it was eval): ```xl
Presence {
status: 'online',
activity:
Activity {
name: 'your death by nuke',
type: 'STREAMING',
url: null,
details: null,
state: null,
applicationID: null,
timestamps: null,
party: null,
assets: null } }
but
interestingly, when you click it, it says live on twitch
it is type one, see it said streaming
yeah, i'll try url
didnt work
oh I see, the url has to be twitch.tv/blah
thanks!
i need help
with?
Is it possible to make a variable for prefixes, and have prefixes pushed into an array or something then allow people to use that prefix even on a bot restart? Idk if that sounded like english XD
If I didn't want to use a db I mean
So what you are trying to achieve is having an array, and new strings pushed into it to be prefixes aswell?
Kind of, but I need it to work even after the bot shuts off 🤔
Like, turn it back on, then it's still there
I don't think that's possible, but just a thought I guess 🤷
You could have that array in a JSON and just use FileSystem to change it
Oh, Heroku
Well, use their built-in DB or have a way to save the array's indexes or live with it until you change hosts
Strong relatable
I'm now realizing the struggles of heroku and json
any reccomended free hosts that are json friendly?
tempted to host json somewhere else and use http requests to modify and pull from it but that is probably stupid as hell
....
You dont
Run it on a server if you must use a red bot clone
Oh right you want to invite it not make your own
Your own copy?
Or just use one that already exists?
We don’t accept red clones
So I wouldn’t bother
Yes a red bot clone
We don’t allow them
Make your own
code it
Like actually apply some effort, learn to code the write your own bot
@frail kestrel who?
So anyone have any json-friendly free heroku alternatives?
you can host json on heroku but you cannot see any edits to it
also a lot of free VPS's are pretty shit so idk many
one that comes to mind is glitch but not sure if you can use json on there
what
eh
yeah
i mean obviously its not ideal
i would recommend buying a VPS
or getting a raspberry pi
yes
oh shit I think I might have a raspberry pi
that might be good
I have a box o' technology that I bought in bulk hence the "think" btw
I also wanna minimize costs on a thing that I'm not profiting from so I don't wanna pay montly for a vps
11 rn
howdy how do i add a user to a role, I'm trying to make it so if you've upvoted you will receive an Upvoter role in the support server, the bot scans through the votes and if your id is in there, you will receive the role. I've got that the scanning vote part done, just dont know how I will add a role to a user using their id
hmm ok
@jagged birch d.js im assuming? use <Member>.addRole(<Role>)
<Role> is a role object so you can use message.guild.roles.find("name", "Upvoter") to get that
for simple bots shit laptops will work fine

alt acct #2?
@earnest phoenix okay can you move to general if you aren't talking about development
yes
void beat me lmao
@jagged birch, dbl has a /votes/ endpoint that returns a list of people that've upvoted ur bot
https://please.zbot.me/YZi2y47h.png
void pls
oh
oh also @jagged birch you can use message.guild.fetchMember(<User>) to resolve a member object to apply the role
use client.fetchUser(<id>) if you need to get a user object
If I use a host other than heroku, would those still restart the bot to update it? I've never used anything other than heroku, so I'm wondering
afaik heroku is the only host that will restart your app after seeing changes if that's what you are talking about
yeah indeed
no problem :) i've heard vultrs pretty good so thats good to hear
👍 5 dollar plan for 1 GB of memory and I believe 2000 GB Broadband I think? Don't remember
1000 GB
yeah something like that
i reckon its pretty affordable
im thinking of switching to them sometime soon
Yeah it is very affordable, I gtg now. See y'all later :)
alright cya
Yeah i used to have this plan its good
Hi! how can i run a bot without use my cmd?
What
I think he wants his bot to be hosted somewhere
exactly!
does your bot work when you run it from your computer?
If you want to host a bot 24/7 you need a server
I would suggest looking at vultr
Mmm how much it cost?
there are several options, I mentioned heroku in general, that's where I'm hosting mine right now
Heroku is pretty shit
If you install a web server on your vultr server yes
I would recommend heroku for web stuff lol
Or glitch
ewwwwwwwwwwwwwwww
no
dont ever recommend heroku or glitch
its like fine if you are poor af, but if you can afford it take always an VPS
I am poor af tho 😢
rip you
I dont know about servers i started to program 2 years ago and i like servers but i run things in my computer
I configure my own arch :B
But is nice to get help sometimes, thanks!
does glitch allow you to see updates to files? @earnest phoenix
(Now im using w10 but i miss my arch D=)
glitch has a read only filesystem 
fucc
anyways if you can afford it, always take an vps
even an small one for 2.5$ or 3$ is fine
Or just selfhost 
I don't have a computer 😦
Idk how to use PUTTy or whatever it is... So it'll be weird for me
got bot now hosted on my old laptop wew lad
putty is like a remote cmd
Hmmm. Alright
Show code
client.on('message', message => {
if(message.content.startsWith(prefix + "userinfo")) {
let User = message.guild.member(message.mentions.users.first() || message.guild.members.get(arguments[0]));
if(!User) return message.channel.send("Je ne trouve pas l'user");
let uinfoEmbed = new Discord.RichEmbed()
.setDescription("__UserInfo__")
.setColor('RANDOM')
.addField("Pseudonyme", `${User.username}`)
.addField("#", `${User.discriminator}`)
.addField("ID", `${User.id}`)
.addField("Créé le", `${User.createdAt}`);
message.channel.send(uinfoEmbed);
}
});
your variable User is actually a Member object and you can't do <Member>.username
you need to use User.user.username
User objects don't have a user property. 
Member.user.username
Hopefully you meant User#username.
commands dont work here
can't even read the fucking doc
Member#user => User
i'll mute you if i see anymore french 
@radiant basin were you talking to me because if so yes i was referring to his variable User not the user object
Oh ok.
o/
is it imposable use Pateron/gamewisp API to setup Commands for them users only. for example !stats Name = Public command PRO: !prostats = Payed/Subscription command but as discordbot in nodejs with djs. i want check of you lot if there way i can do that not, if not is there other way i can that methered
i need find way raise money get VPS for mah Other bot get music going because i was using my friends mine and his VPs got shutdown becoz doesnt want get other 1 anymore so thats why i need way get funded get my own VPS
so im making 2nd bot do this
you somewhat can using patreon's automatic roles assignment to members of your server
yeh
i need way set so thy get commands of bot
like i showed example
works all servers not just 1 server get i mean
also, don't use arguments, bad practice
what i hear of my friend is i need make oAuth with info put in as json format on my site and call json format thew bot so ik way now but gonna be hard do :/
to me i dont like oAuth so thats only option get do
@spare spruce another way you can do it is through premium codes/etc
like generate a code when someone on patreon pays for it
Does anyone know how to validate DKIM signitures from within Node.js
Interesting development conversation.
Um how can i add commends to my bot?
commends?
I think he means commands
That depends highly on the library and command handler.
By writing them..?
stop spamming development
pls
or mute
Ban hammer
well people dont help anyone if they spam aswell neko
chill whats the problem 👀
spamming ^ look up
Captain Obvious
lmao
K so who can help me?
as said above, "That depends highly on the library and command handler."
What is that?
I think you may want to reconsider what you're asking here 
Maybe learn a language first
Hello
i want to make
my bot say
are you want edit dis
then user type yes
it will edit
but if user
typed no
deletes the message
Use a messageCollector, I believe it's called
It's on the docs
So, for my bot, I want to make a seek command, and I did guilds[message.guild.id].dispatcher.streamOptions.seek = args and it works , except it doesn't seek to that point... Any help?
i tried this
bot.user.setActivity(`$help | ${bot.users.size}`, {url:"https://www.twitch.tv/pardeepsingh12365", type: "STREAMING"});
showing bot.user.setActivity is not a function
help plz
setPresence
its js
what lib
idk
bot (or client).user.setPresence({
status: "the status",
activity: {
//your options
}
})
Im on mobile but I think that's right <I haven't updated>
k thank you
So, I changed host, now it doesn't play music, yet I have ffmpeg-binaries and node-opus installed
Does it give error 
🤷 Changed host so idk lol, it's on pm2
Haven't used pm2 before
Oop
Got something
You can use
it can't find python

node-gyp relies on python to build stuff
🤔
so you need to set the python in npm's config

looks like it wants py2.7 in particular too
But I tried changing to that and I couldn't do it
you tried changing what to what?

that's a python module i would guess
yep
Hmmmmmmm
:/
Idk 🤔
open a terminal and check
@_@
it is installed
Would it not have gone through if I did ahve it
since it didn't throw a "executable not found" error
it threw a "module not found" error
it might be executing py3
2.7
try node-opus
apt install build-essential
unable to locate
there's no s on the end
o
ye
Woops
it just build-essential
:/
🤷
It's downloading 
Ok, so how would I also go about updating my bot with my host?
ITS DOWNLOADING
😭
great
In my files on winSCP would I just update the code in the remote transfer files?
are you just... stringing random words together
i legitimately have no idea what you're asking
well that's a question for you to answer
God damn, I cannot speak
since you wrote the bot
you should honestly use a version control system
But this is the first time using this software 😭
winscp every change is not a good way to dev
you have 2 options basically
Mhmm
github: you can have repos, public unless you pay for a plan or student pack
gitlab: free private repos, usually used by people
or yeah
the local vcs repo works as well ig
can someone using discord.js help me out, i'm trying to use the discordbots.org api
to post server count?
no, to see who has upvoted the bot and reward them
the upvotes is a GET on /api/bots/:id/votes with your bot's token as Authorization header
thank you!
or use the discord-bot-list node package
so um where do I find that section to vote on muting bots?
whatever I type ,help and this stuff appears:
,help
nope doesnt work here
?
go see testing 1 for details or here:
I'm pretty sure there is no voting place
¯_(ツ)_/¯
@shrewd orbit you're in a server with ~900 bots, there's bound to be some confliction
we won't do anything about it
also this is the wrong place to ask really
why derppppp ```js
function play(guild) {
const serverQueue = queue.get(guild.id)
// console.log(serverQueue.songs)
bot.player.join(guild.id, message.member.voiceChannel.id).then(player => {
player.play(serverQueue.songs.shift().track, { region: guild.region })
player.on("end", (data) => {
// if(data.reason && data.reason === 'REPLACED') return;
// serverQueue.songs.shift();
console.log(serverQueue.songs)
play(message.guild);
});
serverQueue.textChannel.send(`🎶 Now playing: **${serverQueue.songs[0].info.title}**`);
})
}
}
Because you have 0 queue system
are u high
This is for managing songs/queue https://weed.moe/bAHPho4s.png
Auto leave and queue
@cerulean zinc this is mine https://i.imgur.com/dUWrvoE.png
hmm
idk why
First off, just make video song https://weed.moe/2YFnB2xh.png
I'm trying to make an anti discord invite thing for my support server, which is working pretty good, the only thing is the bot doesn't just read from the support server, it reads from all servers. So posting an invite link will result in you getting banned, don't worry I disabled it quickly. If someone sends an invite link, I want the bot to ban the user, and then delete the invite link, but the deleting part isnt working also. lib=discord.js btw. This is my code:
let guild = client.guilds.get("399121674198581248"); // support server id
if(guild) {
if(message.content.includes("discord.gg")) {
if(message.author.id === "223919574536552449") { // my id
console.log('invitelink> Developer: ban blocked.')
} else {
console.log('invitelink> User: banned from server.')
var banuser = message.author.id
guild.ban(banuser);
message.delete(1);
}
}
} else {
return;
}
});```
change if (guild) to if (message.guild.id === guild.id)
this is because guild is a non falsey value, so doing if (guild) will always return true
works. ty.
everything works except deleting the message, this is my code so far now:
let guild = client.guilds.get("399121674198581248"); // support server id
if(message.guild.id === guild.id) {
if(message.content.includes("discord.gg")) {
if(message.author.id === "223919574536552449") { // my id
console.log('invitelink> Developer: ban blocked.')
} else {
console.log('invitelink> User: banned from server.')
var banuser = message.author.id
guild.ban(banuser);
message.delete();
const embed = new Discord.RichEmbed()
.setTitle("The Ban Hammer")
.setDescription(`**Member:** ${message.member.user.username} (${message.author.id})\n**Action:** Ban\n**Reason:** Ads [blocked by bot]`)
.setColor(0xff0000)
client.channels.get('399181719510450186').sendMessage({embed});
}
}
} else {
return;
}
});```
Any error?
nope
whats wrong with this? js if(!message.member.hasPermission('MANAGE_MESSAGES')&&!message.member.id=="190916650143318016") return <blah blah>
for some reason its working for everyone
ok so breaking this expression down it looks like
it works fine without the &&!message.member.id=="190916650143318016")
(!message.member.hasPermission('...') && ((!message.member.id) == '...'))
so this reads as
if the member does not have this permission
and not the member's id is this
but you have to recall that ! is a unary operator
so when you do !message.member.id, you'll always end up with the value false
and obviously false == '190916650143318016' is never true
well, yes that is one possible solution
but there's also the != operator
"is not equal to"
also for future reference, you should always use strict-equality variants of equality operators
=== instead of == and !== instead of !=
what's the downside of the loose versions?
well uh
0 == false is a true statement
but 0 === false is not
if that helps illustrate the difference
oh, I see
in my code I put this, just like you said @austere meadow
}```
But I got error in console `TypeError: Cannot read property 'id' of null`, it just happened randomly.. it was working before.
did you type a message to the bot in DM's
you'd have to put a check like if (message.guild == null) return;
I didn't, someone else probably did though.
yeah
Yea if message.guild is null it means its a dm message
ok cool
indeed
can anybody help me here because I wanted to do an emoji here as usually it lets you send it normally with a string but I'm slightly confused, as I think it won't display normally in a RichEmbed.
you cant do emotes in Author titles
Actually you can now
Oh
@trim plinth I think the : at the end is confusing it thats why
Oh nvm i think custom emotes dont work in the title
Not sure
Yeah thats what I thought
i think you can use emotes in the author title but it needs to be the unicode of the emoji
ie. :8ball: becomes \:8ball: \🎱
no problem
make sure you copy the unicode character not the \:8ball: part
that was just to show how to get it
mk
Is there any way to see if the first mentioned users role is higher than the author of the message?
Using discord.js
idk, I haven't gone that far into guildMember / User territory
I suggest checking the discord.js docs?
one sec
Checked the user type and found nothing. Can look around to see if I can find anything else
did you check guildMember as well?
Not there either
message.mentions.members.filter(c => c.highestRole.comparePositionTo(message.member.highestRole) >= 0)
im really shit with filter but its something like that
you need to filter the members from the mention and compare their role positions
k
@quiet bobcat yeah jonas just tested that code, it should work
I got to look into filters
if the role position is the same or higher than the message author, it will return the member that was the same or higher than the author

oK I got o.8ball working
Cool
mmm 8 ball 
Hey unb
8ball best command
me === "advaith" more like me === "nub"
how do i inform the moderators that i disabled the unknown command response of my bot? so that it can be unmuted
Ping or DM the mod that muted it
help, i dont know how do embed!
d.js?
yes
What version?

lemme check
@earnest phoenix use npm ls discord.js
oh yeah that's it
anyone here use discord.js commando?
nah i dont erick but whats the issue?
dont know the differance
i don't know how to make my bot have something like this
tried client.user.setGame() and client.user.setActivity() but nothing work
client.user.setPresence({})?
lemme try
Isn't setPresence deprecated?
not a function in commando afaik
._.
I don't know anything about commando
Same
A CommandoClient is just an extension of the base Client, so all options, properties, methods, and events on Client are also on CommandoClient.
hmm
in that case setActivity should work https://please.zbot.me/0sZcsOtS.png
Cannot read property 'setActivity' of null
hmm
im really not sure then, sorry about that
that is strange though
it says that it just extends the client
so user should be available in that
bot.on("message", function(message) {
if (message.channel.type == "dm" || message.channel.type == "group") {
return message.reply("this command is not for dms");
}
const serverQueue = songQueue.get(message.guild.id);
if (message.author.bot) return undefined;
if (!message.content.startsWith(prefix)) return undefined;
const args = message.content.substring(1).split(' ');
//Get command from message
let command = message.content.toLowerCase().split(" ")[0];
//Remove prefix from command string
command = command.slice(prefix.length);
if (command === "help") {
message.author.send(`helpmessage`)
}
when im using help command bot creshed
(when my bot try to send dm message)
const serverQueue = songQueue.get(message.guild.id);
TypeError: Cannot read property 'id' of null
help me please
i just typed e@eval client.user.setActivity('Playing', ['Playing']); and it work. wut
ok bro but i want to send some meesage in dm like help it ill work after do that?
just add that to your OR statement if you want
what?
where i should add it
if (message.channel.type == "dm" || message.channel.type == "group") {
just add it here
i tried but after that bot spaming return message in dm
you need to ignore your own bot in that case
if (message.author.id === client.user.id)
if (message.author.bot) return undefined; this is already in
you've got it below the code that does the DM's
no problem 
anyone know how i tag username
from this methered
} else if (subscribers.list.includes(newMember.id)) {
if (!subscribers.list.includes(newMember.username)) {
console.log( + " has lost thy ROLE!")
}
console.log("Subscriber been Removed!")
changeSubStatus(newMember.id, 'remove', subscribers);
}```
i made database pulling out User id so thy can access sub commands but problem is idk how tag user so i can print message on say Username is no longer a subscriber
problem is i have no path get tag at
How do I stop this from happening? js (node:8968) [DEP0013] DeprecationWarning: Calling an asynchronous function without callback is deprecated.
you can use client.users.get("id") @spare spruce
@quiet bobcat do you know where in the code that's happening?
yeh i need as tag so i can tag like @spare spruce
Yeah js if(!configs[message.guild.id]) configs[message.guild.id] = { guildid: message.guild.id, guild: message.guild.name, leveling: 'off' } fs.writeFile("Storage/configs.json", JSON.stringify(configs, null, 4)) })
client.users.get("id").toString() @spare spruce
even needs get ids
i give try
nvm fixed it
@quiet bobcat fs.writeFile must be an async function
what its saying is, you need to put a .then or await on the function
alright
how'd you fix it
Added so it catches errors
using .catch?
Id my Array for database
no, just made the writeFile like this js fs.writeFile("Storage/configs.json", JSON.stringify(configs, null, 4), (err) => { if (err) console.error(err); })
ok
there ago working thx https://i.imgur.com/XiXDQH0.png
@austere meadow i wish way i can REP ya
😛
lmao all good
i got 1 more thign i need do is how i get print chat out with it
even on as bot.on guildMembersUpdate
do you know how im going do this print as chat not console log @austere meadow
message.channel.send?
- no message fuction
bot.on("guildMemberUpdate", (oldMember, newMember) => { and thats 2 aswell
you could do oldMember.guild.channels.get("CHANNEL ID").send("message");
config.patron_guild
oops
TypeError: Cannot read property 'send' of undefined
this fuction
.send("message");
hold on sec
got working but says name not tag and when i did this wouldnt do it
.send("@"+bot.users.get(newMember.id).tag+ " has lost thy ROLE!"
thats all shows
doesnt @ people
I'm going to have to ask a question again. I keep getting this js (node:5524) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): ReferenceError: Invalid left-hand side in assignment
code please?
if(!args[1]) {
return message.channel.send(`Level up messages are currently **${configs[message.guild.id].leveling}**. You can toggle them with ??config levelup on/off`)
}
else if(args[1].toLowerCase() = "levelup") { code here}```
but I've used it before
nvm
you've just forgotten a =
Thanks
np 
@austere meadow this me done for today now gonna add commands but ty help
i show ya preview my code
TY for help doe
all good
@austere meadow plss help me ??
.
@austere meadow how i create a bot ??
ok thanks
yeh youtube videos lot there
soon DBL will have tutorials for you to look at on how to create bots
but you can look at things like anidiots.guide or youtube videos
about over 300 videos on youtube all depends what lib going use
If I add more commands github may stop taking all of my command files...
I have 30 so far...
noice
i dont look a true video...
well my 2nd bot gonna go on github but its my subscriber bot
with some sub commands people cant use general
...
On snekfetch, how do I set more than one thing? example .set('Authorization', key), but I want to be able to set more stuff.
@neat falcon just use more .set
You can chain them
i thought it would screw up snek
Like a slithery snek
const snekfetch = require("snekfetch")
exports.run = (client, msg, args, log) => {
snekfetch.get("https://api.weeb.sh/images/random")
.set("Authorization", "Wolke notoken4u")
.set("nsfw", "false")
.set("filetype", "gif")
.set("type", "owo")
.then(res => {
msg.channel.send("", { embed: new Discord.RichEmbed().setTitle("Random OwO").setColor("#DCFF00").setImage(res.body.url).setFooter("Image by weeb.sh") })
.catch((e) => {
log.error(e)
msg.channel.send(":x: Looks like there was an error: " + e);
});
});
}```
1 use promises pls
thats not how wolkes api works lol
then how to use it
you are setting the options as headers
a
how do i set that
The ?
ye
ohhhh
And
me am smart
i still suggest you to return a promise rather then making it raw
const snekfetch = require("snekfetch")
exports.run = async(client, msg, args, log) => {
const res = await snekfetch.get("https://api.weeb.sh/images/random?type=owo&nsfw=false&filetype=gif")
.set("Authorization", "Wolke notoken4u")
const embed = new Discord.RichEmbed()
.setTitle("Random OwO")
.setColor("#DCFF00")
.setImage(res.body.url)
.setFooter("Image by weeb.sh")
msg.channel.send({embed: embed})
}
Fixed...
that works too
Looks better
ye
changing it to .columns .bot-img should be sufficient given your styles come later
ye works tanks
read up on css specificity cause it could break again if they update the base css and win out against your style override 😃
Anyone know if you can change bitrate with Lavalink?
@earnest phoenix let out = ''; bot.users.forEach(function(user){if(user.bot){out+=user.username}}); out;
that should ge through all bot users
client.on('message', message => {
if (message.content.startsWith(prefix + 'poll')) {
let args = message.content.split(" ").slice(1).join(" ");
if(!args) return message.channel.send("** ❌ | Merci de donner la question");
message.delete()
var embed = new Discord.RichEmbed();
embed.setColor('RANDOM')
.setDescription(args)
message.channel.sendEmbed(
message.react('👍')
message.react('👎')
);
}
});
don't do that
k bro
not you
i meant the code above
this let out = ''; bot.users.forEach(function(user){if(user.bot){out+=user.username}}); out;
that's horrible performance and memory wise
ok
https://www.lua.org/pil/11.6.html a good explanation of what's going on in that code (code is lua but what happens in basically the same)
Anyone know if you can change bitrate with Lavalink?
Nice
can someone help me?
what is it
ok so i followed this guide "https://medium.com/@renesansz/tutorial-creating-a-simple-discord-bot-9465a2764dc0"
iv done everything he said
but when i try to run "node bot.js" my bot wont go online
what is the error you get?
module.js:540
throw err;
^
Error: Cannot find module 'C:\Users\sande\bot.js'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
i have it on my destop
in a folder called bot
start node in that folder then...
i did and then i got nothing
what do you mean nothing?
i tried to put it in the c:/users/sande and it didnt work just a emty line
how do i do that
C:\Users\sande>cd c:/users/sande/desktop/bot
c:\Users\sande\Desktop\bot>node mainbotfile.js
module.js:540
throw err;
^
Error: Cannot find module 'c:\Users\sande\Desktop\bot\mainbotfile.js'
at Function.Module._resolveFilename (module.js:538:15)
at Function.Module._load (module.js:468:25)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3
c:\Users\sande\Desktop\bot>
it didnt work and when i try to do "node bot.js" it wont work
c:\Users\sande\Desktop\bot>node bot.js
c:\Users\sande\Desktop\bot>
thats what i get
node bot.js is correct
but then my bot wont go online
What's actually in your bot.js file, cause it clearly thinks it has nothing to do and so exits
var Discord = require('discord.io');
var logger = require('winston');
var auth = require('./auth.json');
// Configure logger settings
logger.remove(logger.transports.Console);
logger.add(logger.transports.Console, {
colorize: true
});
logger.level = 'debug';
// Initialize Discord Bot
var bot = new Discord.Client({
token: auth.token,
autorun: true
});
bot.on('ready', function (evt) {
logger.info('Connected');
logger.info('Logged in as: ');
logger.info(bot.username + ' - (' + bot.id + ')');
});
bot.on('message', function (user, userID, channelID, message, evt) {
// Our bot needs to know if it will execute a command
// It will listen for messages that will start with !
if (message.substring(0, 1) == '!') {
var args = message.substring(1).split(' ');
var cmd = args[0];
args = args.splice(1);
switch(cmd) {
// !ping
case 'ping':
bot.sendMessage({
to: channelID,
message: 'Pong!'
});
break;
// Just add any case commands if you want to..
}
}
});
nupe
?
hes got autorun set to true
hmmm
He uses Discord.io, not Discord.js
so if i change it to discord.js it will work?
no
k
Nope
sadly idk why it isnt working
my advice is dont follow on online guide and expect it to just work
yea XD
write it yourself and understand what everything does
Go Discord API server and ask in the discord.io channel
How can I check if my bot can dm a user?
How do I catch an error from a message?
try except
an error from a message? which lang 
try except
js and lib is d.js Paradox
add .catch(console.error) after your send message
both d.js and eris literally returns promise for sending message
so yeah you can just channel.send('').catch(err => { //stuff});
o
or use a try catch but that's kinda longer here
ok
try catch
for promises
It doesn't

i have a question. How do i make my bot work on a server hosting like Heroku?
What language?
I forgot to say thanks, so I´m saying it a little late. But thanks for the help @heady zinc @earnest phoenix

@fleet mason add procfile and enable the worker dyno on heroku
ok
they usually say you need to ping to keep it alive, but that wasn't the case for me back when i used it
I dowload modüles but automatic delete
there is
Note:I am not speaking English
anyone know what could be the problem with nodejs
I'm currently coding a bot in js and I had to install discord.js using the npm install command but after I use it once its saying directorys are missing and the ones that it says are missing aren't in the folder where they used to be
I was trying to install discord.js-commando
not atm cuz I had to take a break from trying to fix this
it gave me a error saying that directory was not found
said node_module/npm/bin/"something else".js was missing
for the first npm install the directory is there then they disappear leaving a few random files and the discord. js files
try installing whatever it says was missing
or try installing with
npm install <module> --save
idk what other reason there'd be
someone help me with js idk js plz
Ask your question.
k
so using jquery ajax im trying to get server count from DBL and put it on my website
I don't use jQuery, sorry.
RIP
ugh
i just gotta learn how to do a web dashboard with python and get over this
only thing im stuck on is how to make the person sign in so it knows who its talking to
oauth2 with discord api?
you could probably google oauth2 with python and follow docs/examples and replace urls/tokens/keys with discord ones
ik @abstract mango did it before ill check his out i guess
oh
this seems to be promising https://developers.google.com/api-client-library/python/guide/aaa_oauth
I need help i have an image with a transparent background i change it in the discordapp bot dev page but its always showing a white background on it and the dbl website and its really annoying me >_<
Is it png8 encoded?
let luki = require('luki.js')
luki.newRichEmbed = serverinfo
serverinfo.title("Information about " + serverName );
serverinfo.addfield("ID:" | serverId | inline );
serverinfo.addfield("Region:" | serverRegion | inline );
serverinfo.addfield("Members:" | serverMembers | inline );
serverinfo.addfield("Online Members" | serverOnMembers | inline );
serverinfo.addfield("Owner:" | serverOwner | inline );
serverinfo.addfield("Roles:" | serverRolesCount | inline );
serverinfo.addfield("Channels:" | serverChannelsCount | inline );
serverinfo.addfield("Creation Data:" | serverCreationData | inline );
serverinfo.send
how's it?
Its showing transparent on imgur and pc but when i upload it to Discord its just adding a white background
this is example of serverinfo, using the lib I am coding for my bot
Not sure
Try to put background in alpha and convert to png
what language is that supposed to be
js
no
@prime cliff have you got photoshop?
before you say this isn't working, it is
Yea i used photoshop to remove the background
And its PNG ?
is this going to be just like the case where that guy said he didn't need parentheses around the if statements
Yea
@prime cliff open your png in photoshop, ensure the background is transparent, then save for web as a png
Ctrl alt shift w on latest
@upper ember what are you expecting that to do
easier discord.js
lol
let luki = require('luki.js')
luki.newRichEmbed = serverinfo
serverinfo.title("Information about " + serverName );
serverinfo.addfield("ID:" | serverId | inline );
serverinfo.addfield("Region:" | serverRegion | inline );
serverinfo.addfield("Members:" | serverMembers | inline );
serverinfo.addfield("Online Members" | serverOnMembers | inline );
serverinfo.addfield("Owner:" | serverOwner | inline );
serverinfo.addfield("Roles:" | serverRolesCount | inline );
serverinfo.addfield("Channels:" | serverChannelsCount | inline );
serverinfo.addfield("Creation Data:" | serverCreationData | inline );
serverinfo.send
every noob can do it
do you know what | does
yes I do, I changed a lot fo things, this isn't really js it's kind of js... this was really weird process to make this lib
and there's not a lot of options :/
| should act as strong concat
still working on it
Anyone knows a bot that searches for code blocks and then react with a wrong or good, depending on errors in the code block?
*strin
but it's working :/
https://i.imgur.com/SFgul0P.png Definitly transparent in Photoshop but Discord/DBL shows https://i.imgur.com/g9eaq72.png
@slow elk that sounds deadly af for a bot
_>
@upper ember there is literally no way that function can accept more than 1 value
@prime cliff did you do save for web?
Where is the save for web option 
File
@earnest phoenix Nvm. Just remembered something
Get your bot to upload it via the api
Nope still coming up as a white background when i upload it with the API 
Literally not white background yet Discord adds a white background
AHHHHHH
Now Discord is not updating the bot image >_>
Discord pls >_>
How can I keep my bot online? I'm new to bot developing.
Please ping or DM me if you have an answer
Put it on a server and leave it running
@grave mirage host with VPS or something like that
Ik this is a dumb question, but how to put pm2 on your path?
oof
ok
I tried it, tried doing pm2 start [file name], still not executing the code 
if pm2 returns anything at all, pm2 is installed to path correctly





