#development
1 messages ยท Page 814 of 1
just go away if you dont want to help
@quartz kindle It wasn't found
i just asked how to make a js ex. kick.js i dont want to put it in Server.js
do you understand?
@golden condor are you sure one of your packages uses a package called integer? And why do you need to know which one?
That's what it says in heroku
I said to go make a command handler

It won't work with integer
Where does it say that?
isn't this have something to do with node-gyp not being able to be installed
so it can't install integer
My friend told me integer doesn't work with heroku
@soft flare a friendly advice. Please understand the environment and language you work with, read a bit and then ask questions about it. If you don't know at least the basics people won't spoonfeed you. And dont be rude with anyone.
node-gyp is a pain
> integer@1.0.7 install /tmp/build_277986059d589a07d563188433818e05/node_modules/integer
> node-gyp rebuild``` this is what fails
Yea gyp is a pain
Usually i apt install it on ubuntu rather than npm
But i guess on heroku you are not allowed
Wat
package #12
Yes that
^
gyp is likely not the problem
Is it because I am using node 13 maybe?
?
try going through the troubleshooting page
We're sorry this build is failing! You can troubleshoot common issues here: https://devcenter.heroku.com/articles/troubleshooting-node-deploys
Are you using better-sqlite3?
what's so annoying
let me call you
no
YES

neko stop being annoying
No
@quartz kindle I don't use better sqlite
wait he called you too
Yes
why
its just screenshare
what for?
meh
I dont want to screen share, plus im on mobile, dont wanna waste data
so you want to or don't want to
dont*
@golden condor can i see your package.json?
Yes
That's how I do it, except the O like "aw".
Each letter spelled separately
that's... unexpected
I spell it j'son
stop
Tim I dmed you
@golden condor why do you have node in your dependencies lmao
Remove it
Also remove anything youre not using
You have a lot of stuff that you probably dont use
Also, afaik quick.db uses better-sqlite3 which uses integer
What buildpacks are you using in heroku?
damn i just want to make a command ex !help and display the Embed stuff!
but!!! its a error
put the command on where you put other commands
Also, afaik, heroku doesnt allow writing to disk
it does
It uses sqlite under the hood which will attempt to store your data in the file system. On Heroku, that file system is ephemeral and your data will be wiped at least once per day.
if (command === "help"){}
just temporarily
ok i think i will use embed generator
most generators are old so change RichEmbed to MessageEmbed
Oh well that's shit
k
I need the database
use a server?
Like?
do i need to put something in the url ?
no
Idk how to use mongo
k
everything is optional
but you just have at least one element
why not a normal mysql server?
that's what i use
I dunno how
make a caching system
here my Embed...
How do you use postgre @quartz kindle
mhm.hmh
i didn't know heroku have that
I figured it out
@golden condor i dont use postgre nor heroku, so i cant help you
the add-on is free nice
I figured it out
interesting. how?
^ thats how you do things
ok
i ll thx cuz i just made a simply bot
can ban kick members
have some goods stuff
Who can tell me Clearly step by step can make a Category ex. Kick.js and Ban.js because i dont want to put them in Server.js
google how to use module.exports
excuse me but can i get some help?
@fallow mango on?
i keep getting this error
Traceback (most recent call last):
File "bot.py", line 126, in <module>
async def kick_member(Ctx, targets:Greedy[DiscordMember], , reason:Optional[str]""):
TypeError: can't multiply sequence by non-int of type '_GenericAlias'
Help, it keeps disconnecting my db
thx @quartz kindle
i keep getting this error
__
Traceback (most recent call last):
File "bot.py", line 126, in <module>
async def kick_member(Ctx, targets:Greedy[DiscordMember], , reason:Optional[str]""):
TypeError: can't multiply sequence by non-int of type '_GenericAlias
i keep getting this error
__
Traceback (most recent call last):
File "bot.py", line 126, in <module>
async def kick_member(Ctx, targets:Greedy[DiscordMember], , reason:Optional[str]""):
TypeError: can't multiply sequence by non-int of type '_GenericAlias```
eghm you send the same message three times
i know ;-;
oh i see it now
nope i was wrong
i have an , *, and it wont take that ๐ฆ
can someone help me? for the last few days nobody has been that helpful (if they'd even respond)
?
nm
how can i make the Kick.js works in glitch...
i thought you saw what you got wrong
nope
i guess you meant the message
i thought i did
is there a new error?
no its the same
async def kick_member(Ctx, targets:Greedy[DiscordMember], *, reason:Optional[str]*""):
TypeError: can't multiply sequence by non-int of type '_GenericAlias'```
any pythoners here?
reason:Optional[str] * ""
@soft flare there is no different method for glitch a kick cmd is a kick cmd
what am i multiplying?
i just want to run a file called kick.js to make the bot use it
kicc
my kick is being stupid asf
@soft flare do u have a command handler?
cmd?
did you just make a file called kick.js and hoping it would work?
my brain cells are decreasing
i can call it also Moderator
@soft flare https://m.youtube.com/watch?v=ukiVc8FSSpY
This series contains some errors. A new series is on the way to right these wrongs. T
2019 Discord.js Series:
https://www.youtube.com/playlist?list=PLdnyVeMcpY78Hz8fFD1vqhYliBmZKaa7N
Discord.js Github:
https://github.com/The-SourceCode/Discord.js-Bot-Development ____________...
don't give him a video
he use glitch?
no
try understanding the concept
and see how a kick cmd is made
i just want to make the kick.js aka moderator.js to run
I am getting so stressed
@fallow mango * is a multiplication operator, unless it has another meaning in python
it did say can't multiply sequence by non int
@soft flare by the looks of ur files I cant see a folder/ command handler
it definitely means multiply
idk what it means thoughhghghg
25
yeah ik that
quick maths
๐
And youre doing someThing * ""
its 25
why are you multiplying a string
i fixed it ๐
@soft flare I would recommend starting off with basic stuff like sending and reading messages before making s kick cmd
did u u understand it?
BUT I WANT TO PUT THEM SOMEWHERE ELSE
yeah but you must've blindly followed a guide without knowing what it does
I DONT WANT TO KEEP THEM IN SERVER.JS
Can anyone help me
Stop screaming
why not
quickdb
It's either glitch or heroku
neither
And heroku is much better
quickdb uses sqlite
get a vps
use. a. server.
it's like 3 bucks a month
@soft flare please it's for ur own good
I need to easily be able to transfer data from an sqlite file to a db
there's like tons of mysql server hosting for free
even cheaper if you find discount codes
when u understand it, I will myself help u
@golden condor the only way is to use heroku's postgre, or an external database such as mongodb atlas
I have a mysql server already
then use it
Yeah well I can't easily transfer data over
you can
How
queries
What
Where is your mysql hosted?
Heroku
wut
It's postgre
And why is it hard to use it?
there's like tons of mysql server hosting for free
yeah don't do that, free database hosting means anyone can snoop at your data, you don't have full control over the database and it'll most likely get purged every few weeks
@golden condor there is no easy way to migrate between databases
I just have to reset the db?
another question who names their main file server.js 
him
glitch
a part of discords TOS is that if you store data you guarantee protection and encryption with it
glitch does not
You need to create a function that opens all entries in your old database and saves each of them in the new one @golden condor
how do i
server.js is the server retrieving stuff
I was using quick.db
a part of discords TOS is that if you store data you guarantee protection and encryption with it
@earnest phoenix i see
And you know how to read data from it?
And write the data into the other db
you don't need quickdb
I have a file called json.sqlite
where it stores all the data
Can I move over from that
yes @golden condor
sqlite aren't as reliable anyway
it doesn't work like that
Fuck
i know, fuck
well
it can work
u have to fletch data from ur old database
and write it in the new db
for example
it's literally just
opening a connection to sqlite
grab data
open a connection to mysql
insert said data
I don't know how
google and docs
I've never used mysql before
hey umm i have a new error
i used quick.db
File "bot.py", line 126
async def kick_member(Ctx, targets:Greedy[DiscordMember], *, reason:Optional[str]""):
^```
quickdb isn't the same
pls help
sql is easy
@golden condor question
why r u asking how to get data to mysql when u dont know how to use it

i need another database to use
mysql
other than sqlite
eh no
and recommended
Does sqlite use integer
Shiemi that's a big no
where did you get that information
ehh
that's a nono
mysql is way superior than sqlite but that doesn't excuse the fact that mysql is still slow and disgusting
like slow-slow
not some seconds
jesus christ
@earnest phoenix what database do you support then lol
Postgre for life
@mossy vine json db
I might try mongo
i go for postgres
XD
THAT'S WHAT I AM TRYNA USE @earnest phoenix
you just said mysql
hey don't scream
...
you think we aren't stressed hearing you rambling
instead of throwing a tantrum you could've already done your research
I am more worried about hw rn
do that first
I am using github
imo rethinkdb
json 
lmao
Every db is better at different things
If you want better horizontal scalability, use a (most) nosql database, if you want better vertical scalability use a sql database. Not the only difference, but one of them
Its MessageEmbed now in v12
The reason of the .cache change is to make it easier to differentiate between rest methods and collection methods
ie: all collection methods (get,set,find,filter,map,reduce,has,etc) have been moved to .cache
While rest methods such as fetch (which need to send data to the discord api), stay in the manager, not in the cache
Tim
i need yer help
do i needddd a usb drive to stick ubuntu to boot off or can i just have it as is which is a seperate partition?
wat
im installing Ubuntu because windows fucced me a lil bit
i downloaded ubuntu and put it onto a seperate ssd
can i boot of that or does it need to be on a usb to be booted off initially
Is it just the bootable iso? Or an actuall installation?
iso
The iso needs to be imaged into a device to make it bootable
You can format your entire ssd and clone the iso onto it i guess, but then you cant install it on itself (or maybe you can but it will be weird af)
Its best to just format the usb with it and install it to the ssd
atm it thinks its on a F drive Disc
i rlly cba to go to the shops and get an usb ๐ซ
Well. I guess you could split the ssd into two partitions
Make like an 8gb partition and clone the iso into it lol
And install it on the other partition
Then merge them after installed
bruh you don't have a single flash drive laying around
i seem to of lost them all
damn
you can install onto the media it's booted on
its not too hard either
make a partiton the same size as the iso, and a partition covering the rest
install onto said separate partition
then use the 1st os (im assuming you're dualbooting) to delete the partiton with the iso and resize the partition with the os on it
it's not a function
someone somewhere is calling .flat on your fields ):
imma just guess that somethign changed internally
someone was getting that error yesterday too
its discord embed again
ptsd
I don't have anything that has fields.flat though. ๐ค
Ctrl f
are you calling message embeds?
Hm?
@floral bloom are you using discord.js v12?
i mean, old message embeds
You need to use node.js v12 or newer as well
not sure if this works anymore
it does
It does
The problem is that array.flat() mas added with node v11
Hes likely using v10
Updated Node to v12 and it works now. Thanks, Tim!
the latest discord.js requires node v12 or higher precisely because they added many internal functions that are not available in older versions of node
What is required to invite your bot?
Invite it here?
Yes.
^
Then wait for approval
Was about to say that
How many command do I need, etc?
Doesnt matter
Are there any requirements I mean
For approval, the only requirment is that it has at least a couple funcional commands, and that its online
And whatever the requirements are when adding the bot
But if youre starting to develop it now, i suggest waiting until you have a better bot
Top.gg is meant for public ready to use bots
If your bot is not ready to use by public servers, you should wait until it is
My bots current prefix is -
Should I change it?
does eris work well with typescript
If its a common prefix then it wont be allowed to be used in #commands and #265156322012561408
Whats the bots ID? @vapid ferry
Client or User?
Client
They should be the same lol
they are? lmao i didnt know that
since i cant use the prefix, do y'all have any ideas on what to change it to?
You can, just not in this server
But if you want to change it, common practice is to use something like your bots initials
like tb-
Unless you make a prefix command and ask the mods to change the prefix to something?
tb- works
Do the mods even do that here?
hmh?
Like if a bot has a common prefix. But has a prefix command to change it, could you change it for this server?
So that the dev doesnt have to go change the whole bot prefix itself
We can do it but I don't see why? If your bot's prefix is changeable for each server, then simply make the change from your DB and ask us to remove the role
uh so once i change my bots prefix, who would i contact to get it unmuted or is it automatic?
Ping me once you're done
i'll apply the updates first and update the website
I actually havent thought of that. Of course you can just change it in your own db lol
What if I use a glitch project to be my db and connect to it using axios, would that work as a database?
You just want to extract the data from your sql fils right?
Yeah
If you cant get any sqlite db to work on heroku, its an optoon i guess
frick
Awesome
accidentally removed Tim's bot dev role for a second
Oof
Oof
They are, just not cached by your client
No
fuck i broke my bot
Because they have to prove they aren;t bots
its probably syntax ngl
bot was hit by a turret shot
Lmao
when u realise that ur internet is so shitty that you cant even ssh into your hosting server
but when u realise the laptop you applied the updates from can perfectly run the bot
Tim what vps and db do u use if u don't mind me asking
@flat pelican i updated the prefix
Bot ID + new prefix, please?
619734666697637889 (@hexed marten) tb-
@finite bough galaxygate and better-sqlite3
You updated your global prefix @vapid ferry https://eri.party/i/l6uktk.png
how can u view sqlite table
yes

I thought you can setup custom prefixes for each guild
You can use an sql file viewer, or use an eval command to load and display data from it
does VSC have a sql viewer module
No idea
Tim
ty
i'm disappointed
Im considering moving to vsc tho
webstorm
jetbrains > microsoft
@flat pelican its great for taking a quick look at a file lol
Without loading my entire workspace
well yeah
what SQL viewer can I use
https://sqlitebrowser.org i use this
okie
In discord.js is there a way to unban Deleted Users?
You should be able to unban them by id
Yes but i have ove 5k deleted users
in my servers and its annoing
Lol then just use the prune function in your servers user list?
u can do like
Or is it purge
prune
Will kick users who have no role and have been offline for 30 days
I dont want to do that
no
Or inactive for 30 days
thats a bad idea
I just was to unban Deleted users
Oh wait i was thinking about removing idk why lol
^ what if a person named themselves "deleted user"? Lmao
profile pic = nothing
All of those can b forged by a real user lmao
2 filters
But the chances of that happening are stupidly low
they ALWAYS follow /Deleted User [0-9a-f]{8}/ regex
ok 3 filters
name has deleted + user
no
discriminator = 0000
my regex has less false matches
hold on wait
omg
like. its the pattern they all follow.
Users cant have 0000? Even with nitro?
ehh
Interesting
ima ask something to try it
users cant have 0000
it's reserved for webhooks and deleted users
And system users
accidentally bans webhook
exactly @heavy marsh all of them match /Deleted User [0-9a-f]{8}/ regex
Wait, so a deleted user without the regex is not really deleted?
How to do a eval properly?
they just changed their username to that
@heavy marsh by doing it properly
Meme
w h y
LMAO
this is how an actual deleted user looks like
no info is left exposed but the id
Without the 8 digit code?
correct
๐ง
Then what about those with the 8 digit?
discord changed how deleted users work ageeees ago to comply with GDPR
this includes removing the code
then explain my ex's account
i watchedd her delete it
wanna hear a fun fact about my bot?
probably not
but yet here it is
hm ig that accounts deleted prior to the GDPR compliance change weren't affected by it
ahhh
that was in the last few months tho
thank you discord for being inconsistent again
Speaking of which
Why does discord sometimes render mentions as invalid-user?
Instead of showing the id
broken client cache maybe
lul
also fun fact
she still has a discrim
i made an alt and every acct on my ctrl+k says this:
they also forced half of large guilds into this weird a/b testing feature where the mention format for text channels is entirely different - it ended up breaking bots and official clients lol
o?
this is why discord is the best platform ever made
it was reverted a while back but basically the format became <#guildid-textchannelid-textchannelname>
ew
it was a horrible attempt at making cross server mentions easier
Lol wtf
So is this a deleted user or not?
hmm ok
but you're missing the fact that i watched my ex delete her account
This is a deleted user
was there a point where discord didnt change it?
w h y
ew stinky global bans bot
I kicked it thought
So bans in other servers would make it also ban them there?
yep. But most raids
I mean, its not a bad idea
That can be abused so easily
But its execution is questionable
Anyway, if you want to unban them, i think the best approach would be to test for both
0000 and 8 char code
@tight plinth @heavy marsh I think Deleted Users sometimes just appear like that.
wdym by "that"
Its not
i watched IN PERSON
It's not a troll
someone delete their account
I have many of those in my server ban lists.
and they have a discrim
@tight plinth we have been discussing this for the past 30min lol
They are deleted users
ahh
Okay
god
xD
Just looking at the tag and I understood
Apparently discord is just inconsistent like that
so yea anyone who matches /Deleted User [0-9a-f]{8}/, has no profile pic is almost probably deleted
I mean
and isnt accepting friend requests
Is there a way to try fetching it with the bot and catch the error?
Or maybe not because no shared servers
Its likely that discord has multiple layers of deletition
Like a deleted status but not totally deleted
What could this white part be between the left (container) and right (Opera background)
Border, margin and padding don't apply
Ig box-shadow
margin of the parent?
Or padding of the parent
Or maybe not because no shared servers
you actually can. there is a REST endpoint to get basic information about a user via their id
wait
doing it in mass requests'll be heavy on ratelimits though
really
yes
https://discordapp.com/developers/docs/resources/user#get-user going to assume it's this?
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
Integrate your service with Discord โ whether it's a bot or a game or whatever your wildest imagination can come up with.
yup
what happens if said user is deleted?
Well if you do one user per 5 seconds, it will only take about 20 hours to go through 10k
it provides username, discrim, id and some other thing
it'll return 404 probably
ohhh
yeah it returns 404 with a json message code
noice :D
๐
ok so
tasks.loop()
probs the best way to do something repeatedly?
instead of kicking off another thread on your own?
tasks.loop() doesnt make a new thread
you can use tasks.loop() or just create another task
just creates a task every X seconds
if its a loop you can just do client/bot.loop.create_task(coro)
o
oki
i was gonna use that to update my bot's guild count in status and top.gg
if ur using the dblpy module just have it autosend
but guild status still
autopost_interval accepting the interval between each POST request in minutes ๐ค
new question
when passing multiple env vars in bash
semicolons or spaces
TOKEN=akjshdjadhasjkdhashdkhasjkhdkajsh;OTHERTOKEN=akshdkjaskjdhkjaskjdh python3.7 main.py
or
TOKEN=akjshdjadhasjkdhashdkhasjkhdkajsh OTHERTOKEN=akshdkjaskjdhkjaskjdh python3.7 main.py
python3.7 main.py token=lalala othertoken=bobobo
why are you doing dat anyway
cd Ansura
while true; do
git pull
sudo pip install -r requirements.txt
ANSURA=ashdkjashdkjashkdashkdkhash python3.7 main.py
done
thats my bot's run script
@slender thistle im using bash env variables not python arguments
I'll just say that my opinion is objectively correct since I'm not familiar with bash
i mean it wouldnt take too much to change,but i was curious abt bash
ty tho
if i cant find an answer i'll use that way
Guys how can i do a bot reload cmd?
I thinked something like
(code to turn it off)
console.log(node .)
so it restarts
You cant turn it back on from inside
You need an external script or a process manager / auto restarter
For example pm2
hmmm
if ur using node you can clear require cache
im lazy so i think im not gonna do it
I just have index.js
PM2 is super easy yo use tho
it might be a bit more complicated if its only one file
pI think im not gonna do the restart bot cmd :p
pm2 is a bit of a pointless daemon imo just use systemd or make a 6-liner run bash script
npm install pm2 -g
pm2 start yourbot.js (instead of node yourbot.js)
#! /bin/sh
while :
do
echo "Starting process..."
cd /home/assyst/JS
node index.js
if [ $? -eq 0 ]
then
echo "Stopping process..." # exit shell script if exit code is 0
break
fi
sleep 10 # wait 10 seconds before restarting
done
this is the start script for my bot
Or that heah lmao
if exit code is not 0, it will wait 10 sec and restart
if it is 0, it will kill process
But thats more advancrd
I hate that when you do :P it makes that ๐
you can disable that
pretty simple script to be fair good way to do it
But that script requires using tmux or similar
either way since my bot is dockerised pm2 is a bit pointless
On ssh
I think im not gonna do that command
i was thinking to do a simple 4 lines code with nothing else
Its less than that
I dont think i can add another thing to my node modules
He doesnt understand that code
wat
Not a good idea to run something he doesnt underatand
:/
the only problem with this script is i will run it
and exit container
and when i go back in i wont be put in stdout of this file so i have to kill it manually to stop the current process
And it will stop as soon as he closes the ssh connection
uh
unless there is some difference to how it works containerised that doesnt happen to me
makes me glad with python's importlib xD
wher can i get help with my bot script?
screen could be used to keep the session active
here
whre
screen or tmux yes
i just exit the container and it carries on running
can someboody help me with my discord bot?
Just post your issue
You named your file indox.js
you might want to get a new token
you might want to get a new token
@fast zenith lol i already said him in DM
i did it
Gud
ok i rename it
lol
it's still not working and i dont know why
i did it
@quaint sorrel whats the error now?
Dude...
you need to install the module
Your file is still called indox.js lol
And you dont need to send a full screenshot
Just the error part
yea
Or just copy and paste the error text
ok
And you need to install discord.js
the only thing i see wrong is this
bot.on('ready', () =>{
There is no spac |
console.log('This Bot Is Online!')
}
oh
i didnt readed
lol spaces dont really matter ever in js
but now it's working alot beeter i did something else @solemn quartz
oki
if i'd want to execute a funtion for every id i'm having.
How would i need to do that in a loop using the array?`
if (current.isLoggedIn()) {
voiceMembers = await userCheck(client, current.getDiscordID(), voiceChannelID)
}
let voiceMembersIDs = voiceMembers.map(m => m.id)```
like for every id inside the voiceMembersIDs
would i need to use a for let loop or voiceMembersIDs.forEach(id => {})
u need to make the let args and your first command
if i'd want to execute a funtion for every id i'm having.
How would i need to do that in a loop using the array?`if (current.isLoggedIn()) { voiceMembers = await userCheck(client, current.getDiscordID(), voiceChannelID) } let voiceMembersIDs = voiceMembers.map(m => m.id)``` like for every id inside the voiceMembersIDs would i need to use a for let loop or voiceMembersIDs.forEach(id => {})
@peak venture wat
:p
Ok I have a question about TOS
are you allowed an admin only commands that lets you get an invite to a server the bot is in
Hi, looking to count messages for a server to award ranks/perks, yet quality discussion is to be promoted. For example single-emote messages or "lol" should not be added to the total
The hope is that this is achievable by not adding messages below a minimum character limit to the total, or by counting characters a user has sent (over the amount of messages) - is there any bot out there which can already do this? Hard to believe this is a problem only one server has, I know a minimum delay between messages is already possible with some bots. Otherwise the extreme solution would be to create a custom bot just for the server, hoping to find one first though ๐
im not sure if there is an already existing bot
there might be
ive made that sort of system for a few custom bots
e.g More XP given to longer sentences upto a certain limit, spam not counted short words ignored /less xp etc..
while I do have experience with Python and Java, I've never considered creating a custom bot, wouldn't know where to start. Guessing there is a discord provided platform / server space for running bots?
not really no
you get a bot token in discord's dev portal essentially creating a bot account
after that you have to use a Lib and programming language of your choice to program the bot and run that code 24/7 using a VPS or self hosting
This is what one of my bot's folders look like
lotta code
guys
i just realized that oily is a boy
i dont see good little images
it seemed a girl
bruh
Oliy is an egirl confirmed
lol
would hope to find an existing bot before starting a host just to accommodate a simple counting feature. Otherwise we'd have to consider not adding this before we have other features we could add to a custom bot, just for this it isn't worth creating a custom one
It seems like a very specific feature so I doubt there will be many if any public bots that are capable of that
Either manually check out a load of moderation bots one by one or bite the bullet and make one yourself I guess
that is surprising. I'd think many servers who want to promote discussion would face the issue of one sentence being
"well
i agree
but
you need to consider xyz
otherwise you are correct"
or "well I'd agree, but you need to consider xyz. otherwise you are correct" in a single message which messes with the results. Eitherway thanks for the help @true ravine and @modest maple ๐ Much appreciated!
Oh, and If anyone sees this conversation in the future and knows of a bot which can count characters, please message me! ๐

