#development
1 messages ยท Page 576 of 1
do i send them that link
yep
client id is that in the redbox
so it's just like https://discordapp.com/oauth2/authorize?client_id=351611743018942464&scope=bot&permissions=-1

@steel heath ads 
ikr
I thought I would use a wrong ID but I didn't give it cuz he'd say "oh why no work this"
Alright so, I am using eris and I am trying to figure out how I could do
gm!settins welcome_message Hello {user} please read {#rules}
and then it would put that in my Member add event
store it in your db, on join get it from the db
Hm
Is that really necessary?
I will do it if that is the only way
But if there are other options
thats the only way
use caching for the member add event
save the message, guild id, channel, etc... in the db, and add the guild id to an array in memory, so you can quickly look up if the guild has welcome messages enabled or not without hitting your db
I have this in an external command and I thought that by putting a "this." there that it would refer to the original client object in the main file, but it doesn't seem to be the case. How would I do this properly?
ok this error is driving me nuts and i need help on as to why this happens whenever i try and install things though npm
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\PATH\node_modules\ref\build\binding.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.```
idk why it keeps saying it cannot find E:\Microsoft.Cpp.Default.props
@high lava Most people just pass the client as a parameter
I have an error with rethinkdb
@amber fractal When I require discord.js in an external command it doesn't add it for some reason
Just to be clear, I tend to mix stuff up, you mean a module.exports right?
I dont want to be on a seperate page

Oof. So you want me to use module exports to define Client
Yes module.exports
And just like that it works. Thank you
steven the savior

u sure bout that s t e v e n
tldr; should I enqueue to worker to run task and update db, or run task, then enqueue worker to do background runner only
fishy are you the only one here who knows go
turtle knows some
is he online? prob not
idk what that means
lol
You're adding false letters to my name

See, Tarpergon, there is no Steven4547466
i think I'll just send the worker
and do another timer to pull background runners
i'll spawn 20 workers
should be good enough 
What about the unemployed?
what unemployed
oh
lmao
they just keep waiting for a job
unironically
I'll have one job channel
All 20 workers will be listening on that channel for new jobs
does anyone know a lyrics api? a song only no artist
anyone help me?
with
@earnest phoenix ksoft.si has lyrics api
@earnest phoenix what do you need
@earnest phoenix does it only use song name or does it need artist?
song name
@earnest phoenix if (msg.guild.id === '264445053596991498') return;
TypeError: Cannot read property 'id' of null
what is msg
show me some more code
why
because i dont know what msg is lmao
it could be some random variable
:/
My guess would be a message obj
No, dm channels have a Iโd
ok?
they're not guilds
lmfao
@earnest phoenix what are u trying to do
i try sa as response this server return
ฤฐ try sa and bot as
:D
what
respons
Pfff nevermind.
you are making no sense
at all
How to give rol id?
@lime fiber posting to the api
Ok.
(node:1256) UnhandledPromiseRejectionWarning: TypeError: WebSocket is not a constructor
at WebSocketConnection.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:254:26)
at new WebSocketConnection (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:89:10)
at WebSocketManager.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketManager.js:75:25)
at client.rest.methods.getGateway.then.res (C:\Users\\node_modules\discord.js\src\client\ClientManager.js:45:22)
at process._tickCallback (internal/process/next_tick.js:68:7)```
which json keyword is equivalent to python's None?
oh yeah, thanks
so what caused js (node:1256) UnhandledPromiseRejectionWarning: TypeError: WebSocket is not a constructor at WebSocketConnection.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:254:26) at new WebSocketConnection (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:89:10) at WebSocketManager.connect (C:\Users\\node_modules\discord.js\src\client\websocket\WebSocketManager.js:75:25) at client.rest.methods.getGateway.then.res (C:\Users\\node_modules\discord.js\src\client\ClientManager.js:45:22) at process._tickCallback (internal/process/next_tick.js:68:7)?
ok this error is driving me nuts and i need help on as to why this happens whenever i try and install things though npm
Building the projects in this solution one at a time. To enable parallel build, please add the "/m" switch.
E:\PATH\node_modules\ref\build\binding.vcxproj(20,3): error MSB4019: The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.```
idk why it keeps saying it cannot find `The imported project "E:\Microsoft.Cpp.Default.props" was not found. Confirm that the path in the <Import> declaration is correct, and that the file exists on disk.`
@loud salmon might wanna delete that token leek
where
not anymore
kk
I wanted to try to make a bot on mobile for once I'm giving it a try but I have gone wrong somewhere what do I do
you made a typo on line 5, that you wouldve easily noticed if you werent coding on mobile
command_prefix='D'
also if you want to learn more about coding on mobile: https://cyber28.xyz/codeonmobile
nice site
thank you
if only i could do css
i worked very hard on it, collecting points from reputable sources and stuff
modestacss exists
LEAK
ljhskdvnbzflkdc
idfk
I've run into a bit of a problem I've gotten the code right but I cannot seem to get it to stay online
dude
just use more then 1 file
like a config file
well im gonna go back to trying to fix npm
its probaly your enviroment @outer niche
like it just runs it once
could someone show me what I am doing wrong here. It is telling me then is Unresolved function or method.
let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
translate(translation, {to: language}).then(res => {```
is that all of it?
well not the whole entire code.
Yes I know
just the section it's getting the error from
because translate() isnt async? iirc .then() works only for async
Does it?
I dont think so
huh okay
It might tho
this is the only other thing I have that uses translate javascript const translate = require('google-translate-api');
I am having trouble coming up with a way to toggle events on and off
I had the idea of just saving a toggle of false to my db for every event and allowing them to toggle it on and off that way with a cmd
but I was wondering if there was a cleaner way of doing this
im looking at the package/module/whatever you mentioned
this right?
@dusky steeple
yes
yeah its just a function, not a promise
which returns the result i think
wait hold the fuck up
NEVERMIND
so I have the code done on my bot on mobile just trying to see if mobile would work but I have run into a problem with the program to where the pot will not stay on
You need a host? @outer niche
Possibly
Glitch, heroku (not ads)
glitch is for js
@earnest phoenix neither of those support my program
you did it in python?
No
java?
No
idfk what you did it then
which language then 
it supports
You know I just scratch it I'll go try to learn another program
LOL XD
lol
I need help with "Vote"
I wanna create webhook, but how?
What should I put there?
you create a webserver that accepts POST requests
then you fill in the fields on discordbots.org
(not) simple
yes
global?
???
or guild
depends on how you write your code
a database can be used for a shit ton of purposes
ok
and cant seem to make it work
:/
wondering if you could help
const db = require('cookiesdb');
let money = db.fetchCookies(`globalCredits_${client.users.id}`, { sort: '.data'})
let content = "";
for (let i = 0; i < money.length; i++) {
let user = client.users.get(money[i].ID.split('_')[2]).username
content += `${i+1}. ${user} - ${money[i].data}$\n`
}
const embed = new Discord.RichEmbed()
.setAuthor(`Leaderboard!`, message.guild.iconURL)
.setDescription(content)
.setColor(0x51267)
message.channel.send(embed)```
ah
mongodb requires for it to be hosted on local webserver, no?
It can be hosted on your pc
Then try and make it work
Ok
hey, i want to create a command who get the numbers of players in a other server, but that not work for me ( discord.js )
wdym by players in other server?
yes
is infojeux an ID
so just get the total of all users serving
then sub the amount of the users in said guild
Does it give you any error..
but the bot must be in the opposite server i guess
??
that mean infojeux
He/she/it just wants to check how many users are in a certain server
yes
the bot must be in the server to know the total of players, no ?
ok
https://cdn.discordapp.com/attachments/402150235071184918/547150646617571329/unknown.png
https://cdn.discordapp.com/attachments/402150235071184918/547150541566902292/unknown.png
why doesnt the other one change color after i change in the file
because you didnt commit/push
the M indicates that its Modified (not the same as the file uploaded on your git repository)
i never linked to github yet i have that
link what to github
if you just do git clone blabla it will set up the folder you cloned it into as a git folder or whatever
so if you make changes, it will indicate it
i cannot figure out why node-gyp will not install
i have spent way to many hours look up error codes, installing "build packs" reinstalling node, npm etc
and i really need help on why its so broken/won't work
How do i get an ip of someone who visits my webpage?
Database @split hazel
Why you need ip?
I need it so i can make users submit a form only one time
What tech stack?
and compare it to the one in database
Since that's definitely something you have to do server-side.
Would that maybe be a get request when someone visits a site?
Since you need access to the HTTP request headers.
(And in any case, if you're trying to defend against multiple submissions, you need to put that code somewhere where an attacker can't just delete it the way they can with client-side JS.)
@split hazel In any case though the exact way to do it depends on what you're actually using server-side.
Since the way you do it in PHP is different from the way you do it in Node which is different from Python which is different from ...
I don't worry about that since i pass everything through my web server as soon as a request gets sent
oh wait nevermind
thats true
Getting a visitor's IP address is something that only the actual server answering the request can do.
Why would you need a users ip?
is there a way to connect discord bot to phpmyadmin database?
what lang
I'm guessing PHP since phpmyadmin...
im the big dumb
first thing from ddg https://www.hostmysite.com/support/mysql/phpmyadmin/
well the bot needs to connect to it 
phpmyadmin is a database dashboard, unless it has some kind of extra plugin API then basically you just have to put your data in the database.
And then you'll be able to view and edit the database with the database dashboard.
python
actually
cx
i have the database... i have the tables and everything.. im just struggling with connecting to it
i tried importing pymysql but it doesn't seem to connect to the database
Ok, so is the issue is you can't connect phpmyadmin to the db, or you can't connect python to the db?
Have you tried following along with one of the pymysql examples? (assuming it's the latter issue)
what
phpmyadmin is where the database is stored
ive been going at this for a few hours, so yes
it seems i need to use MySQLdb? idk!
I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )
Phpmyadmin is an interface, not the actual database
;o
ok well i used phpmyadmin to create the database
and i have it lol now im just trying to figure out the correct command for the bot to connect to the database.
Phpmyadmin supports mysql/mariadb
Cuz there's pymysql and MySQLdb
ok, now im just trying to connect to the database
but when i try to connect, it says "Access denied for user 'user@MYSERVERIP'
problem is, MYSERVERIP is the ip for my server, NOT the ip for the database.
(and yes................. i have the ip for my database in the settings file, so idk why it's trying to connect with my server's ip?)
Whats the ip you put there?
im pretty sure it's my database's ip
Is your database running on the same machine as your python bot?
You're using mysqldb now?
db = pymysql.connect("IP","USERNAME","PASSWORD","DATABASE_NAME")
I dont know python very well, but in their example they're using host=ip instead of just ip, same with other fields. Idk if that makes a difference though
yea, i'll have to try it.
my hosting provider just informed me they block connections on the server im using, so imma have to resolve this issue first lol
Yeah firewall rules was my next suggestion xd
Im using google vps, and it blocks everything by default
oh that suckss ^
na, i got a bud who owns a hosting company, so he just helps me out ๐คท c:
Well, firewalls exist for your protection, its good that it blocks everything by defauly
You just need to configure it
Hey I wanted to know how I could make a command that reads the args , and does something based on those specific words... so for example https://hastebin.com/jedupeyefa .. if the user puts in *rforum Announcements , i want section to equal "announcements.27"
What have you tried?
i dont know how to start it up
im pretty sure its something really simple that im missing
How to start what up? The bot?
no ROFL
its so hard to explain im sorry
so i want section to be a list of things basically
but like
fk its so hard to explain it
Ok, so which API are you using?
cheerio? but its not rlly an API problem
Ok, so you have an entry point somewhere that's in response to an event from the API right?
Somewhere on that entry point you're receiving the text of the user's message as an argument or such.
is if they say " Off topic" then i want section to be off-topic.26.. if its announcements then section will be announcements.27
So... Person types announcemets, first extract the word from the message using split and slice and join, or equivalent
Then have an object with keys and values containing the command words as keys
^^
is there an example anywhere that i can see how to use it
because ik what ur talking about but idk how to use it properly
First off, what are you doing to recognise commands right now? You do have a working command that doesn't do anything with arguments right?
Object = {
Announcements = "announcements.27"
}
Then do Object[args]
so like would i do Section = { yatayatayata }
Where args is the extracted word from the message
Im on the phone so i cant type a better example properly
I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )
i learn as i go
not suggestable but ok
i want to create a command that give the first role of a user ( for example : Luca (first role : special bot ))
yes
what lib?
discord js
stable i presume?
yes
https://discord.js.org/#/docs/main/stable/class/Role?scrollTo=calculatedPosition u look at the highest one
not sure if d.js sorts https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=roles by the position
bot.guilds.get(infojeux).roles.find(role => role.members.first).author)```
I've tried this but he give me 'undefined'
@opal copper are u getting a users or the guilds?
a user of a guild
ok
how
thats because u dont understand js
you never mentioned sections in your code
wow telk that was rude
ik i didnt
im not an idiot
as you can see sections isnt defined yet because im having trouble on how to define it
i presume u are taking it from input which means section[input] would give what u need
I want to create a command who give the first role of a user in an other server, how should i do it ( discord.js )
@opal copper Uhhh, not sure exactly what you're asking here...
You want a command that grants a particular role to the first person who uses it on a given server?
Aside from technical implementation, first off why do you want that?
that for the staff server of a community, when that command will drop the role of the user that he have in the community server and will give it in the staff server
the hoist key will help me, but idk where should i put in
Ok, so what you want is to synchronize roles between two different servers? So that when granted a role on one server, they're granted the same role on the other server?
idk what exactly you mean
The problem isn't not knowing how to do things, the problem is that nobody understands what you're asking for through your broken English.
that because i'm french
I don't blame you for that, I'm just trying to understand what it is you actually want.
ok so for example in the community server i have this role
and in the staff server i have this one
Anyone know how to install mysql community server instead of Maria db?
and i would like that when i put my command "i/uinfo" that give me the name of the role that i have in the community server
Hmm, I think I understand what you're asking now.
cool
mariadb is the same as mysql
@sly wyvern
just a different version
Yeah but it's not compatible with my code
so what he wants is , if we are in this server, he wants to be able to get his user info from his server and show it here
which is dumb
but hey
not my bot
@soft plaza did you try it? The whole point of SQL is that code written for one database will work on another database, and that's doubly so for MariaDB and MySQL which are literally just different versions of the same database.
I know, the this is that I have to modify a lot code to make it compatible, il just looking for a way to get the old version
Literally the only thing you should need to change is the database driver.
I got it on an other machine but on a new one, it installs mariadb
If that.
Basically, you just need to figure out the guild id of the community server, then call client.guilds.get(<guild-id>).roles
bot.guilds.get(infojeux).author.roles.find(role => role.name).author) is the command that i test
infojeux is a var
for the id of the server
actually wait no wrong I misread the docs
but the hoist key get the role that is separate in the user list
Ok, I'd go with client.guilds.get(<guild-id>).members.get(<user-id>).roles to get a user's roles.
for me <user-id> is replace by author
Yeah of course, you pass in message.author.id there.
The key thing is that you're trying to get the Member object from the other guild, not the Member object for the guild you're currently in.
yes now he give me [object Map]
And that's the role list. I'm not sure how you want to process that, since a user can have more than one role, but you should be able to iterate over it and do what you need.
i've tried this but he give me again [object Map]
bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(role => role.hoist.name))
Why do u have a second ) there, may I ask? (at the end)
what's role.hoist supposed to refer to?
discordjs give me that information
Oh wait sorry just read that.
Sorry I'm not that familiar with the js library, I mostly use the python one.
oh ok
I see what you're trying to do though.
p.s. object map is what u want tho
it just says [object Map] becuz it doesn't wanna spit the whole map onto the console/message
That last bit should probably be .filter(role => role.hoist).map(role => role.name)
^
or something to that effect
don't remember if .map is something that works on Map collections or if that only works on sets and lists.
Probably... .filter(role => role.hoist).array().map(r => r.name).join(" ")
that working but he give four other role that is not hoist
Its to recognize everyone and other but that will usable for other thing
Can someone help me figure out what is wrong with this. I have no clue how to fix and the stuff I have been reading isn't helping me much lol. It is telling me that .then is a Unresoved Function or Method
let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
translate(translation, {to: language}).then(res => {``` And yes I know I asked this earlier.
Does translate() return a promise?
Clearly whatever translate() returns isn't something that has a then in it.
then is just a function used to run code after a promise is resolved
it's a default on all functions that return a promise
yes
the only other line that has anything to do with translate is javascript const translate = require('google-translate-api');
that's kinda critical to know...
it just made me jumps between the 5 roles
Where'd u define language?
Are you sure they're not all set as hoisted?
this is the whole code:
let toTranslate = msg.content.split(' ').slice(1);
let language;
language = toTranslate[toTranslate.length - 2] === 'to' ? toTranslate.slice(toTranslate.length - 2, toTranslate.length)[1].trim() : undefined;
if(!language) {
const embed = new discord.RichEmbed();
embed.setColor('RED');
embed.setTitle('An error has occurred');
embed.setDescription(`Please supply a valid argument.\n**Example** \`${msg.settings.prefix}translate Hello world to english\``);
return msg.channel.send({embed: embed});
}
let translation = toTranslate.slice(toTranslate.length - toTranslate.length, toTranslate.length - 2).join(' ');
translate(translation, {to: language}).then(res => {
const embed1 = new discord.RichEmbed();
embed1.setAuthor(`${client.user.username} translation`, client.user.displayAvatarURL);
embed1.setColor('RANDOM');
embed1.addField('Translation', `**From:** ${res.from.language.iso}\n\`\`\`${translation}\`\`\`\n**To:** ${language}\n\`\`\`${res.text}\`\`\``);
msg.channel.send({embed: embed1});
}).catch(err => {
msg.channel.send({
embed: {
description: 'โ We could not find the supplied language.',
color: 0xE8642B
}
});
});```
yes
Ok. Have you tried actually printing out the whole object before the filter to see exactly what's in it?
console.log translation and translate for me before the translate line
he give me object map
Well yeah, you need to actually print out the map's contents.
If you want to see what's inside it.
Are you console.log-ing to get [object Map] or is it smth else?
you talking right here?
console.log(translation);
translate(translation, {to: language}).then(res => {```
yep
ok 1 sec
ok the log says this
{ translation: 'Hello world', language: 'french' }
The npm package u use only seems to accept ISO 639-1 codes
um ok lol
Look at the examples: https://www.npmjs.com/package/google-translate-api
so instead of french you need fr
Show me what the console said
{ translation: 'Hello world', language: 'fr' }
And it's the same error? nothing in the message and the stack trace changed?
it doesn't give me an error in the console. The code seems to skip this part and go to the .catch(err) part of the code.
translate(translation, {to: language}).then(res => {
const embed1 = new discord.RichEmbed();
embed1.setAuthor(`${client.user.username} translation`, client.user.displayAvatarURL);
embed1.setColor('RANDOM');
embed1.addField('Translation', `**From:** ${res.from.language.iso}\n\`\`\`${translation}\`\`\`\n**To:** ${language}\n\`\`\`${res.text}\`\`\``);
msg.channel.send({embed: embed1});```
Then how'd u handle the error?
Log the error
the problem now for me is why he gives me 5 roles while 4 are not hoist
What does bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(r => r.hoist).array() actually output though?
this is what the console says when I log (err)
{ Error
at /home/oem/Desktop/RedQueen/node_modules/google-translate-api/index.js:105:17
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:189:7) code: 'BAD_REQUEST' }```
Because if the roles are in that output, they have hoist set. That's how filter works.
when i add map(e => e.name) he give me the same thing
Where do u see [object Map]?
What's ur way to see what it outputs?
Do u make sure to console.log() and not do anything crazy like send it to a channel?
me?
thats a bug with google-translate-api @dusky steeple
oh me
Most likely ^^
use https://github.com/vitalets/google-translate-api instead
its a working fork
Or the actual api endpoint, just saying
no @opaque eagle now i see the name of role but he give me 5 roles of which 4 are not hoist
How did you verify that the four other roles are not hoist?
yes
@bright spear TYVM that worked perfectly
yw
here are the roles he shows me
and here are the roles that i have
1 can be hoist and its crรฉateur
And when you check the hoist on each of those roles, what does it say?
hoist flag ?
Not "what do you think it is", what actually is it?
Because I can pretty much guarantee it's true for all of them.
What you need to do is sort by the role position value and get the first one.
If you want to know which one you get displayed under.
here is the highest role
But ALL of those five roles are hoist roles.'
By virtue of the fact they were returned by that filter expression.
hoist define all the separating roles in the users list ?
because for me hoist is the role OF the user who is separated in user list
yes that what i mean
And all five of those roles have that setting switched on.
oh ok, i'm just stupid
What you can do though, is try sorting the role list based on role.position.
Sort based on role.position and then just take the first element of the array.
actually
bot.guilds.get("418898640942399509").members.get(message.author.id).roles.filter(r => r.hoist).array().sort(r=>r.position)[0]
just check if the role is member.hoistRole
Or is it last? I don't actually know.
ok thx i will do that
The role of this member used to hoist them in a separate category in the users list
๐ง๐๐ฝ๐ฒ: Role
So that'd be bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole?
They're trying to get the hoist role of the user on a different guild than the one in which the command is being issued.
ok now he give me 1role but not the right role

Doing the [0] thing or the .hoistRole thing?
I'm getting this really weird error every time I launch my bot.
at errnoException (dns.js:50:10)
at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:92:26)
(node:17228) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1)
(node:17228) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
(library is node.js)
Any clue why?
position give the role calculated in the api
so .calculatedPosition is the right to use
@vernal basin ur network is screwed up
no ?
oof
Try the bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole one instead that @bright spear pointed out.
^
ok
well it just started doing it yesterday
and I haven't changed anything related to my network since like two weeks ago
now he give the right role
oof
i just add .name because he give me @deleted-role
feelsbadman
bot.guilds.get("418898640942399509").members.get(message.author.id).hoistRole.name
is the right to use, thx for help guys. And sorry for my english
Don't worry about it, we don't mind as long as you at least try.
(Honestly it's better English than some of my clients at work ...)
lol
I Keep Getting This Message When I Make A New Command
have you tried removing the extra indentation?
Also, the dialog box is pretty useless, you should look at the actual console error since that'll tell you the line number of the issue.
it wants to remove from here
Yeah, you need to fix your indentation. In python every single line has to be indented correctly or the program either won't work or will do something else entirely.
Don't indent @client.event
^
It must stay on the same column as async def
Also, you need to indent the following line if message.content ... four spaces past the start if the previous line.
sloppy code = sloppy thinking
C o n s i s t e n c y :^)
this is my first time coding by my self
I wish you luck then.
But in python, indentation matters.
It's not like C or Java where you can put whatever you want wherever you want.
And indenting things the same way, even in the rare cases where it doesn't matter, lets you avoid a whole class of weird issues where you thought it didn't matter but it actually does.
can anyone help?
There's no penalty for indenting things correctly even when it's not strictly necessary.
Field with just the title?
Like, just don't set the description.
Which API are you using?
yeah but the description goes "undefined"
Oh, didn't see your earlier post, discord.js.
yes.
So, you're passing the embed dictionary to send, what about that doesn't let you omit the description?
What about message.channel.send({embed: { title: "My Title" }}); doesn't work for you?
Oh wait you're talking about fields?
Well same thing there, just pass the name attr and no value.
And if that doesn't work, pass an empty string.
No no, I just need to get rid of the description and only keep the title
What have you tried?
Does description: "" work?
which is better? canvas or gm for img manipulation(node.js)
I've seen people here suggest canvas
idk i find canvas missing features
well not rlly missing but most of the stuff people prefer built in like greyscale
I tried to add a blank field thinking I could keep a title but nah ๐
u could keep the title
@smoky mica like this?
.addField automatically gives you title to keep and description i only kept title but description still appears and says undefined
wot
i'm talking about fields
oh
hmm
why do u want a field with an empty value
just use a description or title
zero width space
so i want like this a title for something below like
Main title
Sub Title
Zero width space in the field value
โ
I was wondering that but it leaves a big gap ya know
You cant do it otherwise that I know of
nvm lol it counts as nothing written in quotation marks
I saw a guy do it with his bot
lemme try i think i messed up smth while writing
\
it worked but as i was correct its leaves a gap
yes its supposed to
exactly but i just need rating (main title) there and no gap, my stupid dumb ass cant understand how to get this to work
.addBlankField()
its not possible
each field has a space for title and content
you can make one blank but it'll still be a blank space
What is the best way to develop a balance/credits
I tried using better SQLite but it returned an error each time, and I had all prerequisites
just experiment
the database work itself is basic, your setting and getting
the rest is upto your development experience
Would fast-csv work for this?
what?
Nvm
i mentioned all the databases above
But whats a good db for when you need to shard or how do you modify your code to work with it is the real question
rethink is the best for sharding
it supports connection pools and stuff, and its realtime
How would you even test sharding tbh
I feel like there isnt much you can do
I would say shard a bot and test it on 2 guilds, but they will probably have the same shard id
MongoDB is fine
I use Mongo for my sharded bot
Depending on library you should be able to get 2 shards with 1 server on each @amber fractal ๐
Like Eris has options for amount of shards/amount of servers per shard
Can someone help me with a purge/clear command please. I am using discord.js-commando btw
DM me with the help plz
I wanna be fork fed tho
Nah i want my bot to do it ๐
all it can do atm is respond to ping, hey, r!help, r!flip, r!roll, r!ban, r!kick and thats it
and r!prefix
then add more commands
make your bot delete the ammount of messages from the channel by writing a command
Thats wat i want help w/
if you have an actual script that doesnt work, we help. but noone will give you a complete code
look above
and also that
channel.bulkDelete(5)
.then(messages => console.log(`Bulk deleted ${messages.size} messages`))
.catch(console.error);
How do i make this look for args that the user puts after r!purge thoughh
you write a command parser that should already be done since youre using commando
yeah its bad idea
this si the template i have written for most of my commands
const commando = require('discord.js-commando');
const bot = new commando.Client({
commandPrefix: "r!"
})
class CommandName extends commando.Command
{
constructor(client)
{
super(client,{
name: 'name'
,group: 'file'
,memberName: 'name'
,description: 'description of command'
});
}
async run(bot, message, args)
{
//command goes here
}
}
module.exports = CommandName
oh my fucking god dont tell me you are making a new client for every command
of course not
Wait
Doesnt the bot need to be defined again in a new file?
no.
No
why the hell would it have to be?
o
well, ill fix that after i amke sure this is working, Will this work?
const commando = require('discord.js-commando');
const bot = new commando.Client({
commandPrefix: "r!"
})
class PurgeCommand extends commando.Command
{
constructor(client)
{
super(client,{
name: 'purge'
,group: 'management'
,memberName: 'purge'
,description: 'Deletes a given amount of messages.'
});
}
async run(bot, message, args)
{
channel.bulkDelete(args)
.then(messages => console.log(`Bulk deleted ${messages.size} messages`))
.catch(console.error);
}
}
module.exports = PurgeCommand
He may pass args
i mean
i got the error An error occurred while running the command: ReferenceError: channel is not defined
is it a number, the rest of the message, or whatever
oh i wonder why you get that error
because the channel is not defined maybe?
this is why you dont copypaste examples
?
oh channel.bulkDelete
How do i fix that how do i make it the channel that the command has been said in
You pass message
god
what did i come back to
i told you write your own code dont just copy paste the example
i think i fixed it
TypeError: Cannot read property 'bulkDelete' of undefined
what does that mean
That you didnt fix it
im confudled x 2
The part before bulkDelete isnt defined
lmao
What does undefined even do? 
undefined is an actual module
why is module red squigly lined
literally just Define your undefined yo!
hold your mouse over it
How do i define bulkDelete
Do you still module.exports at the bottom?
ok audio
bulkDelete isnt the issue
did you copy paste that also
totally
Which is why it has errors
cuz im a nub
what does this mean
Thats when i hover over the red squigly thing
read the error
whats a token constructor method accessor or property
Thats why you shouldnt use commando when youre a noob
:>
someone just tell me plz im confusedddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd
You wont understand if we try to explain
dont use commando
and learn js
Its like explaining fractions to someone who oknly knows addition and subtraction
But commando makes it look neater and stuff cuz i can use different files
I tried using commando once and made 1 line and said f*** this
you can use different files in normal d.js
um you can use different files with any language or am I wrong on that?
someone tell me a decent sized bot made in d.js
Im following dapper dino's videos btw

