#development
1 messages ยท Page 1499 of 1
then why....?
ok?
Hes just showing what he coded in 38 secs
u are doing great
fairly certain its copied code from the guide but okay
๐ฟ Good luck on "becoming better than MEE6 i guess"
??
I made a better bot than mee5 already
can anyone help me ๐
with?
embed.thumbnail.url: Not a well formed URL.``` my code: ```.setThumbnail(`https://vacefron.nl/api/ejected?name=${message.author.username}&impostor=true&crewmate=red`)```
Is this your alt @old cliff
this
how did you know they coded this in 30 something seconds they literally only showed the code
And its not in here
?
these are the docs ;)
ik how to set thumnail
The URL you provided as a parameter to that method is invalid
oh okay
to make it valid
encodeURIComponent
<Wait wtf is the difference again>
Use canvas
What
ty :d
np

๐ฟ
Nothing
i have problems with it! after o2auth auth i get in my url this data code=PSIfVb40fayRxIJGbLUnFeopE3c*** how to get identify from it?
hi, my dumb brain isnt working again for some reason
does anyone know why when i do await lost.createMessage(guild.logs.dashboard.channel, 'hi', { title: 'hi' }); nothing happens?
im an idiot nvm me
don't strikethrough it if you actually need help
i dont need help anymore
ok
i maked it, but code stop works
huh?
code stop works 
what is that language
oh my fucking god
you just copypasted it from the doc site
๐
did he paste python in js?
LMAO
Lol
I can't find the rules that specifies that we can't make a command public containing a discord bot's server informations :O
i know we shouldn't do it but i don't find it :-:
shouldn't have expected anything from a person with a novaskins avatar
and where i can find this code in js?
you don't
just implement it yourself
the example is there as a guideline to tell you what you're supposed to do
hence example
Can I give my bot Admin Permission?
Bot gives Missing Perms err when channel is private
Any views or suggestions?
handle errors properly
If your bot hasn't been given rights to view a private channel, then it's not meant to see this channel.
You should probably just ignore channels the bot doesn't have perms to.
maybe look into passport and passport-discord, they can help you with the oauth2 stuff
I already gave all required permissions
But when user makes a channel private and changes permission
Any how sometimes bot gives in one channel Missing Perm err but works fine in another channel
Already handled but cannot figure out What's the name of Missing permission
either role or Read/Write permissions
I used Embed in almost every command
Maybe
handling errors isnt just handling after, its handling before as well.
You should be checking if you have send perms, embed perms and any other perms before doing it too.
Can we check if Role has certain permission or not?
you can check your own perms.
just check if you have read permissions and if you have write permissions (write is probably the one that errors out, without read you wont trigger any command)
which should be all you need
Double checked. I Dm user if SEND MESSAGES is disabled
If channel doesn't has perms I dm user
you already expressed send messages isnt the only perm you use.
what if the user disabled DMs?
you also need embed links to send embeds(which you almost always do)
lol so probably after 1 day
Yup checked
I checked all perms even before executing commands. They work fine and give response too
But this channel permission is creating issue
Imo discord permissions are the worst to deal with
With Administrator Permission bot gives Zero e rr
not all users will give your bot admin
Hm
just require Admin permissions is like Using Java in a stupid way.
if this is your guild just take use of discord's view as role feature and view your guild with your bot's roles
you'll quickly find where you messed up permissions
I'll redesign command handler again. With Better permission handling.
should I include send_messages and read_messages in required permissions 
Yes
there are people who will mess it up if you dont
just send message imo
Like @commands.bot_has_guild_permissions(send_messages=True, read_messages=True) but that may just be a waste
since you wont get the command if you dont have readmessage
^
one thing ive learned is, design your stuff that even a Donkey can use it. if you dont babysit every step someone somehow at some point will fuck it up.
Realized
can someone translate code to js? i trying it and still not works! API_ENDPOINT = 'https://discord.com/api/v6'
CLIENT_ID = '332269999912132097'
CLIENT_SECRET = '937it3ow87i4ery69876wqire'
REDIRECT_URI = 'https://nicememe.website'
def exchange_code(code):
data = {
'client_id': CLIENT_ID,
'client_secret': CLIENT_SECRET,
'grant_type': 'authorization_code',
'code': code,
'redirect_uri': REDIRECT_URI,
'scope': 'identify email connections'
}
headers = {
'Content-Type': 'application/x-www-form-urlencoded'
}
r = requests.post('%s/oauth2/token' % API_ENDPOINT, data=data, headers=headers)
r.raise_for_status()
return r.json()
๐

lol
that's just python
i need it in js
Then find code in JS you can copy
that looks like a mix of TS,JS and Py
you were told what to use
they took the sample from the docs and want to directly translate it 1:1 instead of thinking and solving it themselves
i didnt find anything
it's passport with passport-discord for an express server
wait till they realize that python and node have completely different packages
believe it or not, different programming languages cant be "translated" like that.
wait until they try to run js stuff with py
it's actually quite possible
Wait until they realise programming cannot be done by relying on copy/pasting for the entire time.
i know but not out of the box
Never solve queries of people who copy paste
aight imma head out
pip install npm
lmfao
is there a way to fetch the list of users using my bot??
i think you need the guild members intent
yea
just the amount of users or the user object?
i thoght it woud be cool
To just have a list of users? To do what with it?
you just want a count?
yea
or an ACTUAL list of names?
if its just count you dont need intents
guild comes shipped with the memberCount with it
yea
@bot.command(name='servername', help='only vissible to devs')
@commands.is_owner()
async def servers(ctx):
await ctx.send(bot.guilds)
ckient.guilds.cache.reduce((acc, g) => acc + g.memberCount, 0);
Awww you're python
i ran this it worked
oh well
bot.users
No
that isn't fetching
async def servers(ctx):
users = 0;
That is cache dependant
sum([g.member_count for g in bot.guilds])
g.members
async def servers(ctx):
users = 0;
for x in bot.guilds:
users = users + x.members
break
await ctx.send(users)
g.members is also cache
that SHOULD work?
@shrewd creek read what I said
sum is probably better
@opal plank that is also cache dependant and also members is a list
remove ;
async def servers(ctx):
users = 0
for x in bot.guilds:
users = users + x.member_count
break
await ctx.send(users)
this i think is valid
Also in python we have list comprehension which is pog
List comprehension is goated
@opal plank I already gave the best answer
for works in break no?

yeah, just i wrote that by hand
not gonna bother typing indentation by hand, use ur IDE
another reason i hate py, indentation
i dont get it
You can remove the square brackets doe
@bot.commamd()
async def userCount(ctx):
users = 0
for g in bot.guilds:
users = users + g.member_count
await ctx.send(users)โ```
@earnest phoenix 
wait, that actually worked?
i think functools has a reduce method
Isnt that inside the for loop
Why are you sending inside loop lmao
Yea
you could also use lambda with it
@opal plank bruh
ig
That would send a lot of times
Lmao
Move it outisde the loop
aparently
ah yes
Rovi's answer is probably the best
sum([g.member_count for g in bot.guilds])
@earnest phoenix mobile moment
learning python by solving python questions
@slender thistle hahahaha git rekt scrub, i know python and heres the proof
when do your python classes start erwin, need a good teacher 
at least we don't have ++
wait python doesnt have ++?
No
no
o
as soon as shiv steps down, im now the maintainer of the py lib 
clearly im in a position to do it
Why is there random break doe kekw
@earnest phoenix I asked too lol
Teal doesn't suit you Erwin
doesnt break stop for loops statements?
Yes
for x in thing:
something
else
blac
multiple lines
break
Just try it like that if you have eval
No
that should be run one very iteration no?
invalid character
Else block would be executed if for doesn't break or return
@shrewd creek no don't use that one
tho len(bot.users) would work fine 
not break as it to stop the loop, break as in to define wht multiple lines the loop is meant to run
sum([g.member_count for g in bot.guilds]) this literally works
@opal plank indentation
ik

