#development
1 messages ¡ Page 1721 of 1
Object.defineProperty(exports, "__esModule", { value: true });
^
ReferenceError: exports is not defined

do you have type:module in your package.json?
yes
remove it
Work, but, I want to use import in the compiled code đ
node doesnt support import by default
if you really want to use import in node, you have to enable experiemntal es modules
how 
whats your node version?
15.10
no idea then
for node 13+ its either put type:module in the package or same your file as .mjs instead of .js
if neither of those work, idk
if you want my opinion, just use commonjs
theres no reason to have es6 imports in the compiled files
you already have them in your ts files
đ
I'm trying to get a list of subcommands in a command group. How do I go about doing this?
Here is my current code: https://srcb.in/VJtFpwfmzi
yoo it works
bot.user.setPresence({ activity: {name: 'Hi',type: "WATCHING"}, status: 'dnd' ,}).catch(console.error);}```
uhh
are you on Master Branch?
ok wrong chat
am using replit
lol
Im literally asking you wht version
v12
not whre you code
discordjs v12
moment
just making a music bot using DisTube
did you pull it from github?
if so, activity become activies, and the activites is in array
so that is Master Branch
client.user.setPresence({ activities: [{ name: ';help' }], status: 'online' })
it become like this
client.user.setPresence({ activities: [{ name: ';help' }], status: 'online' })
same F error
nvm
how do i make my bot connect to stage channel
If you use discord.js youâll need to use the master branch
V12 doesnât support it
so I toss this data with this value into my function to change it to a string value depending on the number
its returning this?
@crimson vapor
npm i discordjs/discord.js
after
that
Keep in mind youâll have to make some code changes with master branch by checking the documentation
discord js docs?
i didnt understand a thing
lol
i just wana connect my bot to stage channel
and make him a speaker
F
how i dod that
or can u help me out
i read PR but am dumb
What isnât?
The stages PR got merged by Amish a while ago
Then use the master branch and itâll work if you try making it join a voice channel like usual
I am looking to make a vote skip system, so when there are more than 3 people in the call, users have to vote to jump, but if there is a DJ he jumps straight, in which case he would do the forceskip to force and skip the song.
I currently have this for my bot. What part are you specifically stuck on for this?
I'm stuck in the whole command, because I had done that command before.
Could you tell me what your bot is for me to check how it works?
Yea
That's right!
The problem is that I donât even know how to start the command because I donât have an idea or a basis for how it worked
I have the skip command
And that doesnât make a vote right? Just instantly skips it?
In this case, my vote skip was fully configured for the server owner.
Example: s! Settings voteskip 3
He added 3 votes needed to jump if he had 3 people in the call and if it was two in the call he recognized it as two leaving only 2 votes.
It just skips to the next song, only the author or the DJ can use this command, to avoid playing by other users
you should forget the code for now and just think through and list out the steps that you want to happen
So first up, stop using batch files
This ain't the 90's
if you want your node program to restart automatically the way to go is to use pm2, forever, or nodemon. Personally I recommend PM2
You have to set up each process separately
like pm2 start index.js --name="bot1"
node is a console app so it will block the batch script
pm2 literally registers each app separately and can be controlled separately too
so do i do
here look
npx concurrently "pm2 start index.js & cd ../"
no
and then the rest
You can set pm2 as a service so it restarts itself
so as the bots?

if only i knew pm2 sooner
now its installing
be patient
all the docs are there
yeah it goes back to prompt
now add another
yessir
and if you want to see logs, pm2 logs 0 shows the logs for id 0
they're all saved on disk
you might wanna use --name to give them better names than 'index' of course
you want all of them to be called index? how do you tell which one is which
so how do i make pm2 startup when my pc restarts
init system not found
im on windows
not linux
use windows task scheduler
where would i find that
well entering it there works too
right click in Task Scheduler Library
and click New Folder.... This is for your own custom apps DON'T mess with other task schedules
oh wait expand it first
hold up why the hell are you in the task scheduler now 
One message removed from a suspended account.
One message removed from a suspended account.
no he's teaching you BS, sorry
ok
Go back to the very end of the page https://pm2.keymetrics.io/docs/usage/startup/
then why did i create a pm2 folder
You have to learn to read and think, man, not just rely on everyone else spoonfeeding you answers
So? is there anything in this screenshot that might be, y'know, super valid for you?
Yes. Please, read the docs, don't skim them or stop at the first page and go "but the answer isn't here!"
oh
look, I shows you the windows part at the end you didn't scroll down to see
so it wasn't just linux stuff
no it's not
pm2installer repo
oh
OK
pm2-installer is designed to automate installation of pm2 as a service, particularly on Windows, even in environments without Internet access.
yes exactly
now read all the other sentences on that readme
all the way to the end
its telling me cool features
good, keep reading.
Create the C:\ProgramData\pm2 directory and set the PM2_HOME environmental variable at the machine level
Set permissions both the new npm and pm2 folders so that the Local Service user may access them
don't come here and paste the entire readme
ok
we don't need to read this. you do.
Would replit or Heroku be better for hosting an api powered by Nodejs?
Heroku
Windows and Linux is a good thing to use.
along with pm2
dude stop dilly-dallying around and go do your stuff
ok
you don't have time to confuse other people, just read and do your stuff 
who the f is jesse
don't care, doesn't matter, it's a person that did a thing you need.
Both repl and Heroku are fine generally, but they are free, so you can't exactly scale it without money
That's where VPS and VDS come in play
Yes. In our language we call that "someone's name", or "an author", or, "the identifying nomenclature of the person"
ok
Unfortunately, PM2 has no built-in startup support for Windows.
this readme is pog
PM2's documentation recommends using either pm2-windows-service or pm2-windows-startup. However, both of these projects have some real drawbacks.
ok
i read
now what i do
so wheres the ps1 file
where it starts pm2 when i reboot

what
yeah ok if you don't get simple english I'm pretty done trying to help you
So literally pm2-installer is what you need
and if you just follow insructions and read instead of spinning your head around constantly like that emoji, maybe you'd get things done
thatw ould break my neck
just buy a new one
GUYS
GUYS
i found the pro way
i did it
why isnt my bots starting
someone regenerated my token
pog
it works now
eh
i don't think they would release one for windows if it's not compatible
none of my processes are starting
for all the versions of pm2 i tried
so im sticking with bat file
someones pissed lmao
just annoyed.
why i'm getting this?: Unknown file extension ".json"
where are you getting this?
import langjson from '../../Utils/lang.json';
sounds like your environment isn't setup to import json

all these people with emojis
import isn't core javascript yet, so the question is, how do you use import in the first place?
babel? CJS? webpack?
In the package.json "type": "module"
Could someone guide me on what do to with /slash commands? (Python)
how is this h++ if flip() == 1 else t++ invalid syntax?
python
got it
im good
So I have the domain bob.xyz.
If I configure a sub domain called feedback.bob.xyz, in the same project, how would I make it return a different html page?
Please ping me if you know
as in seperate webservers on the same server?
wdym "server"
In the same project
In one big folder
How do I do that
saying
if the domnain is feedback.bob.xyz
then return bob.html
oh so you just want it to be a specific path?
what are you using for a webserver?
like how are you hosting your html files.
spaghetti code go brrr
saw worse tbh
you mean the first version of it
If it works it works
mood
are post and put same in requestS?
Technically no
Endpoints configured for post will deny put requests
Same thing other way around
They only share similar structure, nothing more
Hi I've got two questions for my footer as you can see my toggle button for dark mode is not in the middle of the text how can I get that and the bullet points for my links are all the way off to the side how can I get them closer
It is in CSS and HTML
https://cdn.discordapp.com/attachments/713614538729193503/835729608296628244/Screenshot_20210424-231138.png
Remove the three dots in the left
why do I get this error
app.get('/callback', async ({ query }, response, req, res)=> {
const { code } = query;
try {
const oauthResult = await fetch('https://discord.com/api/oauth2/token', {
method: 'POST',
body: new URLSearchParams({
client_id: clientID,
client_secret: clientSecret,
code,
grant_type: 'authorization_code',
redirect_uri: `http://localhost:${port}`,
scope: 'identify email guilds.join'
}),
headers: {
'Content-Type': 'application/x-www-form-urlencoded',
},
});
console.log(oauthResult)
const oauthData = await oauthResult.json();
console.log(oauthData)
const userResult = await fetch('https://discord.com/api/users/@me', {
headers: {
authorization: `${oauthData.token_type} ${oauthData.access_token}`,
},
});
userInfo = userResult
let userbruh = await userResult.json()
await fetch('https://discord.com/api/guilds/690557545965813770/members/{userbruh.id}', {
method: "post",
headers: {
authorization: `${oauthData.token_type} ${oauthData.access_token}`,
},
});
let finalInfo = [userbruh]
res.redirect('/success');
} catch (error) {
console.error(error);
}
})
})```
This is my code for /callback
login and press update data or so, there is a button on the right side if you edit the bots page
I did remove the three dots but the toggle switch and both the information/links section are still not quite in the middle
thx\
method: "PUT"
How can I put a vote on the commands, can I help?
Yo! Anyone familiar with flask
i 'm trying make an API
which return link of the file
something like this
{'image': "https://domain.xyz/api/storage/lick/124.gif"}
i'm new to it so i'm stuck on how to share it
I've this
and it returns something like this```
{"image": "1.gif"}
Are you using jsonify?
yes
i mean to send data in JSON format
the prob is i can't access it
when entering link like this http://127.0.0.1:5000/storage/lick/1.gif
it gives 404 error URL NotFound
do i need to pass any additional params somewhere to be able to see that folder or files?
so i kinda got it working now by adding another route
@app.route("/storage/<tag>/<file>")
def send_image(tag, file):
if os.path.isfile(f"{storage}/{tag}/{file}"):
return send_file(f"{storage}/{tag}/{file}")
but i would like to know if this is the correct way to do it?
Help when I'm trying to use the npm rebuild I get this!
did you tryed to delete the node_modules folder and then run npm install?
did you have Build Tools installed? idk how it works on repl.it
ohh wait Repl.it iirc doesnt allow ffmpeg
I may not the most qualified person to answer this
but that's what I do with my server đ¤ˇ
sure?
are the permissions on the folders/files read only?
ye this this is the thing i'm talking about
how to set those perms and all
Ah
linux?
for now what i did was make another route
which will check if the file exists or not
if it does then it sends the file
but how do i access it without doing all that thing?
windows 
if its on windows you should just be able to read them, but i dont know where the issue is tbh, it works
well i this is kinda first thing i did with flask and i'm not sure if i did it correct way
Is it specifically necessary if you don't give users a way to edit them?
idk i dont use py, but if it works it works
yeah! u r right bro! if it works i'm not touching it
if you have public facing stuff its better for production to make it read only
atleast for non system users
Guess my lazy ass should get to creating a separate user for my webserver then đ
got inspiration from this 
no no it returns JSON response
That doesn't apply to root, does it?
that's just a fcking lick image dude
I never worked with file permissions
but you can still edit the permissions
deleted so no probs i guess
how?
Thanks, I'll have a read when I have time
not you this where for shivaco

