#development
1 messages Β· Page 321 of 1
@earnest phoenix
Making that bot you wanted for you now!
Got the audio files for it.
@copper heath nice
nicee
u are the best
so i can dm u
@keen anvil @weary shoal @earnest phoenix First message using Dicksword.jsβ’
lol nice
@karmic parcel I was exicted too smh
OwO
nice
Mayo
client.on('ready', () =>
{
client.on('message', (message) =>
{
console.log(`${message.content} posted by ${message.author}`);
if(message.author.id === client.id)
{
message.edit('Editing liek a baws');
}
});
client.sendMessage('352851932273967114', 'Edit me harder');
});
"edit me harder" 
π€
client.on('ready', () =>
{
client.on('message', (message) =>
{
console.log(`${message.content} posted by ${message.author}`);
});
client.sendMessage('352851932273967114', 'Edit me harder').then((sentMessage)
{
sentMessage.edit('Promise edit');
})
});
You don't know that it's what I'm using in my own lib that I'm making, do you?
hmm
Your own lib?
yes, lol
he's making a lib
You're putting an event listener in an event listener
That's aids...
That code it actually horrid.
listener.on
listener2.on
ππΌ
Great idea... π€¦πΌ
Also what the fuck editor are you using?
lol
and your formatting is vile too
That's fucking aids formatting.
lol? is this all you've got to say about your lib
All you have to say to defend yourself is lol
}else
{```
π
I don't even care what you guys think
You good?
Dude
Then don't post shitcode.
Your lib is vile
It hurts to read that

I'll tell you when you get mine right.
Guess our ages.
plz
Then dont post shit code
lol
@karmic parcel is 24
client.on('ready', ()=>client.on('message', this))
π
he can smack that monkey ass
You know what, I'll just ignore your shit code and back away from this conversation. But I'm not underaged and cither is Cake.
π
either*
cither
Can't spell ππΌ
like I stated already
ik
same π
atom is shit
how
How so?
idk it's bad
they're pretty similar, VSC seems to perform better
oh and Mayo, how does this look for sending and editing a message you sent?
client.sendMessage(channelID, 'content').then((message) =>
{
message.edit('new content');
});
No but seriously, gonna stop about the actual code itself but why is your formatting so bad?
client.sendMessage(channelID, 'content').then((message) => {
message.edit('new content');
});
plz
lol
client.sendMessage(channelID, 'content').then((message) => {
message.edit('new content');
});
It's kind of a style thing, that's just the way I format my code
I dont wanna see the rest of your "code"
if you are going to be autistic about the placement of a curly bracket, then you can actually eat some dick
well then don't look at this channel 
eat some dick
EAT:clap:SOME:clap:DICK
uh, okay. Are you guys done?
Yes it's good Cyber
please keep this relevant to development and not just being douchers.
π©βπ΄βπΊβπ¨βπβπͺβπ·βπΈβ
im done π You do you
ππΎ
if you keep it up, I'll mute the both of you. This seriously isn't the place for that, no matter who you are being stupid towards
I legit just said I was done
lol
k, then uh stop sending messages

but yeah, mayo that look gud for editing?
I'm trying to kinda do a hybrid of d.io/d.js with that
Atom is bae <3
how do i make my bot?
@amber glen ```
- Which Lib?
- Which Language
Discord.js, node.js
lol
have you done any development at all? or are you saying you are noob at just Discord bot dev?
ima noob at discord bot making
ah, ok
You ever made a single development project?
yes
Yep
so you have no programming knowledge?
go learn some basic js before you start working with d.js
^^^^
(Not being mean, its needed)
ok
Everyone that has a color has made a bot
I would get the basics down first.
but yeah, I agree. Getting the basics down is gud
what about them?
oh
ima start making a bot on the discord page
Very true
gimmie alink to discord page pls
but yeah
yea thx
This is where you should go if you wanna learn the actual library
I don't really have a good place for you to go to learn the basics of node. But Google is not a bad place.
i need link again my pc crashed
k
unless someone changed a link they sent
Nope, still up there.
its like 400 lightyears away from me
The link?
yea
I dont even have to scroll
oooookkk
codecademy can help too
@amber glen
my ass can help too
lul
prob more than codeacadamy would
Anyone think these are Asking for too Many Permissions, for a Reaction Based Menu System, Deleting its own messages, as well as peoples messages who did commands, the ability to Auto-Role, and Eventually Do Stuff on the Voice Channels.
Does anyone know how to disable commands being used in DMs?
I am currently having a crash problem with ..membercount in DMs.
If anyone knows, hit me up with a ping.
what lib
@jagged plume discord.js
@jagged plume Where do I exactly put that in?
@quaint oyster message event
@dense herald Thanks
also do u know what he means by <Message>? @quaint oyster
hi.
Does anyone have a kick command for discord.js?
With a reason
And with permission for the player to have "Kick"
@quaint oyster https://www.youtube.com/watch?v=mmvSlXCQIKo
Welcome back to my guide, helping you create a Discord Bot using the amazing Discord.js library I hope you follow along and create your very own bot! Continu...
Thanks
np
@tawny lava @earnest phoenix what do you guys think about an event that fires only when a new guild is created that you aren't in already? as of now the guild create event is fired with new and old alike
I would say, don't fire guildCreate event when the bot is starting up, only do it when it actually leaves or joins a guild.
guildCreate is a Discord event tho, that fires when ready to give the data to each server
when you create the initial socket connection, you get a skeleton of guild data and then guildCreate is fired per server to fill in the rest of the info
is this for your lib?
yee
it'd be nice for people that want to do anything when their bot is added to a new server
like cough cough post stats to dbl
aren't libs already doing that
Discord.io primarily has the events that Discord provides
and that's what I'm using for my bot that I have rn
guildCreate is also fired when a guild becomes available again
but you dont see bots repeating join messages, do you?
I don't know of a bot that is on d.io that has join messages
hence why I said d.io and nothing else, because I'm unsure of the other libs
I could very well look, but I asked 2 people their opinions and left out anything about other libs
@bitter sundial The join event for dbl fired again and I got pinged a lot by toxics because my bot posted it's join message lmao
pengu!eval require("discord.js").Util.fetchRecommendedShards(client.token).then(d => msg.reply(d))
lmao
@karmic parcel wym join messages. like a message when the bot joins a guild?
if so i do that on dio
has it sent a message when a guild comes back from being unavailable?
no on start before ready event. i put all guilds into an array so when they come back from being unavailable it doesn't send the join message again
i should show you it if you desire
@karmic parcel
naw, it's cool. I thought that was how someone would handle it
alright
thanks, though
@karmic parcel smh not tagging me for Dicksword development reeee
for the lib? it's private right now
ah
because it's in the initial stages and things aren't really too solid
how much you got done?
it successfully connects and maintains the heartbeat, listens for messages, able to send and edit messages
copies the initial data for servers into cache
now tag me
and dms
oh and I just set up the ping system today'
nice
and added ping data
alrighty
client.on('ready', async () =>
{
let message = await client.sendMessage('352851932273967114', 'Edit me harder')
message.edit('Async edit, too?');
});
lol
you could make the functions async and they'd still be a promise
but you can use either or, because async/await is built off of promises
yup
all you need to do is use async/await if you have a newer version, I think 7 and above
it supports either or
but why 6
because that's what I'm using now
@karmic parcel Not to sound rushed, but how long does it take for the bots to be approved/denied?
often depends on the queue size, and how many bots are offline in that list
Yeah, it'll vary. We try to test most if not all of the commands when we test as well
so it may take a little while
especially if the queue size is larger
hey again
Hi
how do I edit a message? (dont answer dis pls)
I have a server info command coded in discord.js
It doesnt seem to respond at all with no errors
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
const embed = new Discord.RichEmbed();
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
I have to remove that?
rip, didn't make the embed properly
i guess so
let us know if it fixes it
Nope
Didnt fix
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
const embed = new Discord.RichEmbed()
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
@karmic parcel @inner jewel
does the code there execute?
Should I test it with console.log? @inner jewel
yeah
and an embed won't post with empty fields values as well
so if there is an issue with any of those string templates and it doesn't resolve to anything, it won't send either
console.log("1")
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
console.log("2")
const embed = new Discord.RichEmbed()
console.log("3")
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
console.log("4")
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
This is how we do console.log? Right?
Just double checking
Cause nothing comes up on the console
you could just console.log the embed right after or before the message.channel.send
unless you configured the event handler wrong
"Cause nothing comes up on the console"
2 should print as well
the code isn't running
The code before does run
so 1 should print
is there a return?
//Support - gives you an invite link to the support server of the bot.
if (msg === prefix + 'SUPPORT') {
const embed = new Discord.RichEmbed()
.setColor('0x0099ff')
.setTitle(":mailbox_with_mail:")
.addField(`Support Server:`,`https://discord.gg/yNRwMjg`)
message.channel.send({embed});
}
//Serverinfo - Gives you the main server information on that specific server.
console.log("1")
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
console.log("2")
const embed = new Discord.RichEmbed()
console.log("3")
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
console.log("4")
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
The top is the one before the serverinfo command
And it works perfectly
No issues
you have msg as a variable in the top one, and you use message.content for the second one
is there something different with msg and message.content?
I have another command more above with message.content
Works fine
So it shouldnt cause any problems
I was just curious if there was a difference, like if you parsed it or something
are you testing that via PMs?
with the bot, or on a server
there may be something funky with a PM using that as well
Can you please do console.log(msg) and console.log(message)?
doesn't matter, but I'm sure not both variables work unless you went out of your way to define both
if the bot is on github I could look easier
It's not leaking if you're the one posting it.
^
//Support - gives you an invite link to the support server of the bot.
console.log("2")
if (msg === prefix + 'SUPPORT') {
const embed = new Discord.RichEmbed()
.setColor('0x0099ff')
.setTitle(":mailbox_with_mail:")
.addField(`Support Server:`,`https://discord.gg/yNRwMjg`)
message.channel.send({embed});
}
//Serverinfo - Gives you the main server information on that specific server.
console.log("1")
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
const embed = new Discord.RichEmbed()
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}
No console log
No errors
No nothing
What's msg?
inb4 just edited the file and the bot is running an older version
Then your issue is somewhere else, and we can't help without seeing more code tbh
k
@inner jewel @karmic parcel Figured out the issue looking at the code he posted on github. Basically, he didn't save it. serverinfo command wasn't in the code at all lmao
riiiip
kek