i explained before
is js break and py break different?
sum(g.member_count for g in bot.guilds)
pain
surely py has some linter or some shit
Pep
i hate forced indentation
Or flake
break in Python and JS are the same.
pep8 
But loops are a bit different in Python
pycharm harasses you for separating two pieces of code with 1 line instead of 2 
I mean after 5 years of python I just indent things correctly anyway
Lazy
Don't code it then look
You'll get used to indentation. You already indent all your code by 2-4 blocks
1 tab โ
4 spaces โ
Lol
angery
Kekw
Space gang
Pain
Magic ```py
for x in range(5):
print(f"x: {x}")
else:
print("Yeah")
tabs gang
Wtf what?
try running it
big yikes, i'll go hide in my TS cozy troll cave while yall praising forced indentation
bye
My bot hitted 11000 members lol
Indentation as a scope isn't that bad Erwin
Users*
I don't praise it, it's just not bad. And it's a good thing to do anyway
arhhh it dosnt work for me
anyway i think its not good to be fiddling with members list
smol flex
What, do you write with mixed 2-3-4 indentation for every block? omegalul
Dude, why you so mad
thats the one thing i hate
Forced is not always bad.
You don't even code python
i don thate python, i have indentation in python
How?

i have something like this i want the link to only be on "click me" how can i do that
You could omit braces in all your JS code but you won't do that since it looks ugly
@earnest phoenix lib?
ight
thats the title
actually
@earnest phoenix js orpy?
yeah if its title its different
for the title you have to set the embed url
you need to set url
Yea
python be like
Lawl
if i dont want indentation, let me fucking run my code without indentation
(for the record that's not actually py)
fibonacci indentation has joined the chat
I never used python rather than making a hello world
I think you can have negative indentation in python lol
whoa
Not tried myself but I saw it somewhere
That indentation sucked if it was really py tbh
x to doubt
if i dont want to use spaces or have any sort of sanity, let me do this
it doesnt give you the option
its always forced
how many spaces u use is up to you
good luck minifying python
jQuery trash tho
but its the lack of option that i hate
Erwin I assume you're joking so I don't think it's worth arguing
im not
i dont like the way python indentation is forced
oh well that's sad
Theres a one line bot made in py
period
Brb
lambda is cool tho
bad thing is i cant use multiple statements
Wdym
Beautiful
and vscode KEEPS CHANGING MY LAMBDA TO FUNCTIONS WHY
wait how would i put it in .setDescription?
Bruh
Tf lmao
Cursed
@earnest phoenix that's called programming
I don't know what to say 
That is python
ik

*bot.guilds gets me the name and no of ppl in all servers in which my bot is in
delete doesn't take a number as parameter
Bot doesn't even have guild kekw
actually
so techinically bots.guilds.members should get me names ryt
Yes Erwin
why the fuck am i even helping for py? i dont know py
how do i get rid of this error
i should shut up when i dont know about something
@earnest phoenix whatโs the error lol
No that's not how it works
that's not an error

that's some code
so how do i get it
firstly you need to put it in quotes
that isn't a string
What are you trying to do
ok gg
its fixed
im dumb
cool
get names of the users of my bot form all the srevers
if thats somtin possble
Youโll need the guild members intent for that if you donโt have it turned on
[i.name for i in bot.get_all_members()]
Or [a.name for i in bot.guilds for a in i.members]
Kekw
you need to have the timeout as {timeout: 5000} (i think, you'll have to check up on the docs)
that's still cache reliant, no?
Yeah
Yeah this would return unique ones
The only way to do what he wants is to first chunk all guilds and stuff like bruh. Why do you want to do this
have you tried reading the error
and what does the error say
Don't use get_all_members unless you need the guild object kekw
and why do you think that is
did you get it
lmfao
yes omg
@bot.command(name='infoserver', help='only vissible to devs')
@commands.is_owner()
async def infoserver(ctx):
await ctx.send(bot.guilds)
how do i put it like this
sry if i am being annoying its my first bot
Kekw just send it literally
because send is a promise
bot is still defined I'm sure
you need to resolve it by either awaiting or using promise then pattern
Yeah but I like ctx.bot more
@shrewd creek use this
Feels secure and also makes it easier to copy paste to any command
thats what you want right
@bot.command(name='infoserver', help='only vissible to devs')
@commands.is_owner()
async def infoserver(ctx):
await ctx.send [m.name for m in bot.users]
like this??
What
You need brackets
Well that's indeed easier to port to cogs
([])
erwin we need you, theres a py question 
Also I'm sure that soon if not now, that will fail because the string representation will be over 2000 characters
Hence why you use jishaku
@gilded olive I just truncate my evals lol
i just throw big responses from eval in a hastebin and then send the link of the hastebin instead
Why use jishaku when you can paginate yourself 

Doing something thats already been done
Everything at your fingertips from one line of code


field titles can't have that
i am only geting mine and my bots name
@earnest phoenix
users aren't in cache then
enable server members intent
that still won't get you all users
only the cached ones
are intents enbled in your code as well
intents = discord.Intents.default()
intents.members = True
and pass intents=intents into your bot constructor
noe i nver used this lines of code
I see
tf
?
nothing
how
const Discord = require('discord.js')
const client = new Discord.Client()
const fs = require('fs')
const { prefix } = require('./config.json')
client.commands = new Discord.Collection()
const commandFiles = fs.readdirSync('./commands/').filter(file => file.endsWith('.js'))
for(const file of commandFiles)
{
const command = require(./commands/${file})
client.commands.set(command.name, command)
}
console.log('index.js ready!')
client.on('message', message => {
if(message.author.bot) return;
if(message.content.indexOf(prefix) !== 0) return;
const args = message.content.slice(prefix.length).trim().split(/ +/g)
const command = args.shift().toLocaleLowerCase()
if(command === 'kick')
{
client.commands.get('kick').execute(message, args)
}
})
@earnest phoenix
I searching mods of my disc bot
Dm me
Pass it as second argument, the first could be zws or something
stop using short form pwease LOL
zws??
Hello help me Please I'm re-describing my bot to make it more welcoming and I use it <th></th>and I would jump odes line I know it's <hr>or <br>but when I try it doesn't work
Zero width space
ok
Who wants
:D
.-._.-.
.---_---.
if you would read the rules you would know self advertising is not allowed.
.________.
also recruiting
i have no idea what you meant in that message
you want the table to enter a new line?
Ah.*.
cry too ruthless
Nan, I want to make a space I don't want it to be all sticky
add margins
Margins.-.
?
Ah okey thanks
Iโm shit at css and even I know that
sum([g.member_count for g in bot.guilds]) this works
[m.name for m in bot.users] but this dosnt it displays mine and the bots name
dude my stuff is not working
we told you what's the issue
as to why they're different; member_count is a property returned by discord and does not rely on cache
users does
oh
you have to do the comparison for every id
you have to message.channel.id them all
or else itโs just if (comparison || true || true || true || true)
^, right now you're telling if channel id is this OR this string is valid OR this string is valid OR this string is valid OR ...
or you could make a custom function
another way is also chucking the ids into an array and then calling includes on the array
that does that ^
let allowed = ['id 1', 'id 2']
if channel.id includes allowed etc
basically like dat
yea
except it isnt real code kinda
wait wouldnโt it be if allowed includes channel.id
uhm, what do i do if the token to my bot isn't regenerating?
Are you regenerating the token from the Bot tab and not the client secret?
Developer Portal > My Applications > (Your Bot) > Bot > Token > Regenerate
When you hit the Regenerate button does it say "A new token was generated!" above.
Yes
you need to put the new token into your bot's config
and you're replacing the old token with the new one afterwards
I tried that, i tried it like 5 times it's still offline
h
The token isn't regenerating ;-;
I'd ask you to record a video of you regenerating the token, but they're meant to be private.
Yeah-
I also dk how to rec on laptp
laptop*
old bot, i gotta delete it, but here is an example
just look at the token
its regenerating
it is?
yeah
oh shit nvm
look at the last letters
lemme try it again, with a diff one-
istmfg if it don't work i will cry
WHY DOES KAGANE HATE ME
How did he do that?
how?
someone explain to me how the js fetch works?
It makes a HTTP request to a URL you provide
and its async since the js is client side?
if (message.content.startsWith(prefix + "setprofile")){
const args1 = message.content.slice(prefix.length).slice(4).trim().split(' ');
const list = client.guilds.cache.get("734123033782124575"); //change this to your own server id. > right click your server inco > copy-id!
fs.appendFileSync("./server.txt", member.user.username + " " + args2.join("\n"));
const exampleEmbed4 = new Discord.MessageEmbed()
.setColor('RANDOM')
.setAuthor('Server Moderator')
.setFooter("Command created for your community!")
.setDescription("The current server name: " + z)
.setThumbnail("https://media.giphy.com/media/phJ6eMRFYI6CQ/giphy.gif")
message.channel.send(exampleEmbed4);
```why is this returning: "member not defined".
and how would i get the response
I'm not sure what it being client-side has to do with anything - the user's machine makes the HTTP request
o ok
Hello i need help with my bots
like if the url responds/returns like a {code: 200} or a {code: whatever} i can get that?
is an radio bot 24h/24 and somes times he stop playing with this errors
of course you can
const res = await fetch("...");
res.status; // status code
res.json() // Promise which resolves into a JS object
uhh how do i set the status? i would return it in a dict form?
like a {code: success} | {code: fail}
um... you make the request, you don't send the status
the js makes the request with fetch
and the link/url
like it goes to example.com/request
the url returns {code: ok} or {code: fail}
how do i get that?
or i can return it as the code too
like the actual status code
yeah look at the snippet I sent you
If the response returns the JSON {code: ok}, you have to do
const json = await res.json();
json.ok```
like the http code?
res.status gets the http code
ok ty
Don't listen to more than 11 events of the same time... I think the error message is clear
how can i fix that ?
it says
because i have already set max listeeners 99999
(i use shard)
why do you need more than 11 listeners
is a radio bot 24h/24
yeah but what do you need so many listeners for?
with sharding system without problem without shard
uhh
i will see
you
wait
If you need more than 11 listeners you should rethink your implementation
in ShardResume
but @crimson vapor why without shard i don't have any pb
and with shard i need to increase the max listeners
my shardresume event

and when a shardresume a setMaxListeners to 9999999999999
that for set the max listeners
- move that above
- this is kinda shitty and a waste of memory
youre creating a new listener every what 10 seconds
thats a memory leak kinda
so how i need to do ?
im not sure why your code is like this, so idk
but if you want to get rid of the error, move the ee.setMaxListeners(9999) just under const ee =
million no
You listen to the "error" event for every guild you have EVERY TIME A SHARD RESUMES. And you don't do anything inside the event
that wouldn't work?
no you're supposed to tell them to not use setMaxListeners()
yes it's all in a setinterval
you're literally making a memory leak
he's creating the event emitter too... so the only one who can emit the event he's listening to is him
Any way to make raw bytes into an image without creating the image
just sending to discord
So like raw
if you're thinking of raw as in RAW the format
i don't think discord displays RAW
"{'type': 'Buffer', 'data': [137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0
this is what I got rn
and that tells me absolutely nothing
@bot.command(name='botusers', help='only vissible to devs')
@commands.is_owner()
async def botusers(ctx):
await ctx.send ([m.name for m in bot.users] )
we told you what's the issue
as to why they're different; member_count is a property returned by discord and does not rely on cache
isthere any work around to get the data??
what are you doing
because this is an https://xyproblem.info
Asking about your attempted solution rather than your actual problem
Im asking to turn the images bytes into an image I can send to discord without having to create it on hdd
if (message.content.startsWith(prefix + "setprofile")){
let member = message.author
const args2 = message.content.slice(prefix.length).slice(10).trim().split(' ');
const list = client.guilds.cache.get("734123033782124575"); //change this to your own server id. > right click your server inco > copy-id!
fs.appendFileSync("./members.txt", message.author.username + " " + args2 + "\n");
message.channel.send("**Your profile has been set!**");
```
Upload the buffer
why is my args showing , after each word
because you aren't joining it
so .join("")
I tried to send image.buffer
Wait, you're splitting and joining it back
dafuq
Just remove .split(' ');
Where the condiments at
How did you send it
message.channel.send({files: [image.Buffer]});
and, did you get any errors
Cannot read property 'pipe' of undefined
and image.Buffer is "{'type': 'Buffer', 'data': [137, 80, 78, 71, 13, 10, 26, 10, 0, 0, 0 ...
<Buffer 89 50 4e 47 0d 0a 1a 0a 00 00 00 0d 49 48 44 52 00 00 03 20 00 00 02 58 08 06 00 00 00 9a 76 82 70 00 00 00 01 73 52 47 42 00 ae ce 1c e9 00 00 20 00 ... 25443 more bytes>
that is image
so image is a Buffer object?
guys how can i add this in my profile ?
image prints image is the buffer
pardon?
hello
image.Buffer isnt a thing
try message.channel.send({files: [image]});
if (message.content.startsWith(prefix + "profile")){
allItems = fs
.readFileSync("./members.txt", "utf8")
.split("\n")
.map((x) => x.split(/ +/));
console.log(allItems)
let filtered = allItems.filter((x) => x[0] === message.author.username);
let final = filtered.map((x) => x[1]).join("\n");
const exampleEmbed4 = new Discord.MessageEmbed()
.setColor('RANDOM')
.setAuthor('Server Moderator')
.setFooter("Command created for your community!")
.setDescription("**Your set user description: **" + final)
.setThumbnail("https://media.giphy.com/media/phJ6eMRFYI6CQ/giphy.gif")
message.channel.send(exampleEmbed4);
```one quick question. As you see this command would get the first item in the array, but what if someone inputs a whole sentence?
how would i actually take all the arrays of that user
Itโs discord RPC you will have to write a program and run it on your computer
how ?
liket his
isnt it called SDK for that?
@heavy anchor thx
okay i fixed it but it returns this.. :
Idk Iโve known it an RPC
Didn't someone already tell you
use join
yeah this is on a different part of the code containing arrays
let final = filtered.map((x) => x).join("\n");```
already joinin it
huh
RPC is not rich presence
why you mapping it?
look
if (message.content.startsWith(prefix + "profile")){
allItems = fs
.readFileSync("./members.txt", "utf8")
.split("\n")
.map((x) => x.split(/ +/));
console.log(allItems)
let filtered = allItems.filter((x) => x[0] === message.author.username);
let final = filtered.map((x) => x[1]).join("\n");
const exampleEmbed4 = new Discord.MessageEmbed()
.setColor('RANDOM')
.setAuthor('Server Moderator')
.setFooter("Command created for your community!")
.setDescription("**Your set user description: **" + final)
.setThumbnail("https://media.giphy.com/media/phJ6eMRFYI6CQ/giphy.gif")
message.channel.send(exampleEmbed4);
```
RPC is an old deprecated communication protocol discord used for games back in 2017
i am mapping it to actually control what is set by which user
I know i had deleted it accidentally
it returns the same thing
cxorrect
this
it moved to SDK iirc
anyways, the x[1] returns the first array outside of the member.username
thats why i mentioned
Ah well thatโs the package I used to make one a while back but maybe itโs changed since I made one.
idkd if RPC is decomissioned or deprecated
it might work but it might not be a good idea to use that
@earnest phoenix read what me and cry sent in chat,
do you know the answer?
i do not, you'd have to check with the ddevs server
ddevs?
then why you use it
i dont, thats the whole point
if you want to use it, its better to check on the Game SDK
not RPC, since it might not work anymore
did you... read what i sent....?
Anybody here know why my bots are staying up and reconnecting successfully for a day or two before running into this error and staying offline?
Are you guys like, just not handling the 'connection reset by peer' error and letting pm2 restart your bots or something
Just wondering what other people here are doing bc I'm on latest eris ver and it happens on all my bots on all hardware, Windows and Ubuntu https://cdn.tanners.space/rLt3
Is it finally time to move back to discord.js or something
did you ever fix the issue you had with your command not returning anything?
The thing is, the process stays up because the error is being handled, it's just that the bot won't reconnect to Discord
Yah I got it to work lol
It was the return in the for loop and then there was another bug later in the code
yeeee we're just doing stability testing now bc this keeps happening
data vl = require('vl')
data conf = require('conf')
vl.args('info(require'v')') {
then do {
v(=)c
};
} else {
conf.new('info')
}
data confirm = confirm(action)
execute.vl('type' => ".exe")
making adiscord bot
I only use it bc d.js was p crap for large bots 3-4 years ago
with my programming languager
but I'm wondering now if it's losing it's base/support
maybe
are u just manually restarting the process to restart the bot?
djs is still shit with memory managment
after it errors
caching everything
it reconnects itself automatically
until it doesn't
so I have to end up restarting manually
hm
My code is p simple if you want to look at it
It's a small bot
Discord bot designed for Techies Hideaway https://discord.gg/h2Pgcpfm4g - TannerReynolds/Techies-Top.gg-Bot
this doesnt really sound like a code problem unless ur logging in too many times and getting ur token reset or something
its Eris
oh, idk Eris, it could be a lib error then but /shrug
json db is fine for this because it's only holding info for a single guild
and it won't be holding a lot
ok
yeye, that shareX thingo I made also uses it
haven't had an issue w it yet and it's db is much larger
I only use it for these small and portable things
yeah I understand
Im just gonna make it restart the entire process when it runs into that specific error
lmao
i wonder if json transaction speeds are considerably slower than sqlite queries to argue against even that haha
lmao
crude errors require crude solutions
lol maybe but it's fine, I mostly started using the json db because 1. the code is braindead simple, and 2. you don't have to install anything or run any kind of database server. Just npm install lowdb and it works ez as that. Having it has made doing the support for my ShareX software really easy bc literally nobody has an issue with configuring the database or it failing on them
data vl = require('vl')
data conf = require('conf')
vl.args('info(require'v')') {
then do {
v(=)c
};
} else {
conf.new('info')
}
data confirm = confirm(action)
execute.vl('type' => ".exe")
if(vl-execute < vl-stop) create New folder(
folder.name = log.txt: write{
'log'
} else {
log.destroy()=vl
} then[stop]
);
const start = 'ยฟ'
start.vl() => else {
write(vl) or {
on(vl) => do('x');
}
}
conf.login{
token(
"your token"
);
};
command('npm vl') return;<else>
x=command{
type=x
};stop<wait;
doing a discord bot with your language moment
OMFG
THE BOT STARTS
:O
hello how can i know if my bot is added?
You are now dead

yo
nice
have i shown u the graphs?
nein, what graphs?
dms
What does botCallbackURL mean
are emoji bots allowed in discord, something that does something like this:
?
earlier this morning a user said they weren't
they are IIRC
they are
why wouldnt they be lmfao
unless your source is a discord employee/discord themselves/proficient user
they're probably bullshitting
can anyone real quick give me the fastest easiest way to report number of servers for discord.py
who's the owner of this server. I can't remember
I just collect the emotes
I love emotes
I'm an emote hunter
bot.guilds is a List[Guild], so you can just add up the len(). I don't know if sharding affects the total.
bu hatayฤฑ nasฤฑl dรผzeltcem https://prnt.sc/wg9l26
english only
i know to count
i mean if there is a ready made smtin to send it to top.gg
https://top.gg/api/docs have fun
How do I import this? https://discordpy.readthedocs.io/en/latest/api.html#discord.TextChannel.trigger_typing
import?

I have one already
so... just call that method on it
I already am though?
??????????????????????
Then why do you want to import it
wh a t
That doesn't make sense.
Thatโs what I saw with other people
Then again, I havenโt seen those people in the d.py server for a while...
That's just confusing. What I assume you want to do is call .trigger_typing() on a TextChannel instance.
Yet you say you are.
So what's the issue here.
Download doesn't make sense in this context.
is there any big issues here? ```js
function edit_bio() {
let bio = document.getElementById("bio").value;
let id = document.getElementById("id2").value;
let edit = fetch(https://domain.com/api/profile/edit/${bio}/${id}/);
let resp = edit.status;
if (resp === 200) {
document.getElementById("status").innerHTML = "Worked"
}
if (resp === 401) {
document.getElementById("status").innerHTML = "Nope"
}
}```
@app.route("/api/profile/edit/<bio>/<id>/")
@requires_authorization
def api_profile_edit(bio, id):
user = discord.fetch_user()
if user.id == id:
collection5.update_one({"_id": id}, {"$set":{"bio":bio}}, upsert=True)
return("200 - ok", 200)
else:
return("401 - unauthorized", 401)```
You forgot to await fetch
oh
lemme add that
sry lmao new to js here
how does await work?
wat does it do?
You await a Promise. fetch(...) return a Promise. So, await fetch(...). The function you're using it in must be an async function as well.
See https://developer.mozilla.org/en-US/docs/Learn/JavaScript/Asynchronous/Async_await
More recent additions to the JavaScript language are async functions and the await keyword, part of the so-called ECMAScript 2017 JavaScript edition (see ECMAScript Next support in Mozilla). These features basically act as syntactic sugar on top of promises, making asynchronous code easier to write and to read afterwards. They make async code lo...
uhh i have a question right
this is the "route"
@app.route("/api/profile/edit/<bio>/<id>/")
@requires_authorization
def api_profile_edit(bio, id):
user = discord.fetch_user()
if user.id == id:
collection5.update_one({"_id": id}, {"$set":{"bio":bio}}, upsert=True)
return("200 - ok", 200)
else:
return("401 - unauthorized", 401)```
it requires auth
the user in the page is already authed
but is the fetch basically the same as the user?
cuz its not working
How do i generate a server invite link to a server in DJs?
how do i convert .json to quick.db
you dont
k
you're not granted to receive a member object
discord sends it whenever it feels like it
me knowing that I will never get the cool dev badge again 
@earnest phoenix what do you mean
...exactly what i said
you're not granted to receive a member object in the reaction add/remove payloads
so how do i change it so i can
in fact, reaction remove payload does not send a member object at all, only ids
^
idk i don't do python nor do i understand your code architechture
is there a place where i can learn a better way of doing it
Hi
let prefixes = JSON.parse(fs.readFileSync("./data/guildConf.json", "utf8"));
var prefixkeys = Object.keys(prefixes)
for (var i = 0; i < prefixkeys.length; i++) {
var keyed = prefixkeys[i]
var pfx = prefixes[keyed].prefix
console.log(pfx)
db.set(`prefix_${keyed}`, pfx)
}``` this seemed to work well. hopefully this will help someone else
Wut it do lol
convert json to quick.db
Ok
@earnest phoenix
the way you're doing it right now, at least to me, seems correct
it's just that you're not granted to receive a member object
try fetching the member instead, if there's a guild id present
you can see the structure of the payloads here https://discord.com/developers/docs/topics/gateway#message-reaction-add-message-reaction-add-event-fields
@earnest phoenix so in the guild = payload.guild_id i change that bit
what would i change it to though
Use get_guild method, then fetch the member
Or get it from the cache first actually
i'm new to this so i wouldn't know how to
You already got the guild object, even though it's pretty redundant by using discord.utils.find, you can get the member using guild.get_member(id), the id is from the payload
so in here
The issue is in remove one tbh
on_raw_remove
that
Well, I've told you what to do, so
i dont understand :/ tho
Are you new to python
this sort of python yes
i mean i say this sort i havent used python in years
@earnest phoenix i belive this is what you mean which i did but still doesnt work
Told ya the problem isn't in the add one, but in the remove one
i did the same to that one tho
id isn't defined, use the one from the payload
Have you taken a look at the link I sent
Well id is defined, but it's built-in function
Im using a npm called youtube-dl Im playing the video as it downloads I think and the video will randomly stop playing before the video is over can I get some help
connection.play(youtubedl(v.url, ['-x', '--audio-format', 'mp3'])).on("finish", function () {
connection.disconnect();
})
what function do i use
rate my bot framework: https://lab.aaronleem.co.za/aaron/modular-bot
why should i not use json as a database
I'm not planning on having a readme for a while
not until it's pretty stable
also, I like JS because it's easy to make DI-friendly stuff in
the js part was a joke
ok thanks, that makes sense
๐ค
js doesn't follow DI at all
anyway, the main discord client is at src/lib/services/discord-service.js, with the command handler being at src/lib/services/command-service.js and a test command being at src/lib/services/test-command-service.js
any language follows DI if you can implement it
i mean sure, i do it in my project too
I don't think that there's any languages that have DI as a forerunner
but the implementation is the same across a variety of languages
c#
huh
the .NET framework was built with DI in mind, C# is just a language
What is DI anyway
dependency injection



