#development
1 messages · Page 413 of 1
(maybe can i recommend you my lib? dblapi) @lilac owl
its not the Discord library that has the problem
@verbal night off topic, he has a problem with posting DBL stats
i'm gonna update the github now pip install dblapi
Might as well just do it that way
np
Can u make a game bot
game bot 
@carmine vapor more specific please?
yes you can
you're pretty limited on what you can actually do though xD
Ok
okay i take that back, you're not as limited as i originally thought
you just have to be incredibly creative
^
buuut you're still limited
well you can't really create a 3rd person shooter but yes
@abstract crystal I mean, you could create a top down shooter of some sort using reactions however
or a dungeon crawler, hell even via commands 🤷
you're still limited with what you're able to do with that severely however
i think this is enough for #development xd
is anyone else having issues with the api? mores specifically, finding out if a user has voted?
I was earlier, however it was a problem with my modified module
Are you using webhooks or API requests
Some of them are depreciated.. GetVotersById, and the other one similar dont work properly
sqlite if it's not big
u can try using json files instead of db
just don't use json to store data
why not?
I really need help. I have an approved bot here and I need a really good person to help me with a warn, clear specific warn, and warning command for my bot
I mean for storing custom prefixes, commands from servers etc
it's json, ment for storing static data in files, not dynamic
whoa why are you so agressive
Lol
Anyone know warn commands?
I need a coder for a warn, clear specific warn, and show warnings command
json for static data
json can corrupt easily like everyone says
^
yup
Ofc ull need a db. Then send queries based on what u want to accomplish
Like a wild boar
Yeh xml better for storage
xml 🤢
😂
lmao
@earnest phoenix if you are using sqlite do better-sqlite3
true tho
It is faster and asynchronous
ini files are better storage than xml/json
^
I only use MySql as a db

lol
I store my data in hastebin
i use json to store my 3 keys/tokens, and prefix, and random playing messages
Id rather hard code all information, it takes longer.. but no corruption or connection issues
json is fine for config
I also use JSON for most tokens etc and an actual database for configuration.
there are tons of options use anything u like
if(!message.author.id === "395248246529851405") message.channel.send("You aren't my owner.");
message.channel.send("My owner requested me to leave this server. Therefor I must leave. Bye @everyone !");
message.guild.leave();
```would that work?
(Discord.js)
no
message.channel.send("My owner requested me to leave this server. Therefor I must leave. Bye @everyone !");
message.guild.leave();```
add a return to stop the bot from continuting
^^
does it ping actually?
How can i let the bot react on his own messages
it only add reactions on my command
i'm using discord.net.
Isn't it funny how sometimes you can just google the error and then it tells you a fix
need a let me google that for you bot 
Hey @tidal ridge

