#development
1 messages ยท Page 736 of 1
Alright
How do I make my bot DM the person who invited. I've seen this used as a grasp for them to get people to a support page if they need it, but I have no clue how to actually do it. please @ me if you have a response i'm going to be gone for a while so I'd like to be able to find it.
You can't, otherwise you have them go through an oauth2 and force them to login through discord
Which is too much effort just for that & probably something else like redirecting them to a help page would be good
@formal vine
Gotchu, thanks
I know it's not allowed to send server count to DBL if it's fake. What if I'm testing it? Is it allowed to display a lower number?
That probably goes in #topgg-api
Ahh, okay thanks.
Can someone dm me and help my how its working
can you provide the question you need
I need help i whant to learn it but i need all the codes names and what its meaning
I now h2 that stuff
Learn what?
have you ever written code before?
How can I get the leaderboard position of the user who sent the message?
econ.query(`SELECT id, bank, bag FROM economy ORDER BY ${requestorder} DESC`, (err, rows) => {
if (err) {
throw err;
}
const embed = new Discord.RichEmbed()
.setColor('#800080')
.setTitle('Tabla de primeras posiciones')
.setThumbnail("https://static.thenounproject.com/png/714871-200.png")
.setDescription(`Ordenado por ${orderby}`);
let order = 0;
for (let i = 0; i < 10; i++) {
if (i > rows.length - 1) {
break;
}
if (!type || type == "all" || type == "total") {
select = Number(rows[i].bank) + Number(rows[i].bag);
}
else if (type == "bank" || type == "banco") {
select = Number(rows[i].bank);
}
else if (type == "bag" || type == "bolsillo") {
select = Number(rows[i].bag);
}
if (message.guild.members.get(rows[i].id)) {
const user = message.guild.members.get(rows[i].id).user;
if (!user.bot) {
embed.addField(`${numbers[order]} ${user.username}`, `$${select}`)
order++;
}
}
}
message.channel.send(embed);
});
this is my code
if your leaderboard has bots in it, its better to filter them out first
the bots are not in the table, put the users into the database individually
then why do you check for bots there?
loading...
Does command prompt need to be open in order for the bot to run?
yay imma try and get a nice and cheap vps so i can start running my bots 24/7
now that i just finished two of my bots
no if you have a different way of spawning the bot process
Anyone know why discord oauth would be giving a 401 on any redirect url except localhost?
my application works fine on local, but when deployed to my site, it doesnt work
yes
I did
Is there a difference between using a prefix when coding for a bot and just using the entire argument itself? For example should I be doing the whole [prefix] + command thing or can I just do prefixcommand together
It works the second way but is it better if I do it the other way around
using prefix + command is better because you can just change the prefix in 1 clic (or in a config file)
hmmm okay, thank you
anyone uses coderunner in vs code? and know how to add extra compiler flags like -pedantic or -Wall
Or use a command handler where you check for the prefix just once
i nicked some ideas from dyno's service status page and made a nice status section... thoughts? did i miss anything?
i wouldnt display a list of servers if i were you
Why not?
The point is knowing if an outage affects the bots ability to see your servers
It's not like you can see servers you're not a member of
it's against the tos iirc
It's not like you can see servers you're not a member of
You dont need to own it to see if it's online in the guild
Yeah it's showing servers which both you and the bot are in
You can only manage servers where you have the correct permission though
@green kestrel looks hot
Also no, it is not against ToS as long as it's one of 2 things:
- It's only showing servers you're a member of
- It's exclusive to the owner
In this case it's number 1
yup
i would be curious to have an oversight list as the bot owner, but i have no need for it, so its wasted dev time
curiosity isnt worth it, and its something someone could potentially hack into, so...
just fixed that list to work with mobile, added touchstart and touchend events
I'm always careful what power I give myself
yeah, i dont even have an eval command
Me neither
although, trying to make an eval command in C++ would be "O_o"
it would have to run gcc against some code, compile and link it as .so and dynamically load it
If I need information regularly about something I'll make a command for it
and thats just asking for trouble
i have enough trouble convinging people that my javascript interpreter is secure ๐
Eval commands are just so dangerous
No matter what you do
There is gonna be some exploit
yup
i think i covered all bases i can cover in my bot, i wanted to offer javascript scripting to untrusted users, so i wrote the bot in C++ and linked in a js interpreter where i can control the amount of memory it uses, the amount of cpu cycles its allowed, and even no filesystem or networking access apart from what i allow
to actually make a properly secure system, its kind of unforgiving, people have complained "but i cant do anything with that" because they have to approach JS in a quite old fashioned way without promises, lambdas, threads
yeah, its amazing what you have to take into account
eยทg. give them no network access, they still need to access discord, so you need to be careful what bindings they have, how often they can use them, and make sure they can't flood
Yep
give them e.g. http requests, and you then have to be strict on even the dns timeouts, the download and post sizes...
It's a scary thing tbh
and stop them chaining http requests together
yeah
i had a bunch of people throwing exploits at my bot for a couple of weeks, only one person managed to cause any issues
that was due to a malicious regex
and that was because the interpreter lib itself was missing something, so i had to patch that and submit the patch to the lib author
its a rabbit hole and a half
console.log('Musique ma geule')
});
client.on('message', message => {
// Voice only works in guilds, if the message does not come from a guild,
// we ignore it
if (!message.guild) return;
if (message.content === '!7join') {
// Only try to join the sender's voice channel if they are in one themselves
if (message.member.voiceChannel) {
message.member.voiceChannel.join()
.then(dispatcher => { // Connection is an instance of VoiceConnection
message.reply("**J'ai rejoint le salon vocal avec succรจs :thumbsup:**");
})
.catch(console.log);
} else {
message.reply("**Vous devez d'abord rejoindre un salon vocal :x:**");
}
}
});```
.then(dispatcher => { // Connection is an instance of VoiceConnection
Where is const dispatcher = connection.playFile('โชโชC:\Users\hieli\Downloads\Vitas 7th Element 2002.mp3')
Also that's a callback
Your paramater is dispatcher
Also this isn't the right channel
lnvaid server format
i have an egentification server
What
What
What
what
Okay
@west raptor I dont understand ( ๐ซ๐ท )
@lunar crystal Quel est le souci?
Faudra passer dans #memes-and-media pour me l'expliquer
oki ^^
help me please?
You are calling toLowerCase on undefined
yes
yes
You can't do that
@charred loom looks like you aren't passing in any args on the message
Check if they exist first
Last time was a similar screenshot, but a different issue
So, are you helping me?
which argument
check line 15
and see what argument the toLowerCase is used on
that argument does not exist/is not set
idk
read your errors
for fucks sake
yes bro, yes, but how do?
you check if the argument isn't specified
Do you have any experience with any programming language
english
It's very doubtful they don't just poke around to try to get their errors fixed
what should i put on line 15?
?
its says "of undefined"
yes
thats like the easiest thing you can fix
^
In vain do you try to take me bypasses and try to guess, because I would ask you, if not, I would do it myself
I wont be spoonfeeding the answer to you directly
thats why Im asking you the long way
...
Its your code, I just rack your brain for you to find it out
it literally says "toLowerCase() of undefined"
I thought developers are supposed to read the errors, use their knowledge of the language syntax, apply logic
what is the value that goes before the toLowerCase()?
@charred loom I will give you some help:
you want to check if the argument exists
input?
๐คฆโโ๏ธ
where is the function "toLowerCase()"
where did you put it?
screenshot it
now once you know where that thing is
yes
the value "BEFORE" toLowerCase() is undefined
Are you sure the thing you call toLowerCaseon exists
Did you already try running it after you added line 14?
yes WhiteSpirit
he doesnt know how to even check if a its an empty array or nope
he is directly accessing an array without knowing if something is inside there at the first place
as simply as it sounds
the thing you need to do is to check if you array has actual string inside of it
of course that would throw errors if someone breaks your bot by inputting a blank argument
leave it so, give it right
thats the answer to your problem ๐
check the length of your array
I see apples
or check if the array is empty
@blissful scaffold help me with example with line?
My bots are not made in JavaScript, but I can give you an example in another language
They told you exactly what the problem is, you should be able to research from here
#trycatch
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array
This might help if you want to know more about arrays
no
lol
lul
are you the one to write a line?
now go out and explore the work of learning!
oh, is stupid
I'm out of here before Spider gives me another warning xD
hide yourselves
help?
solo is undefined
solo or wins?
solos is undefined
How are those errors not self explanatory
they are
the problem is that they don't want to read them
despite being told to about 5 times now
that made no sense but somehow managed to make me laugh
I'm fairly sure someone with knowledge of the language syntax should know how to use documentation
ok, so help or no help
we help but you just disregard everything
yes

he doesnt want help, he wants spoonfeeding
Good night, I have nothing to do with you
his definition of "help" is being given working code to copy and paste
if you want code to copy and paste, you can always pay someone to do it for you
yes :))
give you 1 e paypal
you are stupid bro!
lmao
I would argue that
how are we stupid? we know how to use the languages we learned and know how to read errors and find the solution...
Is it just me or does Perl look like chinese shizzle?
You are the one who has no willingness to read your errors or really listen to any advice you are given.
perl is fun to work with but it has messy syntax
advices are useless for people who dont want to learn
from my experience
Learning does not consist of literally copying and pasting examples all the time
@earnest phoenix where did you learn it? (Just interested in the basics :D)
i took a few courses on udemy
@slender thistle besides that, stackoverflow is bae tho right xP
Your post has been marked as duplicate
I would recommend official servers for the Discord libraries instead of SO
yh
I personally usually go either on Google or asking my friends
Whats SO?
StackOverflow
Ah
SO is useful, sometimes but it's spoonfeeding heaven
solutions often promote bad practices
and sometimes gives the wrong info
SO is amazing, but ya gotta understand the code ๐
especially on discord related questions
reddit is suprisingly good for discord coding questions
Being limited to simple/Discord libraries, Google and Discord servers have helped me out so far. Might use SO someday when getting to other libs
Uhu, what language do you use?
you graduate from beginner to intermediate programming when you move from stackoverflow to official documentations
well, you never really stop using stackoverflow, you just use them way less
xd
Yup.

First check if you know how2fix,
if not, check docs,
then google &SO
Python so far, thinking about getting used to C++/C# later
i mostly go to SO to see how people implement some specific solution, then end up making my own anyway
C++ is good
Ah, yes, reinventing the wheel 
i still prefer python tho
I only use SO if I need help on an error
im the champion of wheel-reinventing
Nice, I'm currently also working in py, learning c# and basics cpp (for school), c# is pretty nice. [Still love python more]
love the utility of python, if theres somthing you need theres almost defo a module for it
Indeed
Python worked so far with me in my college adventures
i tried making my own login system because i couldnt be bothered to learn how to use composer
And if there isn't a default module there are most likely other public libaries available.
but i gave up at some point
Getting straight to CPP after python is hard
lmao
lol
@slender thistle probbably bc's ur expectations are 2 high.
Might wanna start again with the mental state of: "OMAGAWD HELLO WORLD" ๐
๐
I've been learning C++ for the past few days, boy will it take some time to get used to the syntax
ye, kuch ;
i had to learn some bits of it to mess with node native modules
๐
it was hell
I can imagine
Shivuwu, try to switch back to python for a sec, you'll type ;'s everywhere lmao
like how to convert ::string<T> to ::string<V> or whatever the hell that means, how how to convert it to anything that node understands
stupid v8
i cant live without {}
Habits
yh
you dont need {} if you have only line after if
i had to modify a C library once, and it was confusing af because the authors rarely ever used {}
and bad indentation lmao
my required bot libs xD
jeez
thats direct dependencies you require? or does it include dependencies your packages need?
there the external modules
there are alot of custom modules i use
mao
had to custom build our own WebHander for large scale data gathering xD
my bot has very few dependencies, but a few of those dependencies have like 50 dependencies
yh
biggest pain in the world: Threading with async
Oof
xD
The bot uses:
11 Custom Modules as dependencies
36 External Modules
then those modules use:
186 Diffrent modules
100 of those extra modules are google and google alone -_-
<#id> iirc
have you guys heard about the event-stream fiasco?
made people lose shit ton of money in bitcoin
one of the greatest hacks
powered by npm
xD
lmao

Hey I need help, I actually started to develope a bot but I have problem
I can't get the bot online, node . And index.js are not working, screenshoot (I deleted the token in purpose)
@quartz kindle I couldnโt relate to anything more
I have like 5 dependencies, but my node_modules has 400 sub dirs 
@glacial lynx what response do you get when using those commands
When I type node. It's respons with desktop or something like this
And when I type index.js it says that the command not found but it is exists
@late hill
Show the command please
You're probably in the wrong directory
Navigate to the project folder using cd or if vsc has the option, you might be able to just open a terminal in vsc that'll already be set to the project directory
I can't send an empty .txt file, have someone fill it in to my requirements, and then have them send it back?
..what?

Then you send it back
unless you pay, likely not
^
Ah shit, your right
unless its really really simple
Well
I'll say what it does
You decide if its simple
please stop sending files ๐
This bot should just be able to give members in a server a role when they hit a level mark; They reach level 5 they get a Level 5 role, etc.
mee6
I have to pay
are you sure thats good advice lul
"i want to make a gourmet meal but i dont know how to cook"
then order food or go to a restaurant
"no"
like what
sums up this channel pretty well
why would you go through a possible mental breakdown to make a bot that won't even be good quality instead of taking 5 minutes to find another leveling bot
is this like a personal attack of something
im self reflecting here โ๏ธ
my stubborn ass went on to spend 4 hrs making a youtube to mp3 tool when i could've used ytdl and ffmpeg lol
lmao
tbf cry you did make minecraft interact with another program
yeah coding while being asleep is significantly more difficult
tbf
agreed
half of innkeeper was made at like 3am
and tbh i only do like 90% of my coding just to compete with a friend
I haven't worked on my rewrite for months because I'm just lazy
my coding consists of perpetually improving my code and never releasing it
t h i s
@twilit rapids ayy same but i started it again recently. making a list of what needs to be done and slowly nomming at it is very productive
i love creating programs and tools i just never release half of it
somehow i turned a 500 line paginator into a 100 line program
and it works
the joys of having try and except
xD
I would need to look where I left off and what I still need to do and what not
it's why coding is fun, you can literally create anything you want
yh
it becomes a huge problem when you decide you want to release a production ready api
because it never becomes production ready
lmao
discord is just a one big issue but it is still released ๐คทโโ๏ธ
if im sharding, how can i dm a specific user by their id? would bot.fetchUser work even if sharding?
i feel like no one there does their job properly
i believe someone tested that and it seems fetching works across shards
dont take my words for it tho xd
only one way to find out xD
^
fetchUser works anywhere because it uses the REST endpoint which returns basic user info without having a shared guild
is it really a bug if the bot just spews out errors breifly till the cache is ready?
or is it just a helpful insight to make sure its working
you should do your best to minimalize the amount of errors you get
coming soon: merging google speech audio recognition with cognitive AI models for detecting toxic langauge patterns to build an AI moderator
I, for one, welcome our technocratic overlords
also
working on an ear rape detection bot
that can only go well
and tbf
its cuz on_message starts firing away as soon as the Webdrivers are fired up
once on_ready has booted its fine
just needs the global var xD
any ideas how to make to display other guilds membercount in command ??
wdym?
u see this ?
if you have the ID of the guild you can do client.get_guild(ID)
@earnest phoenix what library are you using
discord.js
Well, you get the number of members by doing <Guild>.memberCount, where <Guild> is the guild object
i want to shows for every guild membercount ๐
client.guilds.get("guild ID").memberCount
How do i make a guild list for my Bot in a embed with reaction menu (+100 servers)
The best would be an example code because I have no idea how to do it
Thanks for the help in advance
What language??
Are you asking how to make a command that sends an embed containing a list of all the guilds your bot is in? @sterile minnow
You should know that we don't allow bots that have publicly accessible server-listing commands
yeah im a embed menu for discord.js
Can't help, sorry.
@sterile minnow Try this https://canary.discordapp.com/channels/264445053596991498/272764566411149314/514595208734834698
Tony created a guide on how to do reaction menus
would you like some help, why not write the one who writes the command? @commands.command() @commands.has_role('ASD') async def clear(self, ctx, amount : int): await ctx.channel.purge(limit=amount) await ctx.send(f'Tรถrรถlve **{amount}** รผzenet.') @clear.error async def clear_error(self, ctx, error): if isinstance(error, commands.MissingRequiredArgument): await ctx.send(':exclamation: Adj emg egy รฉrtรฉket ami nagyobb mint **1** รฉs kisebb mint **500** :exclamation:') if isinstance(error, commands.MissingRole): await ctx.send(f'{message.author} Nincs jogod')
here I would like you to write the name of the command user await ctx.send(f'{message.author} Nincs jogod')
I just can't figure out why it's not good
Please provide more info, such as what library you're using, what exactly you're trying to do, what the problem is, what's happening, the errors produced, etc.
yap
sorry not the best english
I want someone who has no right to say this
@earnest phoenix you have no rights
I'm writing in python
what does it return in the channel when you execute the command
you have successfully deleted it to create a message
I get this error Command raised an exception: NameError: name 'message' is not defined
to this codeawait ctx.send(f'{message.author} Nincs jogod')
Yep
Context has message property
I read earlier but couldn't find a solution, so I came here
message doesn't exist in the function, maybe do what shivu said
sikerรผltawait ctx.send('{} Nincs jogod ehez a parancshoz'.format(ctx.message.author.mention))
thanks for the help @slender thistle
@vital lark you technically linked almost exactly what I said
@earnest phoenix ctx has shortcuts btw
You can use ctx.author
ok I'm so tired that I thought that was js help me
I have a problem that I cannot solve, I am using mysql to store data.
I have a function that I want in the channels specified by the user, does not work, but how do I upload the channels to the database?, since there would be many
uhh, could you be more specific? Like, do you want to just save one channel the user set?
@distant plank share your code
@distant plank if youre in control of the query itself, rather than building it from class methods you really need to use the syntax INSERT INTO table (fields) VALUES(...) ON DUPLICATE KEY UPDATE field = 'newval', otherfield = 'newval'
that will insert it, or if it exists, update it
using REPLACE INTO is dog slow, because this table you want to create will very quickly end up huge
i speak from experience as this is how my own bot stores its data in mysql and i made that mistake at first ๐
Could anyone help me figure out code that creates an entity for every single member in a server, and for every single time someone joins a server? I guess a bot would be the thing that detects who joins, but I can't imagine how.
If you read the docs you'll find that there's a function / event that fires off every time someone join a server the bot is in
Somthing like on_server_join() somthing like that
Here you can ask questions about bots ??
"Channel for chatting about (bot) development."
its not going... (reaction menu)
it cannot read collected every time is a error
i have a new idea
guys if you need I made much better lyrics api that beats ksoft in cache response time and doesnโt require any attribution https://lyrics.tsu.sh
hey any github expert here?
@solemn harness what do you need help with
how i solve the conflicts problem while i am merging pull request
yes
what

Would anyone be able to help me create code that makes a .txt file with each persons name who types in a certain command, along with what responses they added.
For example: (in a .txt)
Name Response
hiero#4663 yes, no, blue, orange, xyz
blah#4567 no, yes, orange, xzy
Use a DB
Be better than a text file
Also do it off user ID
As if people change their name the bot won't see it anymore
I wouldn't know how to set it up with either to be honest
Where as their ID stays the same throughout
I get why I should use, ID and why DB would be easier. But still how would I create that, is there short way. I know we had a chat earlier, but this is just the very start of what i'm planning.
Well you can get the user ID just via the bot
Somthing like message.author.id
For a DB search up how to use SQL lite as it pretty easy to learn and understand
So i'm imagining, the command being typed in, and the bot asking "Please enter your response in this format 'x-y-z-a-b-c'" and then the bot responds after the person has typed it in, with thank you your info has been saved.....
Would that work with what your telling me
the whole message author thing
Lyric
guys i need help ..
its so complicated for me. when i edit something in my project js or anything, my jsons are rewinding 1 hours and i didnt understand why its happening to me. if u know anything about please help
Show your code?
stat[message.author.id] = {
hp: 0,
mana: 0,
guc: 0,
defans: 0,
hiz: 0,
}
fs.writeFile("./kayฤฑtlar/stats.json", JSON.stringify(stat), (err) => {
if(err) console.log(err)
});
}
});
avoid using json files as a database
its true but i didnt expect so many people would use it my bot XD
How can get 100 in here?
db.add(`test_${message.author.id}`, 100)
db.get(`test_${message.author.id}`)
db.get is not function
I'm trying to do invite system
what is db?
const test = await db.fetch(`test_${message.author.id}`); if(test === '100')
i think
depends on what db is
there are hundreds of database engines, drivers, frameworks and libraries out there
i think he is using quick db
if so, then the answer is in the quick.db documentation (which is an unholy mess)
probably a stupid question
I want to find out how many days/hours/minutes are left on my server (which has a different timezone) to 2019-12-02T21:00:00Z
how can I approach that ?
how much time from now to 2019-12-02T21:00:00Z
sorry if my grammar isn't perfect. Not a native english speaker.
so... you just want to convert your timezone to UTC?
Is my question really that badly stated? Or are you making fun of me? o.O
2019-12-02T21:00:00Z <--- This is the time when something happens
now <-- is the time that is now
I need to find out the time from now to that date. So currently about 4d 8h and 14m
oh
you could've just said time difference
convert both dates to UTC then subtract them
you'll get the amount in milliseconds
what does the T and Z mean in the string? 2019-12-02T21:00:00Z
okay thanks
var leagueend = new Date(file[x].end).getTime();
var now = new Date().getTime;
var timespan = leagueend - now;
var days = Math.floor(timespan / (1000 * 60 * 60 * 24));
var hours = Math.floor((timespan % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
var minutes = Math.floor((timespan % (1000 * 60 * 60)) / (1000 * 60));
var seconds = Math.floor((timespan % (1000 * 60)) / 1000);
I guess I am doing something wrong. I am getting NaN
@formal vine I'm guessing this is what you want https://github.com/winstonjs/winston
@fickle anvil I believe getTime is a method and not a property
You could straight up subtract the Date objects
You can also put the outcome of that into a Date object
And then use the methods provided in there
Instead of your days/hours/.. calculation
Bbb
What
What I'm saying
Is that they can simply use the Date object itself
As in
Not using getTime()
The exact same result would be achieved
help me??
Is that the full error
Say you have obj When you do obj.x and it says Cannot read property 'x' of undefined it means obj is undefined
and you fix it by actually defining it
idk how you get the stats, so I can't help with that
In my dick, I read it!
wtf

Does one get hang of those errors by learning JS beforehand
I think, depend
he has hell on him this bot
I mean surely there's a lot of resources om the Internet to at least try to find solution for the error
undefined property error is one of the most basic errors in javascript
Yes this is true shivuwu
Well I tried to find, I tried to do, but it doesn't work
๐คฆโโ๏ธ
Can you help me or not?
you know that you can't literally copypaste the entire error into google and expect it to return a solution to you
right?
Look closely at these 2 images:
Slowly read the error: Cannot read property 'wins' of undefined
https://codeburst.io/uncaught-typeerror-cannot-read-property-of-undefined-in-javascript-c81e00f4a5e3
First thing I got on Google
So there's no such thing as ID anymore what would I put in place of it
Where do I fill in?
So there's no such thing as ID anymore what would I put in place of it
what
help meee
id always exists
check the docs for your library
to see how to get the currently logged in user's id
The connection hasn't been established yet when the server count is trying to be posted
So user property doesn't exist at the time of posting the server count
Where do I fill in?
Omfg not this again
how is this guy not muted yet
If you don't want to bother with handling all that crap, you can use dblpy to make life easier.
Or, if you don't like that option, make sure you use this https://discordpy.readthedocs.io/en/latest/api.html#discord.Client.wait_until_ready
@outer niche
if you do not want to help me!
we've helped you
ok
Read the error
thx
It tells you
We gave you the answer multiple times, Ciprica
You are refusing to comprehend it
shivaco gave you a link to see how to handle the error even, you probably didn't even visit the site
I don't even do JS and I can read that error and understand what I gotta do
Well, if I don't understand

Give me an example of my ideas, not others
Do you also not understand that message
Give me an example of my ideas, not others
the solution to solving the error is the same regardless of the context it's in
Search it up
Hey, I know this is bit of a stupid question but I was wondering what language should I learn from these 2 to start Discord botting java or python?
Learn the basics of the language first
It depends on your preference really
python is the easiest to jump into with no programming experience afaik
It's simple but I wouldn't go that far
Some what yh
@earnest phoenix Yes? Where i put 10 ?
10 what
https://codeburst.io/uncaught-typeerror-cannot-read-property-of-undefined-in-javascript-c81e00f4a5e3
oh god
Alright, let me just
you just looked at the picture from the embed and thought that's the solution, didn't you?
Read ๐ The ๐ Error ๐ Search ๐ it ๐ up ๐
exampleeeeeee, i read the error
yes?
@charred loom please, before you continue with any questions learn the basics of JS (JavaScript). Read online guides er even rent a book at your local library. If you continue with asking questions without learning or doing research your own you will get muted for 3 days.
Yes, there were
where?
wow smfh
timo
I was gonna yell at him
fucking stealing my dopamine
give it back
you need to understand how javascript works and you need to understand the point of undefined in javascript, otherwise we can't really help you out more than we have
Ok until you give me 3 days, give me the answer
First one being simpler
I still don't get it
This is why discord bots suck, people try to make them without the slightest bit of programming knowledge smh
Not at u culan btw
object.property
say you get Cannot read property 'property' of undefined
That means whatever is before .property is type undefined
can confirm, ive been there lol
@loud salmon bean this kid
aight whos gonna steal the mute
-m @charred loom rude, help vampire, unwilling to learn in order to grow as a programmer | 1 week
๐ค Muted zZCipricaZz#1442 (@charred loom)
I am still getting the no attribute ID
and the winner is spider ๐ ๐ ๐
SPIDER, THIS WAS STILL WITHIN 5 MINUTES
Where are you posting the server count
WHY
I give it a couple days before he gets banned
I will have you know @mossy vine he gave me permission
@twilit rapids fuck you i was faster
At this point I have no idea what I am doing wrong
@modest maple i mean some people are willing to learn as they go, and that's really appreciated but when you have people like these coming in here asking to be spoonfed and not willing to learn or read anything at all it's just straight up degeneracy
also leaking mod chat, smh
Yup
Just hold it there, culan
Take a step back and relax.
Good, now... where in your code are you trying to post your bot'sserver count?
It's at the very bottom
Can you send me a screenshot?
Reset your DBL token please
Good lord, which discord.py version are you on?
I'm going to be honest I do not know that is
Mind opening your command prompt and type pip show discord.py
Wait, what do you not know?
Have they got the 1.2.4 version issue?
What's with it
They are accessing bot.user outside of any function
aka when it doesn't exist yet
Oof
Version 1. 2. 3
Alright, have you read discord.py changelog?
Specifically the part about servers?
Ah right the animated error
I fixed that but I'm still getting the ID error
What does your code look like now?
It is bot.guilds
What do you mean
Also, read about the wait_until_ready
You are trying to use bot.user when it wasn't assigned still
Solution: put wait_until_ready in your on_ready and below that, the line where you declare the variable url
Hope that helps
I do stuff like asyncio.sleep on my on ready before I send the request, to allow everything to start up properly
Also, that code will send a request each time your bot either joins or leaves a server, I suggest you use a time-fixed loop for that
^
wait_until_ready delays until internal cache is ready for use

Ok
So this
nice token leak
I am going to reset that
url = "https://top.gg/api/bots/" + bot.user.id + "/stats"
headers = {"Authorization" : dbltoken}
async def on_ready():
payload = {"guilds_count" : len(len(wait_until_ready))}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(url, data=payload, headers=headers)
async def on_server_join(server):
payload = {"guilds_count" : len(len(wait_until_ready))}
async with aiohttp.ClientSession() as aioclient:
await aioclient.post(url, data=payload, headers=headers)
async def on_server_remove(server):
payload = {"guilds_count" : len(wait_until_ready)}
async with as aioclient:
await aioclient.post(url, data=payload, headers=headers```
So that
I didn't even know bots had a /stats endpoint 
Oh, I was thinking of only get requests. I know about the post stuff
async with as aioclient:
uhh
also len(len(wait_until_ready)) that's a no, and change the dict keys back to guild_count
Events names are affected too so that's going to be on_guild_x
uh i was just about to answer
this reply wasn't even in the code you provided
well whoever deleted their message
oh nvm
sorry didn't see the ignore message
another command wasn't defined properly, and affected everything else
ah ok
if(!message.member.roles.some(r=>["test"].includes(r.name)) )
return message.reply("Sorry, you don't have permissions to use this!");
let member = message.mentions.members.first();
member.addRole(role).catch(console.error);
member.removeRole(role).catch(console.error);
}
``` it was this and needed
```if(command === "role") {``` at the front
oh ok lol
Error here?
if(command === "info") {
const exampleEmbed = new Discord.RichEmbed()
.setColor('#0099ff')
.setTitle('Zone Wars Public')
.setURL('')
.setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png', 'https://agentt1x.github.io/agentt/')
.setDescription('Fortnite Zone Wars Discord')
.setThumbnail('https://i.imgur.com/bLDvSyi.png')
.addField('Management', 'agentt, Sentrah, Pogy')
.addBlankField()
.addField('Bot is online 24/7, But occasionally may go down for maintenance')
.addField('Need help?', 'DM a staff member')
.setImage('https://i.imgur.com/bLDvSyi.png')
.setTimestamp()
.setFooter('Developed by: Agentt', 'https://i.imgur.com/wSTFkRM.png');
message.channel.send({embed});
}
there
what's the error?
doesnt send at all
and all other commands work fine?
oh
const exampleEmbed = new Discord.RichEmbed()
message.channel.send({embed});
lolol there's your solution

nope @slender thistle
yeah embed is not defined
change it to what you defined it as
in the TextChannel#send part
have you considered defining it
fixed i think
does it send?
yes
.setColor('#0099ff')
.setTitle('Zone Wars Public')
.setURL('')
.setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png', 'https://agentt1x.github.io/agentt/')
.setDescription('Endgame Practice')
.setThumbnail('https://i.imgur.com/bLDvSyi.png')
.addField('What is Zone Wars Public?', 'Zone Wars Public is one of Best ways to Simulate End-Game scenarios and Improve in all areas.')
.addBlankField('')
.addField('Bot is online 24/7', 'But occasionally may go down for maintenance')
.addField('Need help?', 'DM a staff member')
.setImage('https://i.imgur.com/bLDvSyi.png')
.setTimestamp()
.setFooter('Developed by: Agentt', 'https://cdn.discordapp.com/avatars/290946913921138688/a_9b276ea79aebee7f716ce325bf130705.gif?size=2048');
message.channel.send({embed});
the error strikes again
.setColor('#0099ff')
.setTitle('Zone Wars Public')
.setURL('**There must be a link in there**')
.setAuthor('Developed by agentt', 'https://i.imgur.com/bLDvSyi.png') //('https://agentt1x.github.io/agentt/' only one Author link)
.setDescription('Endgame Practice')
.setThumbnail('https://i.imgur.com/bLDvSyi.png')
.addField('What is Zone Wars Public?', 'Zone Wars Public is one of Best ways to Simulate End-Game scenarios and Improve in all areas.')
.addBlankField()
.addField('Bot is online 24/7', 'But occasionally may go down for maintenance')
.addField('Need help?', 'DM a staff member')
.setImage('https://i.imgur.com/bLDvSyi.png')
.setTimestamp()
.setFooter('Developed by: Agentt', 'https://cdn.discordapp.com/avatars/290946913921138688/a_9b276ea79aebee7f716ce325bf130705.gif?size=2048');
message.channel.send({embed});```
i think it schould go+
Your problem was .addBlankField(); it accepts a true or false.
Is it going?
I did what @sudden geyser said and it worked
k cool
nothing like finally completing a piece of code to realise it is completly pointless -_-
Is it possible to put 2 data in a single field in mysql?, I have a configuration command that I want to deactivate commands in channels that the user chooses, but I don't know how I can store the id of the channels in a single field, something like this
id supsafe affectbots spamdelmsg disabledchannels
611714357809905684 1 1 1 629048908852494354
629048732863692800
637358847543214080
ok xD
id,id2,id3,id4...
:|
then when fetching the value from the database, split by the comma and return the array
@earnest phoenix And if the user wants to reactivate it, can I only remove the id of the channel he choice?
yes... because it's an array
remove the element from the array and then when updating the value just join them with the comma again
basically, for getting
get value -> split by comma -> return the array
for updating
add / remove element from the array -> join by comma -> update the string in the field
@earnest phoenix Can that be done in a varchar?
:v
def main(url):
import requests
if "https://drive.google.com/file/d/" in url:
url = url.replace("https://drive.google.com/file/d/", "")
url = url.split("/")
url = url[0]
url = f"https://drive.google.com/uc?export=download&id={url}"
r = requests.get(url, allow_redirects=True)
FileName = r.headers["Content-Disposition"]
FileName = FileName.split('"')
FileName = FileName[1]
open(f"{FileName}", 'wb').write(r.content)
elif "https://www.dropbox.com/s/" in url:
if ".orcbrew?" in url:
url = url.replace("dl=0", "dl=1")
r = requests.get(url, allow_redirects=True)
url = url.replace("https://www.dropbox.com/s/", "")
url = url.split("/")
url = url[1]
url = url.replace("%20", "")
FileName = url.replace("?dl=1", "")
open(f"{FileName}", 'wb').write(r.content)```
ah joy
gotta love string manipulation in python
which needs doing separately -_-
you cant do .replace().split()[0] in python?
weird lul
it would work with a string thats contant in terms of the string
but urls are weird
not to mention, GoogleDrive has this amazing thing where it encrypts the share link
for some reason
probably for that reason
They don't want people downloading it like that I'd guess
they probably want you to use https://developers.google.com/drive
batman
ive been through that hell
the user cant grant access to the files and folders without going through their Oath2 system

which opens host side
so the API works for servers / programs using it to grab files as storage
but not for people to change around
that was 3 weeks of hell xD
i did discover that the link system is way way more efficent
xD
I have a question regarding webhooks
whats up
anyone know how long it ususally takes to get accepted or denied
1 week +- a few days
Thanks
let curIndex = 0;
let relativeIndex;
for(relativeIndex = 0; relativeIndex < 5; ++relativeIndex) {
if(relativeIndex > (resultList.length - curIndex)) {
break;
}
}
let results = [];
for(; curIndex < resultList.length - curIndex; ++curIndex) {
results.push(resultList[curIndex]);
}
var curString; //first item undefined if not set to any value ref XCur1
if(resultList.length>10)
{
curString = "Too many results";
}
else
{
//results.forEach(curIcon => { curString += curIcon + " "; }); // trying to add icon here later for now output its url
results.forEach(currency => { curString += currency + "\n"; });
//First item malformatted. If search for "alt" predicted output "Orb of Alteration" and "Exalted Orb". Orb of Alteration is an undefined result. XCur1
}```
Can someone help me?
the first entry of curString is always undefined instead of the real first result.
how can you += a undefined string
if its going to the else isnt it trying to curString += currency + "\n"
and if curstring is undefined which it is if result.list > 10
technically it works. just the first entry is always "undefined"... here the first entry should be "Orb of Alteration"
Because there's a difference between x++ and ++x
You're using ++x which will be executed first
So you're starting at index 1
Not 0
so relativeIndex++ and curIndex++ ?
still the same
@earnest phoenix I did it, thank you very much
It's difficult to tell what you're even trying to do especially as there's missing code in what you shared up above @fickle anvil
What's resultList like for example
it's too much text to put into discord, that's why I only took that part
pastebin
pastebin is basically an eye blinding tracker lol
yup
no from the hell of paste bin xD
now live with your own fault and help me 
a sure beauty she is
then learn js ๐
but js bad xD
but much easier than python :3
uh oh
what uh oh? is that a nerd-trigger?
@late hill did you take a look at the paste? :3
hi hello yes ill get straight to the point, best way to create json in kotlin?
there's a lot of ways to do it
but i need opinions & personal accounts here on what the best way to do it is
because for some reason every jvm based languge hates json
ps august i'd tag you rn but youre probably sleeping
eclipseidk any lightweight ones
Lol
well
intellij is a thing but you said lightweight
eclipse
or you could use dr java
we have given you answers on your question