oh oke
why do most people make bots in JS rather than python?
or so ive seen over my short time in bot development
Depends on which part of the dev community you are looking at. There's still a handful percentage of Python devs (such as myself and a few others I know).
It might be related to the fact that some users who get into discord.js haven't learned JS well enough to not require assistance with basics.
Pog dude
hm so its cause js users just tend to ask for more help? thats why theyre more visibly common?
I was thinking maybe there were some benefits or some exclusives to JS
well people learn JS for web development
and then they get to know what all things they can do with
and boom end up creating bot
IMO
i dunno JS
... and then if you look at this server over the past year or two, some users just copy discord.js tutorials and expect stuff to work
lol
even my bot was kinda tutorial based then i added new cmds to it
based on what all things i can do with python
many tutorials ive found are not the best way to do any of the things the discord library allows or rather don't allow for flexibility
So i caved in and just read the docs : (
That's what you'd get into if you were to develop something more advanced just a few commands like ping, autoresponders, stats, server-/user-info
Python developers don't come here as often as JS developers do, since this server is rather active with those. You will most likely see a larger discord.py userbase in the discord.py or the official Python servers.
I initially started with some JS tutorial, didn't like JS syntax for certain things so switched to python tutorial that based all of its command recognition in 1 giant if elif statement but later found out that you can put them in separate functions so had to reform all my code : (.
yeah even i got to know about sub-commands later
For rn though i feel like i could add everything i need to add to my bot without needing to learn any more about the discord.py library
Which library are you using
me ? discord py
len()
What's your Python version?
name = "finallyabot"
version = "0.1.0"
len(bot.guilds)?
and py is 2.8
Of course I can't type out the link manually
Feel free to use that package
alr ty
do you meant 3.8?
yep lol typo
since 2.8 dont exist
lol
class TopGG(commands.Cog):
"""
This example uses dblpy's autopost feature to post guild count to top.gg every 30 minutes.
"""
def __init__(self, bot):
self.bot = bot
self.token = '' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes
@commands.Cog.listener()
async def on_guild_post(self):
print("Server count posted successfully")
def setup(bot):
bot.add_cog(TopGG(bot))
used this
says no cog
Are you using cogs?
nope
i should just remove that
class TopGG():
"""
This example uses dblpy's autopost feature to post guild count to top.gg every 30 minutes.
"""
def __init__(self, bot):
self.bot = bot
self.token = '' # set this to your DBL token
self.dblpy = dbl.DBLClient(self.bot, self.token, autopost=True) # Autopost will post your guild count every 30 minutes
@client.command()
async def on_guild_post(self):
print("Server count posted successfully")
```this is ok ?
Not ok
um
https://github.com/top-gg/python-sdk see the first example here
A simple API wrapper for top.gg written in Python. Contribute to top-gg/python-sdk development by creating an account on GitHub.
it shows error here
i just copy pasted
update_stats.start()
NameError: name 'update_stats' is not defined
anyone ?
Dont copy code
thats what i did
like it was in bot
but im using client
but its showing error in ```py
update_stats.start()
only
?
Could someone explain to me how to list all the administrators (permission) of a server?
Isn't it postStats()?
how are you performing the mention?
are you inputting by string with ID or actually getting the user member
oh
I have the same case with mentions
probably discord going crazy
discord mobile shows invalid user
its been that way since forever and nobody ever fixed it
most likely caused by data saving features for mobile networks

same thing but on desktop
desktop shows id, mobile shows invalid user
when the member is not available
and discord decides not to download it
ohh so i have nothing to do with that
if the id is valid, nope its not your fault
Okay good to know
you can get around that issue by showing both mention and tag
White theme

well
Hope my Bot gets accepted
Everyone says Linux is good but no one says how long we have to wait to install all those packages
I copy all packages from cache folder so i wont have to download again
installing Python 3.8.6 again on termux
cuz 3.9 doesn't build multidict yarl or smth
??
from bot?
yeah
stolen from dapi
works
ă ă
works for both
did you read the screenshot cry sent

I can't read English well lol

is there anyone here that can help me with my discord.py bot?
just ask
ask
what do u need
@modest maple hi qt, how many clusters should I ideally run for a bot with 40 shards? 
or how do you calculate it
mmmm generally i dont really pay attention to that
i just n amount equal to the server's core count
if you were doing alright upto 40 shards on a single process two processes should be ok
but its just what ever you wanna do really
Nah, my shards are blocking themselves when it gets multiple tasks to deal with in the background
so I should split my processes asap
thanks! 
someone help me i can't install discord.py on termux
at first i could install and run the bot
then i had to install the numpy
so i checked how to do it for termux
pkg install numpy
was the cmd to install numpy
but it upgraded my python3.8.6 to 3.9
and all this happened
my bot is online in my main server, but when i add him to a different server, hes offline there, why is that
you invited either the wrong bot or you're sharding and one of your shards isn't active
Check the log
does anyone know discord.py
if so whats the error in this
async def leaderboard(ctx,x = 1):
users = get_bank_data()
leader_board = {}
total = []
y = 10*x
for user in users:
name = int(user)
total_amount = users[user]["wallet"] + users[user]["bank"]
leader_board[total_amount] = name
total.append(total_amount)
total = sorted(total,reverse=True)
em = discord.Embed(title = f"Top {y} Richest People In All Servers" , description = "This is decided on the basis of raw money in the bank and wallet",color = discord.Color(0xfa43ee))
index = 1
for amt in total:
id_ = leader_board[amt]
member = client.get_user(id_)
name = member.name
em.add_field(name = f"{index}. {name}" , value = f"{amt}", inline = False)
if index == y:
break
else:
index += 1
await ctx.send(embed = em)```
How do I get all tags.name into a var and split it with a ","
so that I can send it
Use <Array>.map() and map it and join it with a , by <Array>.join()
-> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/map
-> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/join
The map() method creates
a new array populated with the results of calling a provided function on
every element in the calling array.
The join() method creates and
returns a new string by concatenating all of the elements in an array (or an array-like
object), separated by commas or a specified separator string. If the array has
only one item, then that item will be returned without using the separator.
How do I get all names into an array?
} else if (args[1] == "list") {
for (let index = 0; index < config.tags.length; index++) {
var listTags = config.tags.name
}
<Array> thats what i need
<> is notation
config in your code is an array, which means you replace <Array> with config
for (let index = 0; index < config.tags.length; index++) {
var map = config.map(info => info.name)
var join = map.join(', ')
msg.channel.send(join)
}
bruh
wtf is this honey
can anyone help me connect my bot to a stage channel
I didn't tell you to iterate through it with a for loop, just use <Array>.map() and then simply join it and send it, e.g. config.tags.map(info => info.name) and join it with <Array>.join()
thx it works
How can I delete infos out of the config using file system?
Step 1: stop using json as a database.
#development message
True, author and server should be IDs only
In a database you could easily use the serverid-tagname as a key.
I will change to mySql soon but I want to learn it
Ok but don't learn using JSON as a database
especially not with this horrible structure
If you want to learn a database, learn it now
Ok I know myself that using json as a database is not goot. But I want to know how to delete data in the json
There is negative value in trying to learn how to store and edit data as a json file. It's literally bad
Use a database.
to delete data from json you have to read the file, json parse it, delete the key, json stringify it, write the file again
They say u learn something everyday and one thing I learned today is never ever uninstall termux if u have it running properly
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200);
res.end('Working...');
server.listen(3000);
i get err
server.listen(3000);
SyntaxError: Unexpected end of input
you call the function inside the function
not closing the createServer scope and function

these things here
you miss a )}
you're not closing them
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200);
res.end('Working...');
});
server.listen(3000);
same shit
can't be, that is now valid syntax.
i think your createServer syntax is wrong, res should be the response to a call, but there is none
server.listen(3000);
SyntaxError: Unexpected end of input
u know were is the problem
why are you even using http
IT WAS WORKING BEFORE
ok so what did you break
nothing
If something stops working and nothing's changed, Something's Changed.
const http = require('http');
const server = http.createServer((req, res) => {
res.writeHead(200);
res.end('Working...');
});
server.listen(3000);
This is syntactically valid code, so the question is, what is the error you get now since it cannot be an error about syntax?
Show us all of your code
there
server.listen(3000);
SyntaxError: Unexpected end of input
home/runner/botname/index.js:62
server.listen(3000);
SyntaxError: Unexpected end of input
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12)
at internal/main/run_main_module.js:17:47
exit status 1
One message removed from a suspended account.
oh your message event isn't closed correctly
Never closes the message event
One message removed from a suspended account.
smh
Here. A trick for you: #development message
please read (i promise it's actually directly helpful to your situation)
what's that vsc font? firacode?
yes, with font ligatures 
aye
true
if you use VSC errorlense is also helpful
i didnt close the message event
exactly.
adds a large red marker on each syntax error
I mean you can use a linter for that too tbh
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
I mean it's easy
just follow the guide
oh dammit
that link is gone or changed. shit
linters are pog unless they scream at you with over 5000 lines of linting issues
:^)
lol
most of them can fix them all for you
everytime i restart my app the css file dosent refresh onto the web any reason for this?
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
do u know how to connect bot to a stage channel?
in js, jslint + prettier is the best combination ever
One message removed from a suspended account.
Sorry buddy I don't, I haven't done bots for 2 years
but you done Enmap
One message removed from a suspended account.
and that is cool btw
One message removed from a suspended account.
Yes, I've done Enmap, and Enmap isn't discord or bots đ
Read the discord API documentation

I haven't touched stages, slash commands, interactions, or anything like that.
One message removed from a suspended account.
I'll be lost in the noob zone soon
I'll API your document
il read it
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> does anyone know what this does?
fuck it. Un-API's your document
node:1166) UnhandledPromiseRejectionWarning: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.
at Timeout.onTimeout (/rbd/pnpm-volume/8cd8c70f-f3c7-44b1-88d5-28e2b4dce893/node_modules/discord.js/src/sharding/Shard.js:163:16)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7)
No errors in bot
But still
what to do
try making sure you're updated to the very latest version of discord.js
often enough updating to the latest resolves that issue
Also make sure you don't have anything that takes a long time in your ready event
umm
Nothing that
Just
Client.on ready
And console log
So let me guess the situation: your bot is in like 50 guilds and you want to "prepare" for sharding or "learn" how to do it?
Got this error: Error [SHARDING_READY_TIMEOUT]: Shard 0's Client took too long to become ready.?
The spawnTimeout can be set to -1 or Infinity to prevent future errors:
https://discord.js.org/#/docs/main/stable/class/ShardingManager?scrollTo=spawn. This can also happen if you call ShardingManager#spawn before attaching a listener to the shardCreate event which could create a race condition possibly preventing the shard 0 to perform a successful launch.
alternatively, ignore sharding manager completely and use internal sharding ```js
const client = new Discord.Client({ shards: 'auto' });
magic, everything works, no effort required.
ookay
Hey how do I install webp on termux?
webp is a file format, you don't install file formats on terminals.
Where can I host my website for
Free
for static websites use github pages
for dynamic websites check out heroku & glitch
Is it 24/7?
depends which one
github pages is, since it's just static content
A website for my bot
đ¤Ś
And glitch technically is since when someone goes on the page it will "wake up" the system and thus is by definition 24/7
https://crunchy.gg/home is technically a 'static' site 
Just don't host your entire bot on glitch, though
I wanna host website not bot

Good, so you're golden, glitch works fine for that
Thnx
Is there a way that I could see how meany servers my bot is in though a command as in guild.count or something along those lines
what programming language and Discord library is your bot written in?
Hey guys
how can I add header based auth in my api
let header = await req.get("api_key");
if (!header)
return res.json([
{
error: "401",
message: "Unauthorized",
solution:
"Kindly make sure to make request using api_key as a header. Get one api_key at ",
},
]);
const list = await keys.findOne({
key: header,
});
if (!list)
return res.json([
{
error: "401",
message: "Unauthorized",
solution:
"Kindly make sure to make request using a valid api_key as a header. Get one api_key at",
},
]);
This is my code
but when I log headers
it logs ```1|index | {
1|index | 'x-real-ip': '108.162.219.116',
1|index | 'x-forwarded-for': '206.189.205.251, 108.162.219.116',
1|index | host: 'api.pgamerx.com',
1|index | 'x-nginx-proxy': 'true',
1|index | connection: 'close',
1|index | 'accept-encoding': 'gzip',
1|index | 'cf-ipcountry': 'US',
1|index | 'cf-ray': '64583c53bd01e720-EWR',
1|index | 'x-forwarded-proto': 'https',
1|index | 'cf-visitor': '{"scheme":"https"}',
1|index | accept: '/',
1|index | 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/90.0.4430.85 Safari/537.36',
1|index | 'cf-connecting-ip': '206.189.205.251',
1|index | 'cdn-loop': 'cloudflare',
1|index | 'cf-request-id': '09ab0408510000e720ab263000000001'
1|index | }
even tho I am adding a header with name api_key and value as the key
req.get()?
...
python (discord.py)
Okay thanks
How could I count that it is saying I could just u len(listname) but idk how I would do that?
well just get the length of the list of guilds
Well.. I was talking about pip install webp which installs python library to read webp files
I just moved the bot to termux cuz my heroku dynos exhausted
my point exactly
hello
Yo!
i need help
Ask
how

is there any mongodbers here
just go ahead and ask your question
okay so, i'm thinking of implementing a way to cache documents from mongodb, so it doesn't have to find & save on request
ye?
i tried saving each doc for 30mins after it getting .find'ed, and then using that cache until it expires
but yea, that's shard-based, and it doesnt' sync properly
so does anyone have an idea, or tried doing that before, probably a cacheing system that's more efficient, or something attached to the sharding manager so if a shard dies, cache doesn't die
Redis
After trying pip install webp I get this error
I'll look into that
Since the terminal isn't like the terminal in Linux
We need to install some packages manually
So I was asking if anyone knows how to troubleshoot this prob
By definition, cache systems should be cleared on app restart
Not only that, but they should expire after a set time
Like 1 hour per entry
yeah I'm aware, but if there's some way to attach it to the shardmanager, then if a shard goes down, it can still exist, idk
Hi, advise me on a good hosting service for a music bot
`const pack = require("./package.json");
module.exports = {
name: "version",
descripcion: "Mostrar la version actual del bot.",
aliases: ["v"],
async execute(client, message, args) {
const version = (pack.version);
message.reply(` Mi version actual es ${version}.`);
}
}`
its okay?
message.reply(`Mi version actual es ${version}.`);
change that line to this ^
oh wait nevermind, my bad lmfao
you already have it
yeah it should be good
That's why you use codeblocks
yeah lol, got confused for a sec
How do you make that kind of box?
About your question hoss, afaik JS treats shards as individual processes
So like, you can try redis or some other lightweight database
Error: Cannot find module './package.json'
Require stack:
- /app/commands/version.js
- /app/handlers/command_handler.js
- /app/index.js
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:880:15)
at Function.Module._load (internal/modules/cjs/loader.js:725:27)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at Object.<anonymous> (/app/commands/version.js:1:14)
at Module._compile (internal/modules/cjs/loader.js:1063:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1092:10)
at Module.load (internal/modules/cjs/loader.js:928:32)
at Function.Module._load (internal/modules/cjs/loader.js:769:14)
at Module.require (internal/modules/cjs/loader.js:952:19)
at require (internal/modules/cjs/helpers.js:88:18)
at module.exports (/app/handlers/command_handler.js:9:21)
at /app/index.js:21:35
at Array.forEach (<anonymous>)
at Object.<anonymous> (/app/index.js:20:38)
at Module._compile (internal/modules/cjs/loader.js:1063:30) {
code: 'MODULE_NOT_FOUND',
requireStack: [
'/app/commands/version.js',
'/app/handlers/command_handler.js',
'/app/index.js'
]
}
Did you delete package.json?
no
Is it on project root?
no
There's your problem
const pack = require('./package.json')
const version = (pack.version)

const { version } = require('./package.json')
A thx
anyone
what does that mean?
It means what it mean
Authentication: "your key"
oh
wait
so it's authentication and can't be changed?
Are you sure req.get() is getting from the headers not the url params?
If you console.log req what does it return?
I'm designing a GraphQL API and running into concerns regarding static vs. dynamic data.
For example, I have a type named Tag which describes an attribute on some object (e.g. a character's personality). There can be many tags associated with a single object, but the real concern is what fields to add to the type.
Right now, I have an id field (as standard with most types I'm creating). I could include a name field for the name of the tag and a description field for details about the tag, but these may turn out to be more static than dynamic since only administrators can add, alter, and delete tags (not normal members). So, with the name and description rarely changed, the tag could really only feature an id property.
The advantage to this approach is the client is not receiving data they could've provided (and can provide their own localization if needed). The disadvantage is the client has to provide their own name and descriptions for tags, which may cause inconsistency among implementors. So, the question I have is: would adding a name and description be more wise in this case and when should I rely on the client to provide their own implementation as opposed to serving it to them.
I'm designing a GraphQL API
The pain. I'm sorry to hear that.
I like it.
Masochism ig
Always entertains me when people use graphQL just cuz and it ends up being way more complex and slower than your standard REST setup
My problem is less about GraphQL and more about if the client should receive the data or provide its own instead
GraphQL is meant to provide public APIs where people can save and retrieve partial query results through filtering and selection of specific fields by name. If you're not using it to serve and store data in this way (as in your example where there's literally only 3 fields???) then you're using GraphQL wrong.
First time I had to use GraphQL was the last time I ever used it - 75% of the app's front-end code was made purely of graphql queries and field lists and filters and selectors. It was absolutely craptastically horrible.
Read wrong a bit*
Who's reading what wrong?
graphql looks nice, atleast if you have it working
Me. A previous message I sent was a bit wrong.
use html
im a backend dev not frontend, and i dont really know html ÂŻ_(ă)_/ÂŻ
i say how add it in description
Check out https://custom.discord.re/
ping command over slash commands, is it possible đ
There are only three fields in my example since:
- I'm drafting the API.
- It's a short example.
There may be more fields in the future, but right now, it looks like this. In reality, this type is being used among other types to compile the list of data I need. For example (an example where I need a lot of data, but I may need less data in some other cases): graphql query MediaSearch($id: ID!) { Media(id: $id) { # Media type format description coverImage { # Image type url color } bannerImage { # Image type url color } # ... some other fields ... tags { # Tag type id name description } } }
But even then, let's say I was using REST instead of GraphQL. This still does not answer my question since it's about providing more than the client truly needs.
Well, I'm not sure I understand your question then. If the "client" has their own data they're not storing with you it doesn't make a lot of sense to ask if you should let them store it with you
The question is whether I should have the client ask me for the data (like name and description) even if it hardly changes or don't provide it in the API (so name and description don't exist and can't be queried) and expect the client it on-device instead (like a JSON file that lives in the project with the tag names and descriptions).
I could do that
That's literally the point of GraphQL so... y'know....
When will I get to know that my bot is approved or declined?
You should receive a DM from @gilded plank
https://srcb.in/QHmzFA3iKV
UnhandledPromiseRejectionWarning: ReferenceError: find is not defined
it ain't defined chief
is there 2 numbers separated with a colon?
how I define the function find?
does it say 2 numbers that are separated with a colon like 92:5
You get a DM from @livid jackal as well as a ping in #mod-logs if it's declined
and me?
define it like this:
const find = function(){
// function code here
}
i mean it's been a week i guess,
nvm
i'll wait another week
Queue times are around 2 weeks
How do I get my bot to login? there needs to be a login command but I can't seem to find it and where should I place it? I need help
from discord.ext import commands
client = commands.Bot(command_prefix="prefix")
@client.event
async def on_ready():
print("Bot Connected")
@client.event
async def on_message(message):
if message.author.id == 712027036511633429:
await message.delete()```
Also wtf is that code supposed to do?
Delete all messages sent by user with that id?
Also that prefix="prefix" tells me you just copypasted that code from somewhere
What are your bets they didn't
What says you can't?
so i was looking some hosting options
and they say cloud hosting is better
compared to VPS as it can be configured on the go and cheap
is it true or is there any drawback to cloud hosting?
its pretty much the same
tßrkçe bilen varmĹ
but just look if the specs are ok
what spec are recomended?
if you try to use some really bad config like 265mb ram you will run into issues quickly
would recommend for a small bot 1 vCore 1Gb ram and whatever space they offer
at least i'll look one with 1GB
if you do like to stuff like Image Manipulation or Machinelearning you probably want some big Boy server
you could try to run it on a single core VPS, but try to run it on a different Thread to not bog down your main Thread
how?
i like to use a internal API
then just run the Image manipulation stuff as its own process
shards is for the bot itself
Multiple shards on 1GB?
but i never get it
Really?
Tim probably does this if he want to
i dunno
Tim is an exception
Lol
You'll see your first shard ahen you reach 1.5k servers
sharding is only required if you reach 2500 Guilds, discord suggest to start sharding at 1000 Guilds
oh
nvm then
long time to go
i'll just deploy it, as it is
like seriously shards for a bot in 6 servers?
đ
so with the different Thread for the image manipulation, i suggest to run it on a different thread if it takes a lot of time, ive had my Tensorflow stuff first running with the same Process of the bot, but it caused the bot to become sluggish.
what kind of image manipulation tho? shit like canvas/pil/pillow can easily run in the main thread
then again thanks for sharing info i'll try looking into it again
Pillow
and uses Np
Yeah, unless you want to do heavy pixel processing simple manipulation is quite fast
hi
yo!
Honesty, my only issue with images is upload times
^
lol
Not upload actually, but discord's shitty image processing times
i face them too
ye dont make your images too big
Just run your own system
hi dedik mk
for the bot status it said i need a token is the bot token or iD
Atm im working on my new CDN server so i can auto optimize stuff 
100k images on le todo list
I had 32Mb gifs at one point đ
no fun.
Hİ
jeez
:d
can bots even upload that?
and yeah about that API thing i was asking
in Flask
seems like i need to have a FTP server for it
resolution is limited to 4k now isnt it?
is it?
i thought so.
ah
But you can still open the orig image
ye but dont bots have the 8mb attachment limit?
8 default
Never seem my long rope?
if you have boosted / partnered servers gets increased though
On the Py Discord the bot can upload some 100MB
^ that too
guys give me mute and unmute code please
No
if thats true, someone make a bot for posting large images, videos, gif, etc.
oh ok ;_;
spoonfeeding code is against the rules here.
How can i use dbd.js from phone
Like, I only need to figure out how to speed up compressing to improve my tcg game
dm
Ok
It takes about 4 seconds to send the img on each play