yup lol
.setDescription(``)```
paste a 'β'this there
Like that?
there's a zero width space inside the quotes
Confused
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
const embed = new Discord.RichEmbed()
.setTitle(`**__Main info for ${guild.name}__**`)
.setColor(`0x006699`)
.addField(`\n`,`\n`)
.addField(`Name:`,`${guild.name}`)
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Role Count:`,`${guild.roleCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
Add it for me please
uh what
I did save it
This was my error
So I am trying to figure out a way to add a space
Ive tried most things
You guys got anymore bright ideas?
anymore bright ideas
π
just a space counts as empty
you can have two zero width spaces with a regular space in the middle
did you try the zero width space? 
\u200D is the unicode for it
\u200D
idk if javascript can take 2 byte chars in a string like that
if (message.content.startsWith(prefix + 'serverinfo')) {
var guild = message.guild;
const embed = new Discord.RichEmbed()
.setTitle(`**__Main info for ${guild.name}__**`)
.setDescription('\u200D')
.setColor(`0x006699`)
.addField(`Name:`,`${guild.name}`)
.addField(`Member Count:`,`${guild.memberCount}`)
.addField(`Role Count:`,`${guild.roleCount}`)
.addField(`Server Location:`,`${guild.region}`)
message.channel.send({embed});
}```
Like that?
I am just a beginner at coding, don't expect me to click onto things fully.
Sorry for the inconvience π’
Testing now
@keen anvil @karmic parcel @inner jewel Thanks guys
You are a big help to me
<3
WHAT DO YOU NEED HELP WITH??????
CAN SOMEONE PLS HELP WITH THIS ISSUE I HAVEN'T EXPLAINED!!!!!!!
same
HALP MY BOT NOT WORKZ I DID ALL THE 2 YEAR OLD TUTORIAL FOR DED LIB SAID TO DO ITZ NOT LOGIUN