Bot's don't work here
o
Wrong place to do them anyways => testing channels
Trixter I am using glitch, so I can't do that...
whats a dbl token?
a token
where can i get it?
serving at [4mhttp://2f74fab75618/:3000[0m, [4mhttp://172.17.0.81/:3000[0m, [4mhttp://127.0.0.1/:3000[0m
My bot won't turn on
^
um wat https://vgy.me/xlQbX8.png
how do i get the link of this
without the [""]
glitch
2 seperate processes pls
so people using glitch abuse that by making requests to themselves once in a while
so i'm trying to make a music bot with ytdl-core then i heard that ytdl-core stopped working, is there a alternative to ytdl-core? btw this is my code https://hastebin.com/umewiviyoy.php
oh he's back
lavalink would be an alternative
i heard of lavalink i just can't figure out how to use it do you run it seperatly
yes
so you run the discord bot then lavalink?
@acoustic juniper you need an instance of lavalink running
lavalink should be online first
^
using npm

something like npm install lavalink maybe
lavalink is java
if ur using discord.js use https://npmjs.com/package/discord.js-lavalink
there are language specific libs in that readme
but has an API which other languages can use
^
You can also program your own ytdl huehhueheujeheuheh
pls
@elder rapids how do you program your own
@elder rapids no u
But who wants to spend the time doing cipher decodes and such
me
oh boi
It's since been abandoned
how do you do that?
No longer used
I believe rule 7b applies here 
kinda
i mean i have a shit book i used to try to learn
im working on one but im pretty bad xD
Lavalink.go here i come
@brave bolt You could give them an idea on what to do and they could go from there xD
We already have 
can you just direct me to somewhere i could learn or something
I'm curious why in that language @topaz fjord :p
@verbal night cus no wrapper yet
i recoomend you learn the basics through reading
¯_(ツ)_/¯
^this can help
@topaz fjord that may not be a good idea...
heck i dont know shit either
why
because go is a developmental programming language
and
ah makes sense, also again @topaz fjord have fun trying to make a wrapper for my open source project xD
and?
who says i cant use it
they haven't finished it much
@verbal night i stuggle my way through it
@topaz fjord 😛 I'm sure once you finish with a wrapper id be able to find ways to make it easier on you and others 😛
isnt that what makes programming a challenge?
@elder rapids where did you learn to make a alternative for ytdl
he copied and pasted from stackoverflow
stackoverflow is pretty good

lol
Actually I read a lot of ytdl core code
Then translated it to c#
Ofc learning and researching in the process
It's really that simple
wow thats... amazing
xD
stackoverflow is gud
yup
wut does this have to do with the subject
idk
then why paste the link
idk
great answer
ikr
its sarcastic but k

idk == very telling and good answer
i love how this is a bunch of professional developers all using very unprofessional acronyms and such
who says we need to speak proper english
not a lot of people here are professionals per say
We're professional?
english is hard
Since when
kthx
every one @topaz fjord
proffesionals?
yes I am very """professional"""
@elder rapids yes we are professional
are you telling me what to do
We use acronyms other developers understand 
I'm as far from professional as you can get
lol
im utter crappy programmer
hello i would like to ask you what a professiona; is
^
i qualify for helmet tier
I'll consider myself an average developer
I suppose earning a living off writing code makes you a pro?
yup

I consider my self a unprofessional developer
im heading back into it after failing badly xD
lol
@acoustic juniper How does one rule out the other?
who says im earning money off my code
^
^
Pro devs are also just humans. And lazy 👀
^
lol

hahahahahahahahahaha I am laughing out loud
im laughing out loud cause im getting told im wrong
oof
and they disappeared
:p
!help
is there a tutorial or something that explains how to create a version of ytdl?
^
public class YTDL {
public static void main(String[] args) {
Runtime.getRuntime().exec("wget " + args[0]);
}
}
@glossy sand that won't work ytdl stopped working
this guy man 
lmfao
no thats js
@inner jewel No java is way different
cmp java, javascript
jne CRASH
@acoustic juniper what nines sent isnt js

let java = 'javascript';
java ^ javascript == 0 right @glossy sand

\delta_{{\rm java}\,{\rm javascript}} = 1
:p
hello my fellow developers
pr0fessionals
well thank you
Hey guys, I wonder if there is any info about how to best scale up a bot. We have a small bot that now just passed 2500 servers, so we had to enable sharding. We are now wondering how bigger bots handle that. For now we can do it manually, but once you have a couple of shards then updating will become very time consuming. Is there any ansible/kubernetes/AWS deployment strategy to handle auto scaling, without coding anything from scratch?
Also, do you guys mostly use small servers (like 1, 2 shards per server), or do you get big ones with 64/128GB RAM?
are you looking for a way to automatically create new shards without needing to update the bot
or are you looking for something that automatically updates the bot, say, when you push to github
@cosmic cipher
Discord only allowed my bot on 100 servers.. lucky. Havent looked into sharing, kinda killed my motivation after i hit 200 servers my 2nd day and got rate limited
o.o
@mental solstice How did you get rate limited? I mean why did discord care that you were on 100 servers?
Idk i emailed them and i was limited to 100 servers and i needed to look into shards
Ohh i just reread it.. they sent me a 2 part email
An end point only gets 100 servers.. and i should look into sharding
@languid dragon A combination of both. Deploying after a github commit wouldn't be that hard, but I'm more looking for a guide/some experiences of people who went through the process. I mean if the current rate of growing continues we should hit 5k servers in about 3 weeks. In the best case, if the bot gets really popular, you have to create new shards every other day, which means you have to restart them all. And because we're definitely not the first ones with that problem, I was curious if there already exists some kind of repo or guide how to handle that (ideally that would include a feature for starting the bot with the new shards before shutting down the old one, to reduce downtime, etc.)
well at the moment i've been working on a sharding utility but it's been purely for my bot only, however with the github automatic update thing it would be fine you'd just need to make sure your bot has safety checks and that if you update something that doesn't work, it wont break
;/ev components.app.newShard().shards.length
My code usually doesn't have any errors 🙃
do you develop your bot on windows?
I have a mac but my friend is working on windows I think
Are you planning on open sourcing your sharding utility?
im assuming your bot is on a linux machine
yes
yeah,
some things work on windows and/or mac but work differently on linux, i've come accross that a lot
what language/lib are you using
We use yamdbf which is based on discord.js
what's the differences (nvm i googled it)
yamdbf is basically just a wrapper around discord.js with some additional featuers (typescript + guild storage)
yeah
i may be willing to open source my bot, it's still heavily in the development stages and a lot of it isn't up to acceptable standards at the moment
so it'd be a while before i do (open source it), im still having a few issues with my own sharding utility
Ok. Yeah our bot isn't open source yet as well for the same reason 😛
understandable
^
I mean for now we should be good, it was just weird to not find much information about sharding in general
yeah especially with d.js i think they want you to strictly use their sharder
¯_(ツ)_/¯
I still wonder if it's better to have many small VPSs or a one/a couple big ones
Well but their sharder only works on one machine
Which is not really feasable in most cases I guess?
well as long as you have good internet, having the bot on one server isn't bad
@fair grail is on a large server of it's own
How many servers is it on?
-botinfo @fair grail
270904126974590976
Dank Memer
6539
Memes out the butt, tons of image generation, soundboard/mememusic, and a super fun and sassy economy system.
Eris
pls
105947
211344 Servers
@keen anvil

@karmic parcel 
@uncut slate

Invite | Website | GitHub | Support Server
that many
Wow
until you have something like well above 1 million users, i dont think splitting the load over different servers would be necessary
That's like 80 shards on one server
4
4
4
4
;/ev -g -j 2+2
16
What is the 4? Shard 1 of 4?
;/ev components.app.newShard().shards.length
5
;/ping
for some reason i can't postspawn shards (yet)
Well I'm looking forward to take a look at your bot once its open source
Postspawn?
ye
what do you mean by that?
;/ev components.app.shards.length
1
;/ev components.app.newShard()
Shardcount now at 2, spawned new shard: 1
;/ev components.app.shards.length
So when you spawn a new shard, does it also restart all the other ones?
I mean it has to pretty much
Or can you change that on the fly?
testing that rn
The problem is that our bot tracks invites/memberAdds, so it is pretty important that the bot is not down for a long period of time. So if we have to update all shards, we would have to start the new ones before we shut off the old ones. If you can change shards on the fly that would actually be amazing because you can just add one more and update the others...

ive never looked into sharding, but discord.py suppose autosharding correct?
1
;/ev components.app.newShard()
Shardcount now at 2, spawned new shard: 2
;/ev components.app.shards.length
2

90
93
ezpz
noice
just discovered some pretty cool shit my dude
Removing all shards and rebirthing...
Shard 0 destroyed...
Shard 0 birthed.
Shard 1 destroyed...
Shard 1 birthed.
No shard to destroy => Creating a new one...
Shard 2 birthed.
3 birthed shards.
Nice
ok now it actually works properly and doesn't double post anymore 
yes
I see bots you can subscribe to and they auto post commands daily at a specific time, how do you go about doing that?
save channel or channel id, and run specific function at specified time
kinda run a callback of an Timeout at the given time
resolve channel by saved id and then save
what's the syntax for setting client options in discord.js?

oh wait nvm
think i got it
obobo
read the docs 

lol 
Does anyone know how to get the bot discrim and username in eris
Eris doesn't have documentation?
yes it does?
So why is he asking so pointless thing here?
When he can search it in documentation lmao
People dunno how to read documentation, they want only spoon feed
Same
for anyone who knows how to use sequelize, could you help me try to get a better understanding of what sequelize.sync() does?
i want to try and achieve a system where if a user is missing data from a column in a table (ie, the data in the table is null because that user hasn't had data put there) i can automatically set that user's column to the default value that i defined for that column in my model file, is this possible
So basically a fallback for missing data?
yeah essentially
yes it is blake
so basecally
.sync() syncs your model with your database
and when you now have models with default values
you can use findOrCreate() method to find a user by id and if not present, create one with default values
i did that before using a framework

or if you have already created the user instance then there was a method to reset colums to default value
idk how that was called tho
yeah in my case the user instance already exists, its just 1 or 2 columns that are missing values and i want to set them to default
but yeah thanks for the help
the port is in use by another process
thx
If you fetch messages, you are caching them into the bot, correct?
yes
Yes
Okay. Thank you
Why does my bot not have permission to message in #265156322012561408 ?
discord.errors.Forbidden: FORBIDDEN (status code: 403): Missing Permissions
its probs muted
How do I know
tag it and see if its got the muted tag
what do you mean by muted tag
whats your bot?
@noble fossil
it's muted
ah yeah ok
its got the muted role
your code is broken because its muted
Yeah but I mean its not my code that is causing the problem
if you see what I mean
I am about to fix the non-handling of the error
if(message.author.bot) return;
^
can we use multiple bot.on('message') things, or will this break things?
if you wait for one message I guess it is fine
hooking up multiple listeners could be useful if you want to do things in parallel
@uncut slate no u
k
i will waste ur memory
Is there ever a possibility that a channels ID will change?
i doubt it
I have a test server and that seems to have happened, but I might have deleted & remade the channel a while ago, can't remember
probably the latter
channels ids change if u delete
and recreate
if u edit the channel it wont change id
no ids will ever change
unless someone with discord's database access wants to troll
@earnest phoenix ok, can you please like
EXPLAIN
not use the github web ui to create files
**
.
send a screenshot of your LOCAL bot directory
not on github, the bot files on your machine
yes
@solid cliff have I done life right?
yes
close enough
does it hide my token?
now gitpull it back into your bot directory and see if git will stage your config
can my bot be hosted on Heroku?
o no
yes, but it sucks
what
now gitpull it back into your bot directory and see if git will stage your config
discord.js-commando
try Glitch.com
do you know how git works at all?
i do not understand nerd
i do
FUCK
if were nerds why are u coding 
i understand javascript
u got mac.window
i understand memes
this is off topic
I got windows boi
if you want to talk about random shit move to #memes-and-media
inb4 he doesn't even have git installed
@solid cliff so this will hide my token?
it will hide ur token if ur token is in config.js
lol
js !== json
idfk, pull it back into your bot directory and see if git ignores your config file
you mean
js === json
no
offtopic lol
ok so are we done
ok we need to know whether or not you even know what you're doing
git status
@earnest phoenix what does this do?
can you be any more specific?
it also reads the files of the git thingy mabobg
use that
it does (use "git add <file>..." to include in what will be committed) and then a bunch of file names
I got 20m
k
im using https://scotch.io/tutorials/how-to-deploy-a-node-js-app-to-heroku kthxbye
then you don't need a fucking config file, just use ENV vars
and suck a lot [for bots]
use a vps
also just saying
england is cool
ur token is on github
you can check commit history
it shouldn't be
and that's ok, we just expect you to learn somewhat quickly, and not fucking spam #development
commit history shows ur token kek
yes i do
"do you english"
(node:12804) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided. at WebSocketConnection.client.ws.connection.once.event (C:\Users\Tom\node_modules\discord.js\src\client\ClientManager.js:47:41) at Object.onceWrapper (events.js:273:13) at WebSocketConnection.emit (events.js:182:13) at WebSocketConnection.onClose (C:\Users\Tom\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:390:10) at WebSocket.onClose (C:\Users\Tom\node_modules\ws\lib\event-target.js:124:16) at WebSocket.emit (events.js:182:13) at _receiver.cleanup (C:\Users\Tom\node_modules\ws\lib\websocket.js:220:12) at Receiver.cleanup (C:\Users\Tom\node_modules\ws\lib\receiver.js:535:15) at WebSocket.finalize (C:\Users\Tom\node_modules\ws\lib\websocket.js:206:20) at TLSSocket.emit (events.js:187:15) (node:12804) 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:12804) [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.
what does this mean
your token is invalid
cwap
@earnest phoenix i thought u did ur bot in python
@solid cliff fite him
weeb
Not here pls
No not in #development

Joke or not, doesn't belong in here
Does anyone know how i should code to make a randomly generated response from 1-100
well i would add these 100 responses in an array and then use something like Math.random() * array.length to get an random index and then acess the index of that array
👀
thanks

got a ping in this channel? 🤔
Probably a ghost ping
wazaaaaa
hey @everyone
I have an object array like this:
"messages":{"407711330943107072":21,"383404775326351360":119,"382504483483025410":586,"445408817233002506":1,"444651257760710656":8,"433368385082884106":2,"419945483704729609":1,"444667571858309121":2}
Those are channel-ids and their message count. I was wondering how I could order them from highest to lowest and get their position in an array. Does any1 know how this is possible?
( I ❤ fake pings 😉 )
.sort
ik, but it doesn't work with things inside object arrays
or I can't find out how to do it.
Could you show me a snippet of code for that @elder rapids
sort() works fine you just need a custom compare function
@sterile thistle RichEmbed?
Either or
just loop through the array and .addField for each value
var myArray = [1, 2, 3]
var embed = new RichEmbed()
.EmbedFormattingStuff();
myArray.forEach(b => {
embed.addField(b, b);
});
My JS isn't that good, and you'll probably need to modify this to fit your needs
OHH
DRFINE .EXE HAS STOPPED RESPONDING
I just did addfield
I’m stup
Stupid
if you're using raw embeds you'd myEmbed.fields.push({ name: 'x', value: 'y' }) instead of the addField call
They are both useful

¿
@elder rapids how would I do that?
can anyone teach me how to make my biot auto give new joiners a roleÉ
in what language?
discord.js
this is just for one guild?
client.on("guildMemberAdd", u => {
u.addRole("ID of the role you want to add");
});
insert that into your existing bot code
to add a member role what would the code look like( ia m bran new to bot makeing)
I directly gave you code to insert into your bot, you should be able to figure out the rest
ok à
what do i put where the guildmemberadd is. leave it or changeÉ
what is the role idÉ
how do i check what servers my bot has been added to if my bot was offline during that period? tag me with answer please
you can't @tepid hedge
k
unless you start saving server ids to a file
Why would you want to check what servers your bot was added to while offline
^
They probably kicked the bot by then tbh 
sigh you'll eventually get to a point where you won't care
yeah i know
As it'll just be 100 guilds a second spamming
the moment my bot was authorized 100 notifications turned on
@shy verge join/leave messages
i know
don't even use 🅱ython
use 🅱#
apparently go is speedy boi
How can a language bully you
Because
You're bullying yourself then
k
> 
discord.asm when?
anyone know what the line of code to stop a bot from replying to a command in python.
if (message.author.bot) return```
this is for discord.js so what is it for python
lol same
ctx.message.author.bot?
@mental willow so ur using python, js and java?
o
lol
@austere meadow How do I get my dblToken?
on ur bots edit page
my bot client id?
its the token when you click edit bot on https://discordbots.org/me
go to discordbots.org/api, click "My Bots" and click the bot application you want the token for
thats another way
API Key?
@native narwhal```Java
int mb = 1024 * 1024;
long used = Runtime.getRuntime().totalMemory() - Runtime.getRuntime().freeMemory();
long usedMB = used / mb;
so i would say my bot itself uses 7 mb 👀
👀
What does the system you're on say the application is using
hard to say since i build inside of IntelliJ atm but i would say 34mb
🤔
@restive silo This is running on a bot with 1 server that has like 5 members 👀 (The only thing existent in this application is the code to start the bot)
yea well its not JDA taking that much RAM as i said its the JVM overhaul around your Java application
could you eval what i sent?
Not sure why there are two Java applications I closed one of them and the bot continued running so let's say it only used 70
@restive silo tf urs is 7
mine is 256
@topaz fjord @restive silo C# > Java 
Ew
Can i get help in developing my bot here?
Yeah but not spoon fed
I recommend watching some youtube tutorials first or learning the language
Oh thanks for the big suggestion
Hello.
I am looking to add some new commands to my bot and I don’t know what to add.
Wait nvm
I know what to do.
Fix the say command.
Idk why I have the say command.
When I have embed but yeah.
When ever I use the say command the bot also says say.
For example if I say .M>say Hi.
The bot will say: say Hi.
(I used the period before M> because I didn’t want to trigger the command.
)
unrelated but how you gonna trigger the command if its in the middle of your sentence
Probably search for a substring of the message
I guess what he does is:
.M> is the prefix and gets stripped out of the message. But he forgets to also remove the command say.
Without sharing code I've no idea what actually happens tho.
hi
-bots
@elder surge 
@indigo juniper 
lol no u
-bots
Me?
thewsomeguy is
This user has no bots
K savitar
-bots
@earnest tiger
cool
When I use the command it says the command name too.
@earnest phoenix what error
oh
uh idfk
E.G.: M>say hi
Say hi
oh
That is what will happen.
Lel
just slice or trim it
@tame falcon
Nah too much bots have the prefix >
it’s to do with your args @earnest phoenix
2
so add a slice and join
How?
Just how much can a discord.js bot handle without lagging!
@quasi forge use eris lol
It doesn't lag
I am now going to add economy features to my bot
just google it
let's see if it lags then
once you reach 100 it’ll start dying probably 😂
lol
We'll see about that
I will just enter big servers and start advertising if they have advertisment channel
do you have music?
no
ok
I kept failing at it for like 19 times
which one?
dbl
lol
this server
it is here
o
can't u see I am a bot dev
oh 😂😂
I have an approved bot here
i’m dumb
xD
Oh this is development chat fucking kill myself
Facebook live it @earnest phoenix
My bot is almost to 100 servers and it is already dead.
@toxic oracle ok
ripp
Actually.
It was at 90 servers yesterday.
ok
Lel
Now it is at 94
With 26k users using the bot.
ok
-bots @earnest phoenix
@elder surge 
@indigo juniper 
Hey u are Pancake's dev!
I never knew my bot went up 1k in one hour.
I didn't even fucking observe!
well i don’t dev it anymore but i own it still xD
1k users?
@earnest phoenix
27k
You mostly get members if your bot is famous
well you said went up 1k
xD
Know me?
it’s not accurate
IKR
Servers
I dont care my server has less then 10 people
And i have more then 20 bots in it
just making a good bot 😂 you’ll get servers from that (but yea servers)
Well my bots development has become slow.
same lol
Before it was a team of 3 working on it.
Same
I had a famous bot with 2000 servers
I get all my errors when I code on phone.




