#development
1 messages Β· Page 411 of 1
crap i forgot that was there
how can i make my code bigger for u to see
and if u go to the see origanel u can zoom in
and i also cant start it
post it on hastebin.com
@brisk ginkgo post ur code on hastebin.com
If u go to it u can just copy and paste ur code there click the save button and then send the link
ya i got my code fixed now trying to get it to start
ReferenceError: bot is not defined
at Object.<anonymous> (C:\Users\Durran\Documents\BOTS\index.js:43:1)
at Module._compile (internal/modules/cjs/loader.js:678:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:689:10)
at Module.load (internal/modules/cjs/loader.js:589:32)
at tryModuleLoad (internal/modules/cjs/loader.js:528:12)
at Function.Module._load (internal/modules/cjs/loader.js:520:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:719:10)
at startup (internal/bootstrap/node.js:228:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:576:3)
So u had it first as βbotβ
?
And you need to login
is bot = require('discord.js')
can u show me your code
try changing 'bot' to 'client'
Uh no plenty of free sources on google
just a hunch
Plus, you're not logging in even.
wjhat u mena
dose bot.login not work?
demon_hell, on your first few lines, do you have a code like
var client = require('discord.js') ?
if so, then bot.login('token') wont work
You need to use:
client.login('token');
It depends how you defined your instance of it
And you defined it as client
Meaning bot is undefined yes
@quasi hearth could you not
π¦
worked
Okay great but you sure are long way from getting a hang of it all. What I suggest is reading guides or so, source codes, puzzling it all, as is google your best friend
@brisk ginkgo some useful links
A guide made by the community of discord.js for its users.
ok thx man
No problem
how do i shut off my bot?
end the process via terminal (ctrl + c) or close it
How do I add my own text before the var but in it so if the value is false it disappears with the var?
${tempVars("test")[0].bonus_item_1 || ""}
I want it to add (Item 1)
client.on('message', function(msg){
if(!msg.author.bot){
switch(msg.content){
case '+youtubelink':
msg.reply("bar");
break;
case '+instagram':
msg.reply("foo");
break;
}
}
});
ISSUE: '+instagram' spams for some reason
EDIT: strangely, changing the link to text fixes the issue
anyone got an idea on how to fix
yes :learnjs:
we found that replacing the link with text fixed the issue. it was quite weird
i should....?
true, didn't think of that :p
π
@bitter sundial when will my bot be online?
when you make it online
lol
Hi, is this the proper channel to address a slight issue with?
this is bot development discussion, if that's what you mean
Well, no, see, I'm trying to resolve an issue I've been having as of late concerning the Login function.
What's the issue?
I use Discord on both my mobile device and my Kindle Fire tablet (although my phone is always the more beneficial use), but I've noticed that each time I try to invite a Discord bot on my phone, via the Authorization panel, it doesn't have my main account signed in. Yet, on my tablet, it does, and I wanna be able to have my main Discord account signed in on my phone as well.
I've tried logging out of Discordbots.org on both devices
And it seems to keep the same issue around. My phone seems to only recognize my secondary account
And my tablet the primary one
Try logging out from the app
discordbots.org uses your actual discord account, so you have to sign out from that instead
I'm currently using my primary account. I can try signing out of this one and see what it does, but if nothing changes, I'l come back in.
to answer your first question
you are trying to signout through mobile right
http://discordapp.com/users/@me - can go to settings in discord using the browser and can signout, login with your primary and invite bots
Alright, let me try that because signing out of both devices didn't work
well you are technically inviting bots via a oauth page on the browser, so you need to log into the correct account on that corresponding browser then
Alright it seems that aspect was logged in with my other account. I signed in and relogged in with my primary.
I'm gonna test to see if it'll work now.
Good luck
Successful login. Thank you very much, guys, the issue has been resolved.
π
so official, but np
I was sent here to ask for help with my problem, and I'm being redirected to somewhere else
Lol
I already made this joke x)
Lol XD
@bot.command(pass_context = True)
async def infoembed(ctx, user: discord.Member):
embed = discord.Embed()
embed.set_author(name = "API Security Bot | Statistics")
embed.add_field(name = "The user's name is: ", value = format(user.name))
embed.add_field(name = "The user's ID is: ", value = format(user.id))
embed.add_field(name = "The user's status is: ", value = format(user.status))
embed.add_field(name = "The user's highest role is: ", value = format(user.top_role))
embed.add_field(name = "the user joined at: ", value = format(user.joined_at))
await bot.say(embed = embed)
This is the code
And it returns with this error when executed:
You have a missing argument
hold up gotta see what the PY APi says
It says below that line "user is a required arguement that is missing."
do ctx, *user
And after do
user = ...```
async def stats(ctx, *user: discord.Member):
if not user
user = discord.Member
like that?
I forgot a colon
async def infoembed(ctx, *user: discord.Member):
if not user:
user = ctx.message.author
embed = discord.Embed()```
Now I need something else..
for what
embed.add_footer(text = "Requested by ".format(user.name))
or
embed.add_footer(text = "Requested by " + format(user.name))
client.on("message", async message => {
if(message.author.bot) return;
if(message.content.indexOf(config.prefix) !== 0) return;
const args = message.content.slice(config.prefix.length).trim().split(/ld!/g);
const command = args.shift().toLowerCase();```
That was teh only way I manage to make it to ignore everything except real people?
It works, but is that the most effecient way?
You could use /\s+/g instead of /ld!/g
also you could use message.content.startsWith
instead of message.content.indexOf
if(message.author.bot) return;
if(message.content.startsWith(config.prefix) !== 0) return;
const args = message.content.slice(config.prefix.length).trim().split(/ld!/g);
const command = args.shift().toLowerCase();```
?
oh, so I can remove the whole !==0 ?
yeah
add a ! before message
or it will ignore everything that starts with your prefix
How do I connect a API to my bot?
Like SpaceX api?
Caus I have made "require" thing
but it cant find the api?
is the node package installed?

then it wouldn't work with discord
Shit ;/, then I have to make a external server that sends the API data to my bot?
I tried thiss:
that's not requiring a node package
Why not run as two separate processes
https://melijn.com/ isn't showing an embed (it should)
http://melijn.com is showing an embed
(embeds are disabled in this chat)
I don't know why :/ it isn't showing up with https
Discord also doesn't show .png ect in chat when using https
quick question I have a bot that keeps repeating the same statement when you try to say something to it any one know why?
please use a switch
use an object
If you try to add that bot to this server it will probs get muted for repsonded to non prefixed commands
switch and case please 
^
const responses = {
'hi': 'hello',
'bye im leaving': 'ok bye'
};
client.on('message', msg => {
const response = responses[msg.content.toLowerCase()];
if (response) {
msg.channel.send(response);
}
});
Ey timmy
I'm trying to connect my bot to SPaceX api
but I cant get the fetch to work?
Like I want to take the JSON and then print int out raw in chat as a start but I cant get it to download it ;/
Do you know a better way to copy "https://api.spacexdata.com/v2/launches/upcoming" the data in this file and print it, than Fetch?
please help meh :(
I need some help with coding a python bot (embed)
If I do apistats without mentioning someone
it shows my stats
if I mention someone
it doesn't do anything at all
that looks like it might be a problem with your code that fetches the stats
Yeah
What do I gotta add?
bot.command(pass_context = True)
async def stats(ctx, *user: discord.Member):
if not user:
user = ctx.message.author
embed = discord.Embed()
embed.set_author(name = "API Security Bot | Statistics")
embed.add_field(name = "The user's name is: ", value = format(user.name))
embed.add_field(name = "The user's ID is: ", value = format(user.id))
embed.add_field(name = "The user's status is: ", value = format(user.status))
embed.add_field(name = "The user's highest role is: ", value = format(user.top_role))
embed.add_field(name = "The user joined at: ", value = format(user.joined_at))
embed.set_footer(text = "Requested by API Security")
await bot.say(embed = embed)
mentions look like this to the bot: <@id>
so to get a user from a mention, you need to do something like:
ctx.message.guild.members.get(id)
(You will need to write the code to get id by yourself, as I'm not fully sure on how your messages are formatted and stuff)
(might not work exactly, as I use discord.js)
Isn't it <@%s>
?
wait
nvm
@quasi hearth want me to send you the whole bot?
bot code
I mean
if you want to (dm me tho cuz i might be going afk soon) just make sure that any personal info is hidden.
How do I remove ffmpeg from code? https://hastebin.com/abojepoqis.coffeescript
Keeps doing error
well for one you don't because you need ffmpeg for what you're doing
I guess depending what you're using
You talk a bunch of gibberish right now. First try explaining your actual problem, please. Otherwise we won't be able to help you the slightest.
I'm hosting my music bot in heroku and the log keeps giving an error about ffmpeg
Yes
Bad, not really a good platform on that
How do i get my bot on the site>
I remember I had issues with Heroku and ffmpeg and such before
(but that was before I bought got a VPS)
Sorry to break it to you, you need to
The free services are quite bad
Ok
It doesnt need to be good at all the vps
Anyways you should probably post an error
But I know Heroku has some issues with ffmpeg and other stuff
and also how do i get my bot on the site>
But I just want to know one thing: does heroku run python?
yes
How?
Heroku is a PaaS
it can run close to anything (in languages)
close to anything overall is a bad statement
@elder rapids How do i get my bot on discordbots.org? π
magic
nah fr
Click on create bot
Where kek
Top of the site
It would get my problem solved
any free host*
But how do I run python?
Trust me I learned the hard way about free hosts OwO
By getting a vps
Yes
Ok
yes
no
Or just running the .py file with a process manager
Ew
ew
Getting windows vps is shit
Windows VPS is terrible and expensive
for running a bot
No
Linux pls
i got one for like Β£2
Linux pls
:/
Someone who doesnt know how to use heroku isnt going to be able to use a linux vps
π€·

Linux is easy to understand
Heroku is still a command line VPS that's linux
There's always Google you knoe
It's not that hard to learn PuTTY
Know
No
Don't forget transferring files
π
FileZilla is easy
It's easy to do that on Linux
Ik
With filezilla
Especially easy with SFTP
cd bot/dir/
pip install -r requirements.txt
python3.6 bot.py```
python == 2.7
python 3 == 3.5 or something
python3.6 == 3.6
Ever notice the original people that asked questions and talked about opposing linux VPS left
Yeah
means we won
im back
Lmfao
i went for a piss
i never said windows vps is better
i said its ez
'er
ez'er
Linux is easier
lol
Tbh
But its not tho
It is
Linux is easier
It also has a bit more control in terms of security and other stuff
Linux is very good with that
It only took me 10 mind of googling to figure out how to set my bot up in Linux
What os do you have
I have windows
personal
On my personal
Why would you use windows if linux is better?
Try Linux for a week
Because linux is shit for a personal computer
arguably
I would try arch linux
nah
But im too lazy
Aeth uses linux all around
Linux is definitely not for everybody (regarding personal machines), but for some it can be far more powerful than windows
I use windows for my games
Yus
That's mainly why
At least Aeth doesn't argue crazily about it
And also I don't like how the Ubuntu top nav is
Then dual boot
While we are in the topic of Linux dual booting, can I dualboot from an external hard drive ( Ν‘Β° ΝΚ Ν‘Β°) 
Arch, Ubuntu wat
a heavily personal choice @topaz fjord
Wut do u use
I use Arch on my PC and laptop(s), Debian on my VPS'
How much space would you recommend for it
30gb
Okai
learn javascript
Ik javascript
no you don't
I dont quite understand it tho

.setAvatar() accepts a string, not just the link alone
https://discord.js.org/#/docs/main/stable/general/welcome this might help
^
its a magical thing called the DOCS
thanks
its a magical thing called the DOCS
ik ik
yeah the docs are magical

and they actually are
theres the set avatar
at some point i need someone to help me manage data although my bot runs on heroku..
then move from heroku, it's shouldn't be used for bots anyway
Can anyone help me? I got a (probably) dumb question.
shoot
How to get if the channel is NSFW? I used message.channel.nsfw but it only returns true if the channel was created AFTER the bot was added.
node.js btw
if(message.channel.name === "nsfw")
``` I think
no
no
Idk
π
I tried
but what if the channel is called "porn" or "hentai"?
i used message.channel.nsfw but it says its not nsfw unless the channel was created after the bot was added
π
try Seb, rule34 <term> in #306891333405245450 @knotty steeple
no u
how old do you think i am
no
..
@knotty steeple
then they cant do checks
argh so twiggered
Either the code for that is very bad or your lib/version is shit but i put my money on bad code

Imma fix it when I get home
got API to work :))) heheh
Can anyone tell me some non-meta commands
wat do u mean
Like some commands for my bot. It got denied because of no non-meta commands
Those who are experienced at application creating and mobile developing I wanted to share my idea I got while taking a shower it might be unoriginal but I never heard somebody think about this.
Desktop and Mac / Mobile application/software to control your bot stuff if somebody likes that idea. π
Ok
nice blank name
Very
Yes it is
I thought my phone was going crazy with that name XD
I think u need small kind of database to store all other server prefixes
^
Oh ok. I'll get it looked at now
data base that stores all the server ids and the prefix
Yeah
i do it
If I knew how to do it...
I want help actually
visit the support server for the lib u are using then
I dunno why but I tried making a good help command (I failed miserably)
I just started JavaScript and my teacher wants to look at my script
Ok. I think I did enough here
I think our conversation is changing kinda off-topic lol
So I'll get it looked at and see where it takes me
Yeh. Nvm. I wanted to know how to do it, it kinda makes sense though
I found a tutorial for custom prefixes its for discord.js
It uses quickdb
Ill send you it in dm
Ew quick.db
slow.db
Lol
I think the tutorial video I sent him also works with different dbs
I watched it. Will do steps
math
rip
true tho
ye
i need help making my bot
with Detailed description too short. Minimum 300 characters. Add your commands. Spaces or empty spaces are not counted.
No ID given
No library selected
No prefix given
No brief description given
sorry wrong thing lol
ok
Lol
are you really having issues filling out a form
Detailed description
xD
How can I make so that if someone writes supercoolsite.com/test.html it just redirects to supercoolsite.com/test?
what do you have on your server?
for nginx you could use try_files $uri $uri.html =404 or something like that
Ok...
Do you know .js? @quasi forge
Hey, so.. My bot is kinda old. ^_^ And it relies on roles.. 9:
Ok
How do I make a welcome and leave message?
library
@violet wyvern store the channel id and server id the owner chooses to set, when a member joins, if the join is the server, get the channel id and send a message, same for leave
then provide the code and error?
Sure.
Well, this is my code.
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @solemn obsidian
pls
in d.js, can you edit an embed with msg.edit?
This is my welcome code: module.exports = member => { let guild = member.guild; guild.defaultChannel.send(Please welcome ${member.user.username} to the server!);};
Leave code:
module.exports = member => { let guild = member.guild; guild.defaultChannel.send(Please say goodbye to ${member.user.username} we will miss you!);};
Default channel is deprecated.
how? like this?: msg.edit({embed:embed});
Colby_Scripts - Today at 4:24 PM
Sure.
Well, this is my code.
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @weeb(edited)
Cough anyone can answer this.
what help do you need?
Colby_Scripts - Today at 4:24 PM
Sure.
Well, this is my code.
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); Can anyone help?
also stop posting that
No one is helping me.
@shy verge i will code block u
blocked
provide the full error
The error is r in roles
like that stack trace
PASTE THE ERROR
I can't..
@shy verge its ok bb
then remote into that fucker and copypaste the error
Hello .
then we cant help you without it
I did!
client.elevation = message => {
let permlvl = 0;
let mod_role = message.guild.roles.find('name', settings.modrolename); @weeb(edited)
saying that the error is in r
oierabvueyrbvaoe
That is the error the code.
isnt a full error
thats not the error
WHAT THE FUCK IS THE FUCKING ERROR
R in roles
that is code not error
It is when I use it in DM..
THE FUCK DOES THAT MEAN
Ikr
Yea, so how do I block the DM..
π€¦
what do you want it to do @sick kraken That would be a better place to start
what he said
Hey
if(message.channel.type === "dm") return;
is that right?
I wanted some help w/ java and php
@blazing stag Yes, I would like the bot to only work in servers.
@shy verge that should be right
ok cool
also for future reference. This is what a error looks like
stick that in your message handler
unhandledRejection:
ReferenceError: fes is not defined
at Eval.run (C:\Users\weeb\Desktop\TurtleBot-Class\cmds\system\eval.js:25:17)
at Message.run (C:\Users\weeb\Desktop\TurtleBot-Class\events\message.js:48:15)
dont need help
Learn the Lang first
dont try to help me
replace message with whatever your message object is called
also what Sei4or said
Nevermind this server is dead to me.
Well it kinda isnt out fault
If it is just everyone screaming at me..
your not providing us with what we need
I don't care about it.
paste us your message handler
well we were trying to help you actually
in a hastebin
Anyways the code worked.
It just kinda glitched.
lmfao
Does anyone know java and php?
i know php
Colby check your DMs
Send to author
cause you're in a dm
Oh thatβs dm
(β―Β°β‘Β°οΌβ―οΈ΅ β»ββ»
lol
β¬ββ¬ γ( γ-γγ)
well done
its in the cyber security field.
oh boy i love you already
(:
.net is literally the best thing ever
heheh yeah agreed
Yes
Ok it's development 
Of my job. (:
No..
#development ahem ahem
I write when I apply in Discord I'm 13 so people don't think i'm weird xD
please #memes-and-media
im trying mesg.embeds[0].fields[0].value = mesg.embeds[0].fields[0].value + msg.author.username; but that doesn't update the embed
that is a weird way to do embed field values
do you know how to update embed fields?
yeh
but the docs say it takes a string
not an object, but can u use embeds in msg.edit?
yes
oh. ok :p
if not my ping cmd would not work properly
got it
@languid dragon Has anyone looked at my bot?
no
tfw pinging admins to look at your bot
how old are you?
^ yeah
i'm 2 and a half
@earnest phoenix we need your legit age
ok but serious question, tell us your real age, you could get access to a secret channel
no thancc
u also get free bot hosts
"what i'm just a kid"
like i do
oh ok
which i consider a kid
you're good
ok well u get no free bot host
@shy verge 22 
https://hastebin.com/agocugayib.php I'm trying to use the post info that dbl should send to my webhook but probably isn't
i don't know
so im doing this:
const bot = new Discord.Client();
bot.on('message', (message) => {
switch (message.content) {
case "Hi":
message.channel.send("Hi");
break;
}
});```
and it says Hi a bunch of times anyone know why
no
if you say Hi it says hi about 4 times waits 5 seconds and repeats
oh i know why
^
it's responding to it'sself
167.99.196.89 - - [12/May/2018:01:14:47 +0200] "POST /webhook/index.php HTTP/1.1" 200 332 "-" "DBL"
:|
ip i see
It's DBL's IP
how do you set it not to check its own messages
@acoustic juniper also instead of making it say Hi, which triggers it make it say something else
if(message.author.bot) return;
^
@knotty steeple get rekt
who uses the yandex api
@topaz fjord where would you put the if(message.author.bot) return;
so after the bot.on or before?
after
so like this
const bot = new Discord.Client();
bot.on("message", (message) => {
if(message.author.bot) return;
switch (message.content) {
case "Hi":
message.channel.send("hi");
break;
}
});```
thank you
does anyone know how to use the moment package?
yus
Anyone using .py lib that could help me making a !ping command XD???
like a ping command that gives you latency?
How do you check if someone with a specific role sent a command?
is your bot confined to one server or do you plan to expand/scale?
one server
just checking for ownership though i'm using Discord.js
Discord.js
you can do message.member to get the GuildMember
and GuildMember has the property roles
if(message.guild.ownerID == message.member.id) doStuff();
then you can use .filter on the roles since it returns a collection to find if the user has a role with a specific name
wait
are u trying to find if the guild owner id is the same as the message author?
yup just to find the owner
the above codeblock will work
so do what @shy verge did
ok it works
- every time a user connects send large key to everyone connected (key = just text)
- every time a user connects all connected users check if they have the key, if not, ask the user that just joined for it
in terms of efficiency, what would be best
take into account that the 2nd option might bombard the new user with requests, if you have a better idea pls share
so if they have no key they depend on that one person for the key
Just gonna post this here```py
def get_default_channel(self, guild):
channels = guild.text_channels
text_cha = [x.name.lower() for x in channels]
lines = ["general", "lounge", "chat", "hangout"]
words_in_line = []
for y in lines:
words_in_line += [x for x in text_cha if y in x]
k = []
if len(words_in_line) > 0:
for x in words_in_line:
channel = discord.utils.get(channels, name=x)
perm = guild.me.permissions_in(channel)
if channel is not None and all([perm.send_messages, perm.read_messages, perm.embed_links]):
k.append(channel)
channels.remove(channel)
if len(k) == 0:
for x in guild.text_channels:
perm = guild.me.permissions_in(x)
if all([perm.send_messages, perm.read_messages, perm.embed_links]):
k.append(x)
if len(k) == 0:
return None
else:
return k[0]```
I feel proud of this, anyone can use.
what does this do?
for y in lines:
words_in_line += [x for x in text_cha if y in x]
This will never run
nevermind
me being stupid
It works
for me
It finds the default channel in a server. First, it sees if there any servers in the lines are in any channel names. Then it will remove the channels if it doesn't have read msg, send msg, and embed link permissions. Now, if it doesn't find any channels with the name or if all those channels don't have permissions, it will do the same thing over again for all the channels in the guild not the filtered out ones. Once done, if there are no channels then it will return None otherwise it will return the first channel in the list.
@quasi hearth
interesting... seems dangerous
Not really. It just finds the main channel.
oh, i thought you meant that it deletes the channels lol
https://hastebin.com/umitopomeq.js
It says fail even after 1 minute
maybe its because you keep adding 1 minute?
then what do i do to fix it?
lol wot
add some kind of conditional to make it not add 1 if there already has been 1 min added, until it says test, where you toggle the conditional
like this? https://hastebin.com/dusodumujo.js
...
var a = moment.utc().add(1, 'minute');
setTimeout(() => {
var b = moment.utc();
if (b > a){
console.log("Test");
} else {
console.log("fail");
}
}),61000);
you can add 1 more sec
just in case
unless he wants it to keep pinging with "fail"
He doesn't understand his code rn
When you have var a = moment.utc().add(1, 'minute'); and var b = moment.utc();
You basically tell node to set 'a' as 1 min later and 'b' as the current time
So ofc a > b and b will never > a
I removed the ) after 61000 because it caused an error
oh wait some edits
nuuu
var a = moment.utc().add(1, 'minute');
setTimeout(() => {
var b = moment.utc();
if (b > a){
console.log("Test");
} else {
console.log("fail");
}
},61000);
Now shld be ok
@floral stone Seems a bit voodoo magic like
Alright, I have kind of a wide question/topic to talk about in discord.js.
I want to access the Audit Logs in Discord and log edited messages and more, but I don't know how to do that. I already got it logging the messages that get deleted.
The things I want to log are the following:
- CHANNEL_CREATE
- CHANNEL_DELETE
- MEMBER_BAN_ADD
- MEMBER_BAN_REMOVE
- ROLE_CREATE
- ROLE_UPDATE
- ROLE_DELETE
I already got the MESSAGE_DELETE thing going on
then u listen for the events
what
whaart
So I want to use the Audit Logs, because those give more info and didn't return any errors :3
Hmmm
I honestly have no clue on how to do this, because this is completely new to me on d.js
tbh just use events
events don't give promise errors
that means its your code
Β―_(γ)_/Β―
Oh well Β―_(γ)_/Β―
Hey guys! Im starting a site and i need coders! DM me if interested!
hmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmmm
thoughts on custom network packets format
[Pigeon][--][--][--------][+]
^ ^ ^ ^ ^
| | | | |
| | | | Packet data (binary)
| | | |
| | | Packet size (long)
| | |
| | Packet type (number)
| |
| Format version (number)
|
Application name
What about sender, receiver? π
yea adding that rn
receiver isn't necesarry
receiver is whoever has the packege
xd
I mean Network Layer
Wait, so you are using Ipv4 or something I assume?
tcp
yea
here it is with the sender:
[Pigeon][--][-------------][--][-----------][+]
^ ^ ^ ^ ^ ^
| | | | | |
| | | | | Packet data (binary)
| | | | |
| | | | Packet size (long)
| | | |
| | | Packet type (1-2 digit number)
| | |
| | Sender (id)
| |
| Format version (1-2 digit number)
|
Application name
what's the max of a long again?
let me look it up
But hold on, if you are using something like IPv4/6 packets anyways, they already contain sender, receiver, TTL, etc.
I would not reinvent the wheel to be honest
it's like saying, sending json data
then how would I communicate with my application?
Client <-> Server? REST for example. Well, depends on what you want to do. But there are plenty of things to communicate.
I'm talking about
Websockets, Webhooks
lan tcp
Still works over the TCP stack. The IPv4 packet for example contains the information that it is a packet with content that contains more specific details.
I'm using that instead of json
there's a reason to use that format instead of json in my situation
since the packet data may be huge, I'd have to parse the json object, then access it
parsing is another step
get it?
you're understanding it wrong
it's not actually a network packet
it's the content of it
it's just formatted
Ah
ye
π
I just call them packets
hehe
like actions
if I used json
then I would have to parse it
and since the data property in the json would be juge
it would take even mor etime
inb4packet payload is json in binary (bytes)
so I just go right into the start of the data
yea I mean when the receiver recives the packet
then he needs to parse it
if its in json
why not just keep it as binary
Why not just use ETF rather than making your own weird system π€
If you need other headers you can extend what ETF does then

ETF is a known system for what you're kind of trying to do
never heard of it
In fact Discord supports ETF websockets
interesting
ETF is Erlang External Term Format
It's a binary (bytes) communication system like what you want
Because it's kind of like what you're doing
Might as well use something that already sort of exists or use a protocol that exists for doing said stuff
not really
Standards > Custom
It's only for my application
Personally I would use something like ETF rather than custom even if it's for personal use
extending that would only add unnecesarry headers
What do you mean not really
in 99% of the cases you don't need to write your own implementations
I already have the perfect model for my application
yea remember it's only for my application
I won't be doing any external communication
You'll add more of a headache trying to setup your own protocol implementation