-botinfo Koya
Please include a bot mention
Can you teach me to tell the bot to say welcome (koya), to a new member? I'm trying to set up my server
-botinfo @runic bridge
I can tell you what you need, but you'll need to check the docs yourself to get the code
You'll need an image manipulation library like jimp, canvas, or gm.
You'll need to create an image on a blank png with the user's avatar + whatever text you want.
???
Profit
I think he means that he wants to setup koya not do something similar lol

delete it before you get banned 
he's about to get banned
@left wagon he wants help setting up the bot
dm'd me an invite too
people that want help always sound like they've got daddy issues
Where can I find a list of all the js guild. thingys?
I want to see how many things I can put for my serverinfo command
@quaint oyster Your library's docs
@earnest phoenix Where do I find those? lol
I am a beginner at coding
Don't know everything 100%
Okay thanks
@umbral pelican (ref: https://mantaro.ratelimited.today/28aac2.png)
not always, but that seems p accurate
tho most ppl asking for help on my guild are mostly chill about it
rather than "configure the bot for me thx"
but that happens too
Anyone know how to display the users role(s)?
I use discord.js
I have a userinfo command
And I put it something like
${guild.role.name}```
But it didnt quite work lol
see the docs
there's not a single role per guild
that explains everything you should need to know for this
discord.js.org that is, not the outdated ones :/
same
please save us and do ```(lang)
thanks
mate

so ```py
Yo @bitter sundial can you delete that Other PokeWorld Bot, for me?
the one that was declined.
Shouldnt of made it so far ahead of time.
decline = delete
Awesome thank you!
I tried to delete it myself @.@
But wasnt able too was like.
Damnit..
congrats on making the news btw @craggy robin
β€ Thanks
I thought the person pming me was Pulling my leg
legit, i played along. out of pure curiosity
went to sleep woke up and was like.... wtf... its REAL O_O
news?
was gonna say it's not really news but it kinda is isn't it? 
idk i've read the verge like once so
Yea it is
lmao
Welp
Casino prolly won't do it
Disnode maybe if a nice plugin comes along.
CAH could.
Hm
take a popular game and really well emulate it in discord
which is harder than it sounds
hence why that was on the verge
also use embeds
a lot
of embeds
In the process of porting to our new bot.
As a plugin
With our new libs and shit
Our old.bot was written in our old.lib it was too memory intensive
Since it could work over Kik, Discord, And twitch all at once using the one plugin
hellu
Who ever codes in discord py and wants a music player: https://gist.github.com/Joshwoo70/d8de658a7d7b1abbb9acf460627c0b0a
Discord.py Playlist.This also includes Aria2c Functionality.

Master or rewrite?
Rewrite.
Just looked at the code.
async run (msg, args) {
const user = args.user
Jimp.read(user.displayAvatarURL(), function(err, image) {
image.quality(100)
image.write("avatar.jpeg")
return msg.channel.send({file: "avatar.jpeg"})
})
}
}```
what I'm doing wrong here?
well
const user = msg.author;
@earnest phoenix
@earnest phoenix args is defined
is args an array of command args?
Jimp just errors me: Cannot read property .quality of undefined
smth like that
@earnest phoenix
well that won't work
gtg
he didn't ask if args was undefined. He was pointing out that args.user probably isn't a thing
how do I login in Discord.Bat?
...
bb
How does sharding work on eris? Can't find anything in the docs and I'm going to need to shard soon, if anyone can help me.
@jagged plume in the client constructor options maxShards https://abal.moe/Eris/docs/Client
Eris, a NodeJS Discord library
Is that all i change?
depends
yes, that's all that needs changed. It's a godsend @jagged plume
wow
thanks
another question- i'm assuming it's all in one process and doesn't split itself?
looks like you haven't used the async keyword?
yup ^
How do I shard @keen anvil?
kek
You get good
wew
would anyone know how to stream audio from twitch with js?
some have said that ffmpeg works but idk how
ah ill take a look.
gt
Ω
-owner @raven monolith
good job
edge lulululul
@karmic parcel Got another webhook for ya https://streamtip.com/api#ws
say no more, fam
m
Anybody got errors similar to this on startup of their bot? Makes my bot not launch
@wanton plover probably because of the new channel categories
Ask in dapi if your lib has gotten a fix yet
hmm it did, time to try the snapshot version.
Updated to latest JDA and it helped. Thanks @surreal peak
no problem @wanton plover
yea depends on the lib
It doesn't do with JS
d.py did was updated fast
literally crashed all my bots
Other then the disco and js ones
will channel categories break older bots?
a friend of mine said they would but it doesn't look like that's the case...
well i guess that kinda answers my own question i gues
im tired af
no
I was wondering, How do I randomize pictures in richEmbeds on Discord.js 
you set it to a different image
RIP:
{
"error": "Required parameter server_count or shards missing"
}```
It hates me because I send server_count in both :/
-bots @strange lintel
@uneven vapor 
-botinfo @uneven vapor
321640172225691648
Chen
1460
A great bot for anime based servers, with osu commands, anime stuffs, currency, ranks, and more!
34
171 Servers
@strange lintel 
@steel bolt 
pls
Alright
Why postman?
Show what youre posting
Because its not working in code either
Can you show the code you have right now?
Show exactly what youre postinf
That's form-data
Yeah
Change content-type to application/json
You need it as a header
and type the data in as a raw body
^^^
Also, don't do it through postman.
^^^^^
;/
postman works it's just a bit weird.
The same one I posted.
@faint cedar multipart/form-data is not the same thing as application/json
@fossil oxide whats 522? discordbots.org statistics returned 522 for {"server_count": 11508}
thonk
522 is timeout
ye
mhm
π
What do you want your command syntax to look like?
was supposed to break the arguments to "tpcaption" (the top caption) and "btcaption" for the bottom
so something like
$generate top line | bottom line
$generate @user top line | bottom line
where the avatar of @user is used as the param of &alt?
yeah that
And if no user is mentioned, the avatar is the authors
okay so
this is good
first of all, this won't work
const user = message.mentions.users.first() || message.author;
if there is no mention, users will be undefined and it'll throw an error
r>ev f
can't use my bot here smh
msg.mentions.users.first() || message.author
message is not defined
msg.mentions.users.first() || msg.author
ClientUser {
id: '284122164582416385',
username: 'Aetheryx',
discriminator: '2222',
avatar: '27e5700872ea689b78bb1384012cafb7',
bot: false,
lastMessageID: '356760954853392385',
lastMessage: [Object],
verified: true,
localPresence: [Object],
_typing: Map {},
friends: [Object],
blocked: [Object],
notes: [Object],
premium: false,
mfaEnabled: true,
mobile: true,
settings: [Object],
guildSettings: [Object] }
oh, nvm
okay, that's fine
exports.run = async (bot, message, args) => {
const user = message.mentions.users.first() || message.author;
args = args.join(' ').replace(user.toString(), '').split(' | ');
const tpcaption = args[0];
const btcaption = args[1];
message.channel.send(`https://memegen.link/custom/${tpcaption}/${btcaption}.jpg?alt=${user.displayAvatarURL}`)
}
Something like that
thanks
spoonfeed
you can also get rid of the tpcaption/btcaption altogether
Hey, how can I invite my bot into this server for testing purposes if i can?
apply
add it to the bot list on the website
it takes time
i think
and we're not really a sandbox, for testing I would suggest you use your own server
Yeah sure thank you
I understand, I want to test my bot with the community
Is there any limitations on what my bot can do such as kick / ban? For record as of today my bot only tags people and sends / views messages.
@uncut slate it only works if the user runs the command, not working with mentions
Your bot can do anything that isn't considered API abuse
Awesome.
lemme see
Come again?
@raven comet Your bot can do anything that doesn't violate Discord's API terms of service, or abuse it
@low niche it's working fine on my end
it returns this ( without captions)
https://cdn.discordapp.com/avatars/356721130586898432/dfabbb941aa48513291624da0db4224c.png?size=2048
.test top | bottom
.test @low niche top | bottom
top: @low niche top
bot:bottom
url:https://cdn.discordapp.com/avatars/255114091360681986/7b35a0c8a9e2651010454ce9dbf4ec93.png?size=2048
exports.run = async function (Elga, msg, args) {
const user = msg.mentions.users.first() || msg.author;
args = args.join(' ').replace(user.toString(), '').split(' | ');
const tpcaption = args[0];
const btcaption = args[1];
msg.channel.send(`top: ${tpcaption}\nbot:${btcaption}\nurl:${user.displayAvatarURL}`)
};
How would i save a string from a user permanently
would I have to use a database software?
in discord.js
Yes
Hmm
Any way to save it to a JSON file or something similiar without having to use a database.
Yes, you can save an object to a JSON file as a "database" but it's kind of retarded
let alone horrible performance and reliability (fs.writeFile can and will fuck up often), using an actual database is probably easier than fucking with writing objects to json
If you don't want to get into a "complicated" db like SQL or Rethink, use http://npmjs.org/package/djs-collection-persistent
I would still recommend using a proper veteran database but ^ does the job and is super, super simple
Ok, thank you mate π
:^)
How can I make a cooldown for my commands & chat?
@supple shale mostly answered you
save unix time of a command, compare the current time against that saved time, just read his explanation
i need help for hyberbot
do the -botinfo command and mention the bot you need help with after "-botinfo" (Ex. -botinfo @cosmic shoal) then ask the owners of the bot for help
@uncut slate the code you sent me yesterday only works if you do this ppmemegen [mention]top | bottom instead of ppmemegen [mention] top | bottom
can you send it again?
exports.run = async (bot, message, args) => {
const user = message.mentions.users.first() || message.author;
args = args.join(' ').replace(user.toString(), '').split(' | ');
const top = args[0];
const bottom = args[1];
message.channel.send(`https://memegen.link/custom/${top}/${bottom}.jpg?alt=${user.displayAvatarURL}`)
}
@neon pasture just make a blocklist
give me a sec, i might have found the problem
blocklist for the level up messages?
I'm in class RN I'll take a look later if you don't figure it out
You tagged me?
setTimeOut(function() {
//code happen after 5 sec
}, 5000)
thonk
o the cooldown
TimeOut?
π yeah
but it's not a cooldown
It's just slowing the message 5 secs
Anyone wanna tell me how to make anti ad thing
XDDDD
random super ecchi image
i have my own already
random ecchi from pixiv
-$pixiv
some time very ecchi and some time normal
Having a bit of an issue with trying to post my server count to the api. I'm not very familiar with these types of things. The only other api I have posted to was https://discordlist.net/'s api. Upon trying to post my servercount I encounter this error.
<CIMultiDictProxy('Date': 'Tue, 12 Sep 2017 13:57:30 GMT', 'Content-Type': 'application/json; charset=utf-8', 'Content-Length': '24', 'Connection': 'keep-alive', 'Set-Cookie': '__cfduid=d6df905d6590fa800ad77f724f156cb6d1505224650; expires=Wed, 12-Sep-18 13:57:30 GMT; path=/; domain=.discordbots.org; HttpOnly', 'X-Powered-By': 'Express', 'Access-Control-Allow-Origin': '*', 'Etag': 'W/"18-XPDV80vbMk4yY1/PADG4jYM4rSI"', 'Strict-Transport-Security': 'max-age=15552000; includeSubDomains; preload', 'X-Content-Type-Options': 'nosniff', 'Server': 'cloudflare-nginx', 'Cf-Ray': '39d3604eadb258cd-DFW')>```
The current code I am using is this...
```py
stats = {
"server_count": len(bot.servers),
"shard_id": 0,
"shard_count": 3
}
url = "https://discordbots.org/api/bots/226132382846156800/stats"
resp = await aiohttp.post(url, data=stats)
resp.close()```
you are missing a token
Fml, thanks.
@earnest phoenix you need the token
I have my token now.
Awesome, thanks. I got it now.
no Authorization header
@quartz gulch
still no header
no it doesn't
it only gives unauthorized if the header is missing
in my browser
or has an invalid token
for all we know it was changed
@bitter sundial
i am the owner
@bitter sundial
;v
and it returns no
wait
fixed it
how can i create a bot @lone obsidian
no
You can make bots with basically no knowledge of programming now
But if you want to seriously make one
You need to learn a language
And use that along with a discord API library
if you still want discordblocks, it's here: https://moustacheminer.com/discord-blocks/#https://moustacheminer.com/discord-blocks/examples/ultra/project.xml
I suggest starting with discord.js and node.js
But others may suggest discord.py and python
banne 
ok thankyou @trim steppe
k
k
k
so, I'm trying to make a text command, allows you to send a text to someone (through twilio)
wew twilio
and I'm having issues splitting the args
or
getting the right one
see their youtube vids
they explain
@earnest phoenix what lang
wow
lol
I just fixed it
sigh
I had a total retard moment
forgot that arrays start at 0
i want to kick myself while dying

holy shit sudomoose
I'm never talking to you ever again
lol
I haven't coded in a few weeks
lmao
wew
@earnest phoenix My args thing: js const args = msg.content.split(" ");
yeah
let content = [message.guild.roles.map(role => `**${role.name}**\n${role.id}\n\n`).join("")].sort(role => role.position)
How do you sort roles by Role Position?
I believe the sort fuction gives you role a and role b and you have to compare those two
you are sorting after mapping. role is a string now and has no position prooerty
do the sort first, then map
^
Ok
It still didn't quite work. Some of them are correct some are just randomly placed
@earnest phoenix
msg.guild.roles.sort((a, b) => b.position - a.position)
Ok
Appreciate the help Aeth. I didn't exactly know how Sort worked I had never used it
Lol I didn't know Google knew that shit π
let sortedRoles = [];
for(let role of message.guild.roles.values()) {
sortedRoles[role.position] = role;
}
let content = "";
for(let role of sortedRoles) {
content +=`**${role.name}**\n${role.id}\n\n`
}
content.trim("\n\n");
My other dev said this is faster in terms of ms
Post your server count to our API
I have no idea how. Lol
So pretty much while the bot is on that'll constantly update and post stats?
you put that code in your ready, guild join and guild leave events
What one would be best
any js one..?
I know I don't want to get one if there is one better than it
I'm using discord.js aswell, and the counter is working just fine. So you can just use discord.js
The only one that has Discord.js is the Sharding one
const snekfetch = require('snekfetch')
const dbotstoken = "YOUR TOKEN"
client.shard.fetchClientValues('guilds.size').then(result => {
const guildsizes = result.reduce((prev, val) => prev + val, 0)
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', dbotstoken)
.send({"server_count": guildsizes})
.then(() => console.log(`dbotsstats updated successfully`))
.catch(err => console.error(err))
})
use any js one*
But this is the only discord.js. So any Javascript. But I rather not take the chances
client.shard.fetchClientValues('guilds.size').then(result => {
const guildsizes = result.reduce((prev, val) => prev + val, 0)
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', dbotstoken)
.send({"server_count": guildsizes})
.then(() => console.log(`dbotsstats updated successfully`))
.catch(err => console.error(err))
})
So put this in Ready, GuildCreate and GuildDelete?
But you using now a sharded one
if you're not sharded that won't work, otherwise yes
Ugh I won't bother with the API then
thonk
I'm using this
lol
dblclient.postServerStats({serverCount: "Your library's method of getting guilds size/count"}).then((stats) => {
console.log("Dbl server count updated DBL isnt down dont spam oliy");
}).catch(e => console.log(`DBL down Spam Oliy#0330 ${e}`));
This works then?
Error: SQLITE_BUSY: database is locked. Why π¦
let dblclient = new dbl.Client({
token: "Your Discord Bot List token you get from https://discordbots.org/api/docs",
id: "Your bot user id make sure this is your bot or it wont work"
});
Shouldn't the let be const?
@neon pasture you have the databse open somewhere else
"value" required in setHeader("Authorization", value)
What does this mean.
How do I setup the Token?
I'm so lost
I already have it
then put it in..?
I put it in but it still says that
snekfetch.post(`https://discordbots.org/api/bots/${client.user.id}/stats`)
.set('Authorization', <yourDbotsToken>)
.send({"server_count": client.guild.size})
.then(() => console.log(`dbotsstats updated successfully`))
.catch(err => console.error(err))
})
this should owrk
make sure you're putting the token in quotes 
"Authorization", token?
ye
Ok cool
let dblclient = new dbl.Client({
token: "Authorization", "token"
id: "305203825931845632"
});
Apparantely it doesn't like "id:"
I added the "," at the end of "token" but it didn't like that either
wait what are you doing
The API
if you are using that then you just put the token in
no thats a wrapper, but anyway
So I don't need the ID?
id?
no
nooooooo
The example had it 
"Authorization", "token" => "token"
not hard
?
the best js example is at the very top of the channel
Ok I'll use that

