#development
1 messages · Page 1171 of 1
though you gotta either find their docs or dig that warpper code to see the format their api use
@opal plank in english
filename is endpoint
its fairly simple tbh, the document path is the api path
only get requests
key is the required query param
done
none of that is explained in the docs, its all payload return examples from what ive seen
thats the opposite of documenting

you dont make a public api and tell your users to 'try and error'
https://official-joke-api.appspot.com/random_joke
This is API
https://github.com/HypixelDev/PublicAPI/blob/master/Documentation/methods/playerCount.md
This is IDK
well hypixel is a game development company, not an api development company
doesnt matter
xd
they don't really thats the thing
at least put THAT much effort
then why bother with a public api?
dont document it then, keep it internal
¯_(ツ)_/¯
people wanted data, and they implemented that feedback
makes absolutely no sense
" 3 contributors"
im going to buy food
none of them were able to write a somewhat proper documentation smh
well although if you're using the java example, it will work out of box
(and they have a dedicated section in the forums for api-related help)
follow it till you see whats being sent
dig in that wrapper code
@opal plank whats a wrapper code?
the entire repo, basically
oh my god..
The docs said that the Java response is formatted in JSON. how can i make java speak???
Carefully, he might swear
How can i make Java spit out JSON?
spit out
how
oh welcome back
i come back with food and this is what i see :
The docs said that the Java response is formatted in JSON. how can i make java speak???
@carmine summit which programming language are you most proficient with?:

So is a give all command API abuse if you have a 1s wait between each role give
I'm unsure because that seems to be what Dyno does
i’d use 1 second for a server under 50 members
and 50 above, i’d use 2 seconds
dyno essentially does the same thing
Ah ok thanks
@carmine summit which programming language are you most proficient with?:
@opal plank JavaScript
not the 50 member thing btw, same logic i think
@carmine summit use axios and parse the json yourself
I know how to parse json
And axios
But i dont know the url
For the json
For the api
what r u trying to do?
what r u trying to do?
@digital ibex tying to make java speak
Java Script
shiv
Javascript also known as java
he got stuck in his head that his code has to be in java to use an api
java =/= js
2 different things
Lmao
java speak?
Yea

huh
Umm
https://cdn.discordapp.com/attachments/272764566411149314/745981419079204884/unknown.png
@opal plank theres no json inhere
the only 2 words i want coming out of yer mouth is JSON and javascript
im so confused rn
Theres no json there
indeed
Only 3butons
No
I am an api
What I need is a url requesting an API key that if you open you will see json
No buttons
there aint no buttons

its an api call
thats the api base url you'll be fowaring your requests to
you dont get api key there, you get it here
Ehhhhhh
I ussually use a JSON reader
dont even dare mentioning java again
For example if i go to an API website i see is JSON then i copy it and paste to json reader and then code
click that nifty link up there
Anyone
Nodefetch is easier
indeed, though feel free to help em
im more familiar with axios, if he needs help, i can give it with axios
Ok. Ok ill dm if i need solutions in Java||Script||
good
!?!?
Hypixel lmao, got perm banned there
I stted two times
Eval cmd of discord.py
no clue, py, not my area
Okay
@slender thistle loves py and would be happy to help you
Idk how eval works
Yes
Level up bot
Your bot is a level bot?
I mean level system
Oh nice
What's your language
O nice
Is java easy?
im still patiently waiting till a scratch lib comes out
Hmm

@safe kelp eval evaluates text as code, don't use it
Yes
Wdym by desktop os?
whym dont use it?
.....
Eval is unsafe and could easily lead to someone taking over your machine
thats why you whitelist it
If you don't understand it though, don't use it ;)
Eval is unsafe and could easily lead to someone taking over your machine
@tidal parrot more like exec
Well we can mke it owner only @tidal parrot
That's fine then
is it that big a deal? iuf you have access to eval you have access to code either way
It just evaluates text as code as initially said
Just dont put random things in
be it fucking up with a command or on the code, both are unsafe if you dont know what they do
lol android is easy
I can also clone gits
Eval should never be needed except for debugging shit tho
On Android just use py pydroid ide for python and dcoder
Simple
O
Then maybe dcoder support java
Openjdk??
What's this?
@honest perch as shown, i evaled my token