You can do everhthing commando does wjthout it, plus you learn how commando itself works
What do you consider "decent sized"?
@lethal plover lol you need to work on rexi properly
No
eh
Fuck you
more than 1k
...Faisal how dare u
@earnest phoenix stop u can code the bot urself then
in more than 1k servers?
dont follow a tutorial
definetly not my bot lol
no thanks @lethal plover
ooooooo thanks @knotty steeple
about
Imma do that now
making a bot
im only up to 20 servers lol
I already have a codecademy account, but i forgot the password
so unless i make a new email i cant use that
Just reset your password?
im stupid ok
You dont know how to reset passwords and recover accounts?
I dont usually need to do it as im not normally a one to forget passwords
and the email isnt sending
this is slowwwwwwwwww
Patience is a virtue
how often is it okay to update presence
2 mins at the very min, 5 average iirc
How could I make this show up in a embed thumbnail?
const avatar = body.avatar || body.defAvatar;
.setThumbnail(avatar) assuming you use d.js
hmm I tried that and it threw an error.
embed.thumbnail.url: Not a well formed URL.```
then its obviously not a well formed url
I am trying to pull the bots avatar from dbl site
bot.user.avatar
no I have a command like Luca does
or client ^
to search for a bot
oh
I have the bot reading the information correctly just trying to figure out how to show the bot that was searched for avatar in a thumbnail in embed.
wait a sec I am going to api
dbl.getBot("id).then(botI => {
console.log(botI.username)
let avatar = botI.user.avatar
does anyone know how the 2000 char limit per message is calculated for embeds?
if field.length >= 2000
@bitter sundial when the webhook sends the POST request, what do I have to type in $_POST['here']
sry for ping
hm but there can be multiple fields and fields have a name and title, etc
@empty steppe the content length is separate from embeds
embeds have their own limits separate from 2000
nik can u help me too xd
oh interesting, where can i read up on that?
Integrate your service with Discord โ whether it's a bot or a game or your whatever you wildest imagination can come up with.
thanks nik
no
cri
lel
๐ค
like that dosent make sense
But $_POST is an array
so I just retrieve the first index of the POST array?
"POST array" doesn't make sense friend
no i have no idea what you're talking about
it just makes a standard post request to the url you specify
what do you use then
js
@hushed berry as before, I tried to run a server on java, but no requests are going in
Is it my vote server/vps or is it DBL
well i mean
alright umm a vote went in and worked but somehow when I press "Test" it doesn't
welp, weird
That's because it doesn't just work magically
You usually need to do a reverse proxy
I want to add an incentive for people to vote for my bot by giving them money in one of my bot's games after voting... I understand how to use the DBL API to check whether a user voted or not, but would anyone have any recommendations on how to only give them the money once? All I can think of right now is to set a 15-second timeout after they call the vote command to check again if they voted and add the money if they did, but then if they miss that timeout without knowing it and still vote, they won't get the money which seems really shoddy and jerry-rigged. Any recommendations? Using discord.js
This is a rough draft in notepad of what I was thinking of:
if (message.content === "botcall vote") {
dbl.hasVoted("message.author.id").then(voted => {
if (voted) {
message.channel.send("You've already voted!")
} else {
message.channel.send("Here's a link to vote")
setTimeout(() => {
dbl.hasVoted("message.author.id").then(voted => {
if (voted) {
addMoney()
} else {return;}
}
}, 15000)
}
});
}
hmm okay
If that seems to complicated for you, you can use getVotes() as long as you don't get more than 1000 votes a month
Check getVotes() every x amount of time and compare it to previous votes
New votes means those people voted in that bit of time
So reward those people
Okay, I'll definitely look more into that, thank you!
honestly I should probably figure out the webhook eventually anyway
Yes
You can use FS if you're using node
I'm not an fs pro myself since i dont use it often
can anyone just give me a code to change everyone's nickname (for an event) without getting ratelimited
just wait a second or two between changing nicks
im on mobile 
any lib that properly handles ratelimits should be able to run that
Can i make a command in python which makes my bot's prefix switchable (like rythm or dyno)
Ye ik but how can i do that?
discord.py rewrite?