evals are super handy tools to have
being able to access stuff directly from the bots code is super good
what language?
wdym code a reason?
Is it faster to set up a webhook in a channel (for a logging system) or just fetch the channel and send the logged information
prob webhook as its just dispatching
ah ok
logic => webhook => dispatch
logic => fetch => dispatch
makes sense
not sure it works like that though, take it with a grain of salt
indeed
yes
How can I do that please?
I use Node.JS v12
@feral aspen discord.js?
Yes @opal plank
Wdyn native?
use that and loop each
Snipping Tools, Print Screen + ctrl v, sharex, gyazo
so many options and you take a pic with your phone
tis why we learn
const client = new Discord.Client();
client.once('ready', () => {
client.user.setActivity("Type ?help for a full list of commands",{
type:"WATCHING"
})
console.log('Logged in as The Universe!');
});
client.on('message', msg => {
if (msg.content === '?help') {
msg.reply('COMMANDS NOT READY');
}
});```
if (msg.content === '?prefix') {
msg.reply('Change prefix');
}
});
client.on("message", async msg => {
if (msg.content == '?ping') {
try {
const m = await message.channel.send("Pinging...");
const embed = new Discord.MessageEmbed()
.setColor("RANDOM")
.addField(":hourglass: Latency", `**${m.createdTimestamp - message.createdTimestamp}ms**`)
.addField(":heartbeat: API", `**${Math.floor(client.ws.ping)}ms**`)
return m.edit(`🏓 Pong!`, embed);
} catch (error) {
return message.channel.send(`Something went wrong!: ${error.message}`);
}
}
});
if (msg.startsWith(!afk)) {
const status = new db.table("AFKs");
let afk = await status.fetch(message.author.id);
const embed = new Discord.MessageEmbed().setColor(0xffffff)
let afk = new db.table("AFKs"),
authorStatus = await afk.fetch(message.author.id),
mentioned = message.mentions.members.first();
if (mentioned) {
let status = await afk.fetch(mentioned.id);
if (status) {
const embed = new Discord.MessageEmbed()
.setColor(0xffffff)
.setDescription(`This user (${mentioned.user.tag}) is AFK: **${status}**`)
message.channel.send(embed).then(i => i.delete({timeout: 5000}));
}
}```
wow..
```
const embed = new Discord.MessageEmbed()
.setColor(0xffffff)
.setDescription(`**${message.author.tag}** is no longer AFK.`)
message.channel.send(embed).then(i => i.delete({timeout:5000}));
afk.delete(message.author.id)
}
client.once('ready', () => {
embed.setDescription(`**${message.author.tag}** now AFK.`)
embed.setFooter(`Reason: ${args.join(" ") ? args, join(" ") : "AFK"}`)
status.set(message.author.id, args.join(" ") || `AFK`);
} else {
embed.setDescription("You are no longer AFK.");
status.delete(message.author.id);
}
message.channel.send(embed)
}
client.login('');```
There should be a command for the mods that says that you only need 1 message listener.
Did
I think your callback is missing an paranthesis. @earnest phoenix
kill it with fire
Wdym @fast yacht
message.channel.send(embed)
})
and they are NESTED
wdym code a reason?
@opal plank if i do var reason = args[1], only 1 word will be reason. But i need it like 4words to be reason
Hahhaaha
@carmine summit parse from message.content
I didn't see the nested stuff. I think discordjs.guide is a good starting point
@earnest phoenix only 1 client.on('message', => ....
what you're doing is basically a : How to memory leak 101
there are 6 event listeners!
@opal plank dats wat u get for copy pasta codes
likely what happened
@carmine summit parse from message.content
@opal plank help
I cannot use message.content.sub
substring*
Yeah
But the command is ?kick @soneone reason reason reason reason
so?
What i need is
join
what you need is to listen dude, im giving you all the directions you need
.replace() or substring with index of mention
How i do that?
substring can be used to split the string on a certain index
those are called parameters
if you dont know function parameters you dont know enough js to be making a bot, likely
I know
you dont
I dont?
start with that
then read this
and this just incase you dont really know replace() https://www.w3schools.com/jsref/jsref_replace.asp
I know replace
then read the other 2

Ive been working on 1k lines of code of JS in my bot
big code isnt good code
I already have 1k lines
noone did spoonfeed
Does anyone know discord ToS and global databases. e.g. if the bot shows a rank of players and it shows players across discord servers. ok or not ok?
take pride in quality, not quantity
Why is smaller better?
@fast yacht not okay
you can show position in global rank iirc
but not any identifiers of users that arent in the same server
@carmine summit optimized is better
long code doesnt mean good code
by learning basics of JS
I know tha basicsssssss
doesnt seem tho
so i've wanted to get my bot verified for so long
and this is so dumb because the only part i'm stuck on is "identity verification"
the other parts I can fill out fine 😦
you need to take photo of your passport or smth
Its all full of if(){}else if(){}else{}
you can
and use modular code kthx
thats how you make your code smaller
Its all full of if(){}else if(){}else{}
yanderedev?
Eh?
use switch statements too
I dont know swithc statements
switch(item) {
}
Alright theb i dont know the basicis of js
case "something": {
}
does anyone know how Heroku works? Ive been trying for hours and have given up
case "something": {
}
@sharp owl im trying to avoid case because i dont understand it
And it gives plenty of error
case "something": {
}
better practice: ```js
let thing = "test";
switch(thing)
{
case "test":
console.log("switch found 'test'");
break;
default:
console.log("switch didnt find 'test' in the string");
break;
}
also dont copy paste
thats why it gives plenty of errors
Then itl be more bulky than my codes
just dont copy paste, its bad practice
Go on
dont ask to ask
but i have no idea what to do next
Host the bot on it
ssh root@ip in ur cmd line ok then
That's backwards
I think that’s backwards
Lmao
someone said to install filezilla
yeah if you want. Or git clone the project
use sftp btw
You can use sftp to connect with the same credentials as ssh
host = ip, username = same as ssh, password = same as ssh, port = 22
vps ofc
everyone said linux unstable
;-;
Linux is generally extremely stable.
Debian, ubuntu, your favorite websites all use Linux 99% of the time to serve you data
Can someone help with music player bot I am writing
windows is unstable on server side tbh
uses 3/4 of ur ram too
Linux is generally extremely stable.
Debian, ubuntu, your favorite websites all use Linux 99% of the time to serve you data
I like Fedora, RHEL & Arch, but yeah, it is personal choice :p.
GG sends you an email with the info
plesss
root is your user
Galaxygate sent you an email with the password
Double check your using the correct ip, also sent in the email.
ok now u can post ur files there
Ay
and tjhen make ssh connection and start the bot
ok now u can post ur files there
@restive furnace from my pc?
yes
yes
hey everyon
including node modules file
dont transfer node modules
ok
i made an eval command that uses the sharding manager's existing broadcastEval; but how can i make it eval asynchronously?
so like this?
manager.bcEval((async() => {myCodeHere})();
inside a string
^
oh yea that too
how to install packages
thanks
in my vps
^ and npm install
just npm i and it'll check your package.json
install nodejs
@pale vessel i wanna ask where is terminal
ssh to it
ssh root@ip
use putty or something
first let me transfer my files to that
then i will come bacl
do i need to transfer everything
in root?
How can I send a message to a specified channel id?
Without cache
@ me if you know.
you'd have to fetch the channel, but I guess that also involves cache
:O
but that might get you ratelimited
You could make the HTTP request to send to the channel yourself
client.channels.cache.get("744906283756290048").send(banEmbed); I used this but it's with cache
whats wrong with it?
all channels are cached by default in d.js anyways
(unless you're using discord.js-light)
Check your discord.js version
v12
home/root and optiomally
mkdir whatever && cd whatever
@restive furnace
NGL I'm not getting anything
It just looks like I wasted 3$
^
There's no way cache can be undefined if you are using v12+
Are you connected?
Yes I am
You can just drag files across into root
All the files into root only ?
So I drag and drop full folder
I have my bot code in folder called Blacksheep
So should I drag whole folder
In root
Except node modules
Ah. I was the same too.
XD
apt will usually give you an outdated version of node
thats why nvm is recommended
oh yea it does
:^)
hey anyone here?
i need help
Error: read ECONNRESET
i used randompuppy
for meme command
and this error came
pls help
if u reply pls ping me
Not giving us much to help you
@misty sigil I'm back
Did you install nvm?
It's node version manager
do i need to download it
allows you to install different versions of node
from somewhere
apt-get install nvm works iirc
in the ssh
bruh
how do i use ssh
open command prompt and do ssh root@ip
bruh
don't bruh on me
bruh
are you sure they transferreD?
If you wanna help then do,
I am not forcing you
Just don't bruh on me
are you sure they transferreD?
My files are being downloaded
from glitch
its still transferring
idk why
I like CyberDuck
it says at the bottom it's still transferring
all is going in root
It's simple and gets the job done
its going into /root/app
yes
but that's where you are
the home folder for root user is /root
It's taking so much time
it is just 64 mb
;-;
why does it says this @misty sigil
cause that directory doesnt exist
you are trying to move some files to a server?
yes
FileZilla FTP
probably has to do with your internet
@valid frigate yea it's shit rn
yeah then just wait
;-;
no
trust me
no its probably better to wait
your internet speed is out of your control rn
unless some retard on ur network is downloading a huge zip
mmm... does that include your node modules folder?
fortnite new update
mmm... does that include your node modules folder?
@cinder patio no
okay good
There is a bug in my code that's driving me crazy and I can't understand what the actual fuck is wrong with my code, if someone is used to discord.js please help me
its just bcs his downlaoding fortnite update
not true
its big
aight well all you can do is wait
4 gb
you could pause the downloading tho
the fuck
its working
it's literally stuck at 53.1MIB
best option would be to use the server to ftp to ur local machine and mget the files
There is a bug in my code that's driving me crazy and I can't understand what the actual fuck is wrong with my code, if someone is used to discord.js please help me
I will need to stream my code on discord, cause it's on different files, dm me if you feel like helping me
best option is to git pull
since it uses vps network
and which is probably faster
I will need to stream my code on discord, cause it's on different files, dm me if you feel like helping me
@opaque seal What is the error
also use pastebin
@opaque seal just explain the issue here
Its pretty long to explain, and I get no errors, I can try but it would be a lot easier streaming it
then provied screenshots if needed
Hi, do you know how to turn a Minecraft API Webpage into a temporary json file?
I wanted to do a command that gives you someone's uuid
What the f
just store it ib memory
Basically I have a value in a database called autochat, that's initially set to false. I can change its value with this command https://hastebin.com/ocijenuqiv.js
My bot creates temporary voice channels and it will check for that value to see if it has to create a text chat too, this is the part of the code that does that https://hastebin.com/falavafive.js
When the autochat variable in the database is set to true everything works fine, but when it's false instead it just doesn't save the 'vcs' to the database
@earnest phoenix
its your internet bruh
its your internet bruh
@valid frigate 100 mb/s
run speedtest in the vps too
is it possible
just store it ib memory
But if I do that, I'll have to copy every user's uuid
if it's a problem with the vps ask in the gg server for help about it
Basically I have a value in a database called autochat, that's initially set to false. I can change its value with this command https://hastebin.com/ocijenuqiv.js
My bot creates temporary voice channels and it will check for that value to see if it has to create a text chat too, this is the part of the code that does that https://hastebin.com/falavafive.jsWhen the autochat variable in the database is set to true everything works fine, but when it's false instead it just doesn't save the 'vcs' to the database
@earnest phoenix
Basically when I remove theif(generators[genIndex].autochat){}everythings works
is it possible
@delicate shore it is
I mean a command like uuid An_user_name, and it gives An_user_name's uuid
@delicate shore it is
@restive furnace how
@opaque seal do you have a screenshot of the runtime error that got thrown in the exception handler
well in ur code, you are nullchecking it, but youre not handling anything if the condition is false
start from there
Why would I need to handle that
isnt it obv tho, ur db value can be both true or false
yeah but I need to do stuf only if that value itìs true
then i hounestly dont see the issue
@delicate shore what's up?
you wanan save vcs to the database even if its set to false?
@delicate shore what's up?
@pure lion nothing much
fucking myself
shifting to galaxy gate
looks like I am hacking
:() okay
Maybe contact galaxy gate
you wanan save vcs to the database even if its set to false?
@earnest phoenix basically I create the temporary voice channel and if that value is true I also create a text chat
Also why not oxide.host?
Oxide is far better
oxide price was more
Twice the ram for like 15% more
or less
Twice the ram for like 15% more
@pure lion i really don't need that much ram
1 gb ram
is fine i g
yes
oxide stinky ovh reseller
is oxide better
than GG
@delicate shore they are both good, but gg is known to be faster
@golden condor
well oxide is reselling from what I see
they are both good
@golden condor i took it as u said , but gg is known to be faster
They are both good
got GREAT customer support actually
@earnest phoenix I guess I'll drop that feature lmao
gg is closer to discord's gateway
oh ok
Oxide comes close
But oxide has great customer support as Matt says
if you wanna check my host, it's called hostingbot.net
I mean i can get support here from you guya
Montreal, Canada to be precise
I mean i can get support here from you guya
@delicate shore we can't help on vps side
How to make arguments without commas
discord.js
@cinder sandal
what
@delicate shore we can't help on vps side
@misty sigil like?
actually idk if oxide is reselling
ok
but their locations seem really irky
Oxide is good
why is every dedicated server atleast 100$/month
Fairly
they're located in the UK
how to make arguments WITHOUT commas
join(" ") doesn't work
isn't there any cheaper
Because it's a dedi
but their servers are in france and canada
@golden condor what do u use
ok
e
why is every dedicated server atleast 100$/month
@delicate shore not all
@cinder sandal wdym
have you seen oneprovider's dedis?
scaleway used to be super cheap
no?
but now its wtf
yeah scaleway upped their prices
Vpses are vms, dedis are full machines, that's why.
@cinder sandal wdym
@earnest phoenix my arguments are just arg1,arg2
i want them to be arg1 arg2
.join(" ")doesn't fix it
yeah unless your provider is trash
https://jeremy-clarkson.is-inside.me/riuraWhn.png this would be ezily outperformed by a vps ngl
Oxide isn't that bad
https://jeremy-clarkson.is-inside.me/riuraWhn.png this would be ezily outperformed by a vps ngl
hdd? wut
idk 
whats wrong with hdd
slow
They have great support and great plans and are fairly chea0
I mean...
but intel atom though 
my question is still unanswered
it is still taking so long 😢
your question doesn't make sense
whats taking long
even .join(" ") doesn't work
why
guys any way to access domain email?
you need a domain email host or domain email server
if your domain comes with web hosting from the place you bought/obtained it
they should include a free email service
let me see
i allready have it
but not hosting
CENSORED.ga
@misty sigil are u here for next 40 mins
no
if you're using freenom, they only provide the domain, no webhosting etc (unless you purchased it of course)
so you either have you host your own email servers (on a vps), or use a email service
neither is free so yuh
yee yee
also some vps providers do not allow outgoing email, so just check to be sure
apt-get install nvm
(if you're going to host your own email servers)
how to do so
do what
github dont support email right?
nope
so far I only know 2 options if you want a custom domain email
and they are the 2 described above
When will random people be able to use my bot?!?! I cant post this int the faq cuz i dont have the permissions sry
why would we want to contact you
When will random people be able to use my bot?!?! I cant post this int the faq cuz i dont jave the permissions sry
@median hare what the-
Boa tarde Como traduzir as conversas
english only please
Ye
Can some1 help me
ah
.split(' ') doesn't even work, i want arguments with spaces not those commas
Is there any way to say search for either ' OR ", not both in regex?
For example: I want to find "test" or 'test' but not 'test"
no
.split(" ")
@delicate shore same thing, splitts by commas
@slender thistle what are the constraints?
only alphabetical/alphanumberic or something else
apt-get install nvm
"test", "test"
I'm somewhat confident I wouldn't fuck it up that bad 🤔
Constraint? Just anything, I guess
Actually, I think I found an interesting way to keep my thing up-to-date
I mean, my text just happens to be a version number
wait why would there be quotation marks then
"0.1.4", '0.0.1', that kind of crap
I mean, I have the option of using a namedtuple and then getting its properties
But... eh 🤔
well as long as you get it
I can see what it does, for the most part
its hard to explain regex
@delicate shore throws me an error while adding .join
args.shift is not a function
I bet
It's kinda hard to understand it properly yourself imo
so
Don't add .join?
no arguments splitted by spaces...
?
this is impossible to make them
Splitting args by spaces?
yes
string.split(/\s+/)
@slender thistle https://regex101.com/r/Du3sKr/1
Regex101 allows you to create, debug, test and have your expressions explained for PHP, PCRE, Python, Golang and JavaScript. The website also features a community where you can share useful expressions.
owo
just need to allow for optional characters at the end and we're all good
thanks btw 
np
string.split(/\s+/)
@warm marsh tried, still splits by commas
show us your code then
if this doesn't solve your problem, the issue does not lie here, but somewhere else in your code
if (message.author.bot) return;
// prefix
if (message.content.indexOf(process.env.PREFIX) !== 0) return;
// command handler or something
const args = message.content.slice(process.env.PREFIX.length).trim().split(/\s+/)
const command = args.shift().toLowerCase();```
and what is the message that you trigger the bot with?
<say arguments
message.channel.send(`${args}\n - ${message.author}`)```
oh
bruh
i will try rn
i type so fast that i make typos
dont type so fast
@fluid basin tysm it works
np
global voice
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
I'm looking for the opposite of connecting. For example if someone tries a voice channel command (such as play) and the user is not connected the bot should throw an error
example: "You are not connected to a voice channel!"
@slender thistle i know i'm late but hey you can group the first quote and reference it
Got an example handy?
("|')[whatever]\1
Fuck
It still says one hour left
To upload my code with ftp
On VPS
But only 20MIB
but if you use groups randomly like i used to then that might be messing things up
... yeah, I'll probably just use the way willi gave me
@acoustic bridge check if ctx.message.author.voice is equal to None
a little bit modified to, well, ([\']([^\']*)[\']$|[\"]([^\"]*)[\"]$)
whoa
lol what
@slender thistle you should use backreferencing
I don't really need to sanitize the input inside the string, so I'm just going the get first '|", get the content before the next '|", and then get the last '|" way
Is there a pro to using backreferencing?
well if it works it works, i'd just do my way as it's probably easier to understand 
if only this shit worked with Python now
regex101 isn't helping me 😂
@acoustic bridge check if
ctx.message.author.voiceis equal toNone
@sudden geyser That didn't work. Remains the same error
i want to make a reason thing for my warn command, the reason incluxdes the user mention, how do i remove it?
wdym it isn't helping you
Just not finding my string but I can fix that myself
i want to make a reason thing for my warn command, the reason incluxdes the user mention, how do i remove it?
@cinder sandal
thanks for the advice 
person above likes unflipping tables
fuk
this is development
I need to read channels better
That didn't work. Remains the same error
@acoustic bridge what did you try? Can you share some of your code
global voice
channel = ctx.message.author.voice.channel
voice = get(client.voice_clients, guild=ctx.guild)
if voice and voice.is_connected():
await voice.move_to(channel)
else:
voice = await channel.connect()
if ctx.message.author.voice is None:
await ctx.send("You are not connected to a Voice Channel!")








