#development
1 messages · Page 1764 of 1
thats very personal and very specific
straight out of a java app src
kekw
have you seen the djs api types package?
do i want to
let me find it brb
Oh, hold on. So GuildApplicationCommandPermissions is for receiving perms and ApplicationCommandPermissions is for sending?
This is fun lol
oh my god
hahahaha
xDDDDDDDDD
Hey Erwin can you give me an example of how to use slash commands in dei3u3uhutgr? The search function in their docs does't help at all
actually nvm I guess I'll join their support server
Wel then
you can still do it in the support server
I don't understand why snake case and camel case are a thing
i can help you implementing it like i did if u wish
until cake publishes it
but im pretty sure he's already done with his
different people have different naming conventions they follow
snake case is used in rust and python too
It's not high-priority, but I've been delaying it for like 3 months cause I said I'd wait for discord.js to support them... they still haven't...
which as you can see, multiple people contributing to the same thing and each of them following their own naming conventions creates the inconsistency of discord api docs
more than 3 months
Man I want a good name to my bot that uses part of these three names: Miguel, Davi, Carlos. Any ideas or I will need to change my idea?
I started programming in Rust and now I prefer snake case
midalos
Midir
I prefer snake case too lol
what
your preference is invalid in the sight of "Programming Standardization"
Lol cool
davelos
we are civilized people who follow standards and rules
alvaro ramos
micarguevi
latesha
Carmida
latifa
there are a lot of langauges following snake case
Thanks for the ideias people, think I have a direction to follow now
languages, yes, each have their own standarrds
carviguel
latoya
I don't like it when programming languages set a standard for naming conventions
Cargo screams at me when I name a variable with snakeCase
car go
so now I'm used to snake case
its not like you HAVE to or it wont work (cough cough, looking at you python)
pythonk
@quartz kindlehttps://www.youtube.com/watch?v=OUsNY3--npY
This is a hilarious list of funny black girl names. http://bit.ly/AaTDQ
golang uses camel which is good
wrong clipboard
yeah but it's an ugly warning in the console and in the IDE
wtf is 38 real?
probably
ok 25 has to be a joke
the WHOLE thing is a joke
watermelondria sounds like a name someone would give when drunk
you seen those kids named ssst and abcdefghijkmnopqrstuvwxyz?
but the one that im most reluctant to ask, "who in their right mind would give such name", is the last one
Why in the world are private fields in javascript prefixed with #??? who got that idea
why not private
you can use private tho
no idea
hi
in classes at least
Anyone here uses the app "Bot designer For discord" to making bots, and knows a good way to make a giveaway comand?
me
br?
Yes
eae kk
oh, battle royale
eu uso o bdd
Eaee kkkk
Kk
Why are there so many people from Brazil here
good question
bc Brazil is funny
Because Brazilians rock baby
HUeHUe is taking over discord, slowly but steadily
we have funk
I dunno about that
and we have brigadeiro
HueHuehueheuehuehueuhueh
i'd recommend u guys go to #general-int before a mod screeches to you for speaking non portuguese
Ok
wait a minute

where we need to talk about progammation
here
You also have the cartel
but the only channel you can speak non-english is #general-int
or sending emails directly at one another
i completely misunderstood the context at which u sent that
ignore my last msg

lmao
I have a simple HTML website for image compression. Once I've resized the image itself, how do I send that back to a user to be downloaded by them, without having to download the image myself?
(Using sharp for nodejs btw)
Send the image as a buffer
cute
&&&&&%%%__PREFIX_420_69%%%%&&&&&
<input type="file" id="fileUpload" accept=".jpg, .jpeg, .JPG, .png, .PNG">
``` If a user inserts an image, how would I convert that to a buffer of that image?

wot
its not prod
thats prod
its not
prod token at least
sounds like a crash waiting to happen
how lol
in case it randomly decides to reply on other methods
like dms
or new channels
like threads

it cant
thats what i thought too, until that whole mess happened
now that i removed reactions, my only listener is message
and i have this if(message.client.app.dev && message.author.id !== message.client.ownerID) { return; }
plus the dev instance is only on my server
like literally
it literally doesnt exist on other servers nor dms
BuT WhAt IF
what if wat
Is it really that hard, to have two separate environments, one for production and one for the development? With two different databases, discord clients and such? Lol
yes
anyone having idea for this, I am owner of the server and my bot is having administrator permission but still I am having this error?
who is your bot trying to kick?
a normal member
So i have a function in the BaseCommand class called getHelp which returns a help message for the command. My question is, would it be better to just have the function in one place (file) instead of duplicating it across all classes. Would that use less memory? Working in JS
is the bot's highest role above the member's highest role?
naa bot is having administrator permission, and other member is having simple permissions
it still needs to be above the other person in roles
administrator is the highest permission right?
yes but you cant affect roles above you
yes, this is what i do on detritus
yeah, member I am banning is not above bot's role
Ty!
I don't think you understood my question
I wanted to put the getHelp function in the base class. But wouldn't that take more memory than just having one function in a file? Or it just points to the same location in memory for all child classes?
should be the latter
unless you doing some stupid stuff like
class test {
constructor() {
myFunction: myFunction() {}
}
}
which, you should know, is not how u declare functions in a class
that will cause a memory leak, had it happen before
lel
Ah okay, so im safe adding a method in the base class. I'd assume it points to the same location in memory just wanted to make sure
yup, should be fine if u do it properly
is this 'properly'?
just eslint screaming
im aware
poof
@zinc wharf did you follow this? https://discord-buttons.js.org/setup_install
Then in index.js I have the client.on('clickbutton event, which doesn't ping at all
Try to follow the guide I linked and see if that fixes it
I also tried to put it in my /events directory
All of that information there is exactly what I have
at this point why not reply and send to the normal payload?
at what exactly?
also buttons are the same as reactions in a very basic sense
at the normal payload you receieve
discord.js should have the interactions event exposed to the user
well yeah
Hold up. It might actually be because I haven't put it as a requirement in my index.js, although, does it need to be? I cant see anything on the docs saying that it needs to be there, it just needs to be where the buttons are being sent
only on master
on stable you have to listen to raw
lel
@opal plankhelp, my vsc is going crazy
is it ts related?
every time i type delete obj[somekey], it automatically adds this to the beginning of the file
what the hell
lmao
oh sometimes it ass some typescript stuff when i tpye as
never figured how to make that shit stop
before i compile i just check for tree shaking
Here is my clickButton.js event, within the event directory, the ID's are the same as buttons in the play.js file. I've made the event code simple as I can atm to try and figure out why its not working
I know the text is wrong 
Thats my thought too, it just hates it
You can see my file on my stream, but I have about the same
const channel = newState.guild.channels.cache.get(newState.channelID.id || newState.channelID);
if(channel.type == 'stage' && newState.suppress) {
setTimeout(() => {
channel.guild.me.voice.setSuppressed(false);
player.pause(false);
}, 1000);
}
is there a way to make it so when i make the bot into a audience in the stage channel it doesnt go back to a speaker?
also this is another error i get while i move the bot from voice channel to stage channel
if (channel?.type !== 'stage') throw new Error('VOICE_NOT_STAGE_CHANNEL');
^
Error [VOICE_NOT_STAGE_CHANNEL]: You are only allowed to do this in stage channels.
Guys
what language u guys using?
What site do you use for make this bots?
JavaScript
OK cool
I want to do a bot
i dont know that yet im learning it
yes but... its Turkish
Are you sure the event doens't fire at all?
Not a single bit
Let me try something else, hold 1 moment
Yeah, it doesn't fire at all
I put a console log right before the if()else if() statement
And nothing comes up
from google_images_search import GoogleImagesSearch
_search_params = {
'q': "lectures",
'num': 10,
'fileType': 'jpg|png',
}
# get first 123 images:
googleImageSearch.search(search_params=_search_params)
# take next 123 images from Google images search:
#googleImageSearch.next_page()
embed_dict = {}
print(googleImageSearch)
for image in googleImageSearch.results():
print(image)
i use this to get 10 images from google image search
it prints some kind of objects but i can't get the image links, source and titles
is there any documentations about it?
What are the objects
<google_images_search.fetch_resize_save.GSImage object at 0x000002510D642880>
That's an object
An image object specifically
Dig around the library documentation for GSImage
alr
well i found out i can do this instead
from apiclient.discovery import build
but discovery and build are giving red lines but the code is working fine
Can someone explain me this python error?
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
your json file is broken
{"820602827301847052": {"lang": "IT"}}
That’s what the json file contains
tf
Oh I got it
@slender thistlesorry for the ping but i can't seem to find anything
is there any thing you would recommend (if u know about it ofc) ?
all i can find is ways to download images from google but like i don't want that
i just want to get the image links and title (name)
This worked, right?
yeah tho it gets the output in an image object
Google's clusterfuck of Python APIs is something I'll never understand
lol
idk try this https://stackoverflow.com/questions/22866579/download-images-with-google-custom-search-api
so in the end i will just download images?
I almost got aneurysm trying to work with YouTube API. What's even better is that I kept getting quota exhaustion with only like 3 requests sent ever
Nah see the first answer
Actually not, same error and my json file is: {"820602827301847052"{"lang": "IT"}}
oh alr
sounds tough
One message removed from a suspended account.
that's the same thing i got my code from lol
Can someone explain me this python error?
my json file is: {"820602827301847052"{"lang": "IT"}}
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Then what I did before was right then I have the same error with the :
show your full json file
@slender thistle oh wait i tried that before coming here
it only allows for 10 images or less + the images are kinda off
feels like kids drawings
lmfao
if i google butterflies i should see some photographs
but with the code i get some elementary school text books images
like this one lol
What I’ve already send is the full json
the error is saying line 3, character 41
you showed only 1 line with less than 40 characters
so something is missing
Oh wait
I maybe got the error
{
"noadmin":"ERRORE! Non sei admin"
"team1set":"✅Fatto, team 1 salvato :)"
}
Do you see any error there?
yes, missing a comma
Traceback (most recent call last):
File "slash_bot.py", line 6, in <module>
import speedcord
File "C:\Users\ezboo\AppData\Local\site-packages\speedcord\__init__.py", line 6, in <module>
from .client import Client
File "C:\Users\ezboo\AppData\Local\site-packages\speedcord\client.py", line 11, in <module>
from .shard import DefaultShard
File "C:\Users\ezboo\AppData\Local\site-packages\speedcord\shard.py", line 9, in <module>
from asyncio.exceptions import TimeoutError
ModuleNotFoundError: No module named 'asyncio.exceptions'
Process finished with exit code 1
This is a fucking joke
i shit on this channel every 2 minutes in #general , how was it a secret to begin with? that the whole foundation of my argument: D.js is shit and you should use detritusjs instead
again
i was taunted, not gonna let it pass
i eat the hooker, the line, the fishging rod, and your arm along with it
Not this again
One message removed from a suspended account.
One message removed from a suspended account.
thats cuz co0ol kids talk in the support server https://discord.gg/WKxvthHg
Cool kids write their own client lol.
cool kids acknowledge that there are already way too many bloated "discord clients" and that we shouldnt trash the ecosystem any further

Or they don't like the other clients so they make their own.
cleraly havent tried detritus, but thats none of my business
Not a big fan of the event emitter pattern

Tried it, it was ok
wdym event emitter pattern
.on("event", ...) etc
what else would u use then
How about the reactive paradigm
Yeah I'm more a functional / reactive fan boy.
the event emitter model sucks imo
i pretty much love the emitter/websocket way
never even heard of someone actually using that in js
You should try it out
It's a blessing when I use it in other languages (e.g. Swift's Combine framework)
sadly
I was part of the original core node.js team back before 1.0.0, and we made API decisions based on the browser APIs.
But deno is rethinking some of those decisions, now that we have async iterators etc
cool
how would a core module such as tcp sockets work without event emitters?
would you query the buffer yourself in an interval?
And promises lol. Node was late to the party there hah.
the closest thing i can think of is using the "readable" event to read the buffer, but its still an event
just not a data emitter
Async iterators are a great fit for sockets, they support back pressure and everything
arent they just syntatic sugar tho?
or do they work in a different way behind the scenes?
They work differently compared to event emitters. Deno TCP example https://deno.land/manual@v1.9.2/examples/tcp_echo
yes but i mean under the hood
for example classes are syntatic sugar for prototypes
are async iterators syntatic sugar for event emitters?
They're basically higher-level forms of event emitters / loops, so yes
basically the equivalent of callback -> promise
Async iterators use generator functions behinds the scenes, not event emitters.
how i can make a webhook for vote my bot
depends on the language
Here is a good overview of the generator interface: https://2ality.com/2016/10/asynchronous-iteration.html#the-interfaces-for-async-iteration
i know about the generator interface, i was curious about the low level implementation
for example, node uses the event loop, so on every iteration, it checks if there is new data in the buffer, if there is, slice the data and emit an event containing the data
does deno also use an event loop to read from a buffer?
Oh right, you would need to implement a buffer of some kind. As data comes in put it in the buffer, and the iterators consumes it, remove it.
Event emitters are "push" based, so any buffering / back-pressure has to be implemented by the user.
i see what you mean
but the push only happens if there is a reader
but i see what you mean, with async generator the reader has to pull
Yeah, that is the fundamental difference. Push vs pull.
there is still backpressure handling at cpp/rs level no? for example if the reader never reads and the buffer gets full
Yes, there are TCP level things to tell the providers to stop sending stuff.
lets see if i understand
// deno
async function* stream() {
while(true) {
if(buffer.hasNewData()) {
yield buffer.getNewData();
}
await new Promise(resolve => setImmediate(resolve));
}
}
for await (let data of stream) {}
// node
function read() {
if(buffer.hasNewData()) {
stream.emit("data", buffer.getNewData());
}
setImmediate(read);
}
stream.on("data", data => {})
replace setImmediate with the engine's actual event loop
how do i check if someone has a permission in dpy?
this new update fucked stuff up
Help with?
how to make commands in my bot
You could simplify the deno stream to:
async function* stream() {
while (true) {
yield await getData();
}
}
What language?
english
lol js, py etc
does getData() then call setImmediate? it has to tell the event loop to continue somehow, otherwise the while(true) runs forever no?
idk im just made it today so idk
The await getData() will wait for the promise to resolve 🙂
yes but the promise has to actually do something asynchronously
@zinc wharf ?
There's a lot to go through when you first make a bot, so instead of me putting hundreds, possibly thousands of lines. Take a read of this guide here...
https://github.com/AnIdiotsGuide/discordjs-bot-guide/blob/master/first-bot/your-first-bot.md
Of course, feel free to ask for help to understand it.
To make commands in your index.js follow the section below, which is shown in the link above
if (message.content.startsWith("ping")) {
message.channel.send("pong!");
} else
if (message.content.startsWith("foo")) {
message.channel.send("bar!");
}
});```
Yeah, getData would either resolve immediately if there is buffered data, or use some kind of callback when new data comes in.
yes thats what im getting into
The callback would hook into epoll or something similar.
ye
one thing tho
i havent tested async generators
but i did test regular generators
and they were noticeably slower than alternatives
are there any benchmarks on async generators?
Well, probably a bit. But TCP will run out of IO capacity way before CPU becomes an issue.
ye in this case it should be pretty irrelevant
plural
Fucking ENCODINGS
Traceback (most recent call last):
File "slash_bot.py", line 11, in <module>
print("\n".join(sys.path))
File "C:\Users\ezboo\AppData\Local\pypy3.7-v7.3.5-win64\lib-python\3\encodings\utf_8.py", line 20, in encode
return codecs.utf_8_encode(input, self.errors)[0]
UnicodeEncodeError: 'utf-8' codec can't encode character '\udcd0' in position 24: surrogates not allowed
Why is everything wrong with PyPy
wtf
nicknames
you change a nickname but you manage nicknames
oh my god literally just add an s
More extensive example:
const initStream = () => {
const buffer = [];
let resolve: (blob: Buffer) => void;
setupEpollCallback((blob: Buffer) => {
buffer.push(blob);
if (resolve) {
resolve(buffer.shift());
resolve = undefined;
}
});
return () =>
new Promise<Buffer>((r) => {
if (buffer.length > 0) {
r(buffer.shift());
} else {
resolve = r;
}
});
};
async function* stream() {
const getData = initStream();
while (true) {
yield await getData();
}
}
ah yes, a deferred promise in a closure
clever trick for tcp and ipc streams
but in the end, at the lowest of the low level, there is still an event emitter in the epoll callback xd
but it runs multiple times no? like an emitter of sorts
But they are very similar, callbacks and event emitters.
nice
also breaking it down by cluster really shows how little cpu is being used
how can I send a message after 5000 ms from the command starts?
discord.js
so I write .help and after 5.000 ms the bot sends the help list?
why would you wait so long
>>>> import os
>>>> os.listdir("C:\\Users\\ezboo\\OneDrive\\Рабочий стол\\asdasd\\something\\sakurai")
['.idea', 'bot.py', 'requirements.txt', 'settings.json', 'slash_bot.py', 'utils', '__pycache__']
But apparently
C:\Users>pypy3 "ezboo\OneDrive\Рабочий стол\asdasd\something\sakurai"
C:\Users\ezboo\AppData\Local\pypy3.7-v7.3.5-win64\pypy3.exe: can't open file ezboo\OneDrive\\udcd0\udce0\udce1\udcee\udcf7\udce8\udce9 \udcf1\udcf2\udcee\udceb\asdasd\something\sakurai: [Errno 2] No such file or directory
Just warp everything inside a timeout
Ask your mate to start a stopwatch, then press enter when it reaches 5 seconds 🙂
because fuck you I guess
setTimeout(<func>, <timeout in ms>);
What's actually wrong with this 
<func> is message.channel.send('hdja') right?
Fucking-A, let me just change my Desktop name
no
setTimeout(() => sendMessage(), 5000)
you gotta wrap it in a function that wil be executed once the timeout is over
Absolute bullshittery
tysm
what
K time to think where I can put this script without losing it
no await?
why would u need to await that
Well, if you are in an async function:
await new Promise(r => setTimeout(r, 5000))
await sendMessage()
I'm fucking done
ezboo\OneDrive\\udcd0\udce0\udce1\udcee\udcf7\udce8\udce9 \udcf1\udcf2\udcee\udceb\asdasd\something\sakurai I thought about it when I saw this
sendMessage is not defined
srry if I look like the dumbest
Lol. I'll leave you to figure that out.
You were almost there...
I'M PRETTY SURE IS LIKE THE MOST EASY THING IN THE WORD
el apocalipsis deja de ser un miedo y se convierte en una esperanza
meglio l'italiano dello spagnolo lol
Did you forget to set type to 2 for the stats command itself?
@cursive dagger speedian.CommandContext.send needs interaction_id from interaction_create instead of client_id plzfixty
Literally just spent 30 minutes trying to debug 404s for interaction responses
No more reactions necessary. Best 12h dev session I spent
too bad that'll go towards message patch buckets
sup
Anyone know a Nodejs package that allows you to get the content of a meta tag?
for videos/
Hello any one say how update npm ytbl core
no, on skype
Chacha sant sant
Oh i am sorry my friend skype does not support that command right now!

Does Digital Ocean have Rasipban OS as a distro?
id help u if i could understand what you are asking. Maybe rephrase it?
have you tried googling how to do it first
Probably not, Raspbian is a Debian distro, there's probably Debian on Digital Ocean which is exactly the same.
eht
first search result is discord's own article
which has a direct link to their documentation
on TOP of that
cn clear say now
Sometimes searching a little bit will help you...
Not everything is given to you all the time in life, you gotta make your own research sometimes.
put in the effort
if you have issues with buttons, not just "give code pls"
then people can help
So upon trying out @discordjs/voice, I received TS errors about missing modules. I tried reinstalling modules with no luck. One thing to note, I'm not using discord.js, rather a different library, so my thought is that these missing modules could be normally installed with djs, and aren't with @discordjs/voice and thus is an oversight.
Here's a part of the error stack that goes with the screenshot below, I can't fit it all into Discord's 2000 character limit
node_modules/@discordjs/voice/dist/audio/AudioPlayer.d.ts:5:26 - error TS2307: Cannot find module 'typed-emitter' or its corresponding type declarations.
5 import TypedEmitter from 'typed-emitter';
not too well versed in d.js/ts, but have you tried this https://github.com/binier/tiny-typed-emitter/issues/3
You can also use
// @ts-ignore
^^
just put it above wherever you import @discordjs/voice
and it should fix ur problems
oh wait doesn't @ts-ignore ignore the warnings?
those are errors
also, you could try installing the @discordjs/voice types
maybe that would fix the issues
I can manually install the missing packages myself; but obviously that isn't good practice, and there should be a better solution
Yeah I'll try that
I don't want to ignore all typings though
also, if that doesn't work npm i @types/tiny-typed-emitter
and if there are no type declarations for tiny typed emitter
well
yeah my last resort is just installing them myself, I'm just trying to stay away from it
it only ignores the warnings for @discordjs/voice
I know, I'd still like those typings though :)
so they aren't useful
yeah
it still ignores those errors and still gives t y p i n g s
ts-ignore doesn't ignore errors
I may just submit an issue on the repo, as I feel like I've tried everything reasonable without using workarounds
I'd prefer to be using dependencies that I don't have to hack with to make them work
you could declare typings for the package yk
if tiny-typed-emitter doesn't have any typings
It's not that the package doesn't have typings; discordjs/voice is written in ts, it's that it uses other packages for it's typings, that for some reason aren't accessible during runtime
if you look in the error stack, you can see it's throwing errors because it cannot find the appropriate modules when importing them for it's compiled typing files
ahh
Ahhhh make a pr
you propably have to build from source
rebuild it
hmm so are there any specific docs for it?
idk-
sad
still same error
apparently it is telling that i may have not properly installed canvacord
i did npm i canvacord and here is the error
run from git bash
site is this https://git-scm.com/downloads?
you happy bish
what does your package.json look like? i dont think you need git
0.7.0 is the newest version
@proven lantern looks fine
i am using canvas for image manipulation
i cant understand
ohk
ic
did you try npm rebuild?
try npm rebuild canvas --update-binary
what is the output of the rebuild command?
i would not use the users folder in windows as a development directory
instead id do C:/dev or anything, users folder is a bitch most of the times
especially when it comes to using package managers like npm
it can cause issues when the username has spaces, but its not the case here so it should be fine
ohh
Hi. Whats the problem?
the connection took too long and you didnt catch the error
but... i have the "error event" in my code... 😢
and. how can i fix it?
i just told you how?
I writte only voiceconnection.on("error") and all is fixed?? 👀
you said you have an error event in your code, so i assumed you know how events work lol
I have GUILD_MEMBERS intent specified, but I still don't receive any members. What can cause this?
enabled in the dashboard?
Mhm, along with presences
Turned it on a few minutes ago, but I doubt there's a significant delay for it to actually take effect
i guess then its just discord doing its thing again
hi
🤣
yo
i made my bot code without any command handler
now i want to change it in command handler
so how do i do it?
any docs for that?
imagine asking docs for stuff you make on your own
for the command handler
i never made one
i have 1 file
bot.js
i did all coding there
no meme.js
no user.js
etc
now i wish to do
becoz y not
this is what happens when you use discordjs.guide's if else thing to handle commands
hmm
to make a command handler you just need a way to read data from different files and execute methods from them based on the message
ohhhhhhh
const fs
yes
module exports?
my friend telling is that right?
hmm ye i checked on discord.js
guide
the simplest command handler would be this:
// commands/user.js
module.exports = {
name: "user",
async run (message) {
// do stuff
}
}
// bot.js
bot.commands = new Map();
for (let data of fs.readdirSync("./commands")
.map(file => require(`./commands/${file}`))) {
bot.commands.set(data.name, data.run);
}
bot.on("message", message => {
const command = /* */;
bot.commands.get(command)(message);
});
hmm tysm
That's an example
Don't copy & paste, lol
what if i make folder inside command folder
like modcmds folder inside commands
Then change it?
u decide what you do with your command handler
hmm
k
i can only give you an example
First understand what the above is doing
Lol
commands/user.js
// Export an object with the command data
module.exports = {
name: "user", // Name for the command
async run (message) { // The function that runs when this command is called
// do stuff
}
}
bot.js
bot.commands = new Map(); // bot.commands is a Map that stores all the command info
// The keys are the command names and the values
// are the command run methods
// Read every file in the command folder
// and add it's data to bot.commands
for (let data of fs.readdirSync("./commands")
.map(file => require(`./commands/${file}`))) {
bot.commands.set(data.name, data.run);
}
// When the bot recieves a message...
bot.on("message", message => {
// ...get the command from the message...
const command = /* */;
// ...and execute the command
bot.commands.get(command)(message);
});
@earnest phoenix
ohk
hmm
try to understand what this does and dont copy paste it

hmm trying to understand
light mode is hard
nvm
@earnest phoenix did you get it
yea a bit i understood
i am watching tutorials about it
well ty for those xamples
🤦♂️
why are you watching youtube tutorials
99% of that shit is outdated
I am not understanding one thing and wanted help: When I change my bot name and image in the discord developer portal, in the aplication, it is not changing the name in discord. It is always remaining the old name and image of the bot, instead of changing to the new one that I put in the discord developer portal
any one knows the answer to that?
It changes in the developer portal, but not in discord
I don't know if my explanation was clear
Go to the bot tab and change its avatar there. You most likely changed the app icon
bot tab?
The tab you're getting the token from
Yeah those are app icons
Click one of the apps, and there'll be bot section you can click

https://i.callumdev.xyz/h2ue1.png
How can I import db and config into another file without creating an infinite loop in my client?
https://i.callumdev.xyz/0xo8q.png
Is this channel only for help with development or would this channel be able to help me find the right bot for my issues?
Trying to find the right channel to post my question in lol
import dotenv from "dotenv"
dotenv.config()
can be just
import "dotenv/config"
thats... not my issue..
I know I don't have enough information to help you with your actual thing I just wanted to give a heads up
mk
don't even know what file the second screenshot is
what is ts?
typescript?
yes
https://i.callumdev.xyz/ba14l.png
the shard manager creates a new client for each shard, ofc, which I have a custom client class for, but when that client class is imported, it imports the index file to get the database and config that were exported, causing it to loop
also I think the way you're doing this is pretty wrong. Your database is not statically available so it doesn't make sense to export it because you'll run into race condition. Pass it as a constructor argument to client instead and access it through there
what is sharding exactly?
but I cannot parse it as a constructor argument since its created before the shard is created and I cannot parse arguments to the shard
in that case each shard should be creating its own database connection and passing it to the client that way
see
wouldn't that be bad, a seperate connection for each client?
when a bot reach lot of guilds its efficiency is to be increased
are you sharing connections across processes now? that doesn't sound good either
is there any way to make py file path relative?
path. relpath()
u can get a relative path
for python
i did coding in python earlier
wdym?
now i forgot some things
ok see
like this makes the file get other files relatively?
so 1.py gets others file relatively?
current directory
for example
hm
did you install it?
did u install that version?
how do icheck the version of canvacord installation?
like for discord.js
there is y
v
something
uhh
it says when u download?
Extension 'cogs.automod.automod' raised an error: TypeError: relpath() missing 1 required positional argument: 'path'
you can check tho
i think
@earnest phoenix
npm list --depth=0
there
u got any idea?
you need to supply path argument

bruh
yo uh, i tried making the bot check if a user has no roles for something i don't wanna tell about and this is what i did for now
if(member.guild.members.cache.get(member.user.id).roles.cache.map(r => r.id).join("") === message.guild.roles.everyone.id) return;```
doesn't work for any reason
anyone know what im doing wrong?
wtf
this is guildMemberAdd event so member is defined
how?
no no not you
kk
i was saying to 0exe
oh
just use some on the collection, it takes in a comparison func and check for the role id that way
when i install this error shows
sad
that's what i did before coming to what i have now
comparing with the everyone role id will always return true though
i tried that too
everyone has the everyone role regardless
so you'll always return out of the handler
yes so i mapped it by its id and it should work ig
oh i maybe know what's my problem LOL
im in guildMemberAdd event LOL
now it works perfectly thanks lol
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
how do i convert this into command handler
i can understand anything from those tutorial videos
half things dont even work
because you're copypasting without understanding what you're doing
stop with whatever you're doing, take a deep breath, backtrack and learn javascript
then come back to discord bots

i know js it just that i am doing after a break ig 7 months
so yeah
then you don't know it
the code was 1 yr old
if you truly knew something, you wouldn't forget it
since exam etc i forgot this
discord bot
sad
now i started learning yesterday
along with my friend

we don't need a sob story
😔
Need help I want only the info section of my bot to be background imaged in css ik how to do it i just getting issue the pic is getting repeated all over my page

lmao copypasting what?

oof
hmm ok
ig ur right
since some things such as args
mf you copypasted entire ass commands 😩
every 1/3 of your code follows a different style and naming conventions
explain
copied lmao
i copied the portion for args
and the ban kick
who tf told whole?
yeah i told kick command
and ban
your reddit commands, also found on google: https://stackoverflow.com/questions/65515004/problem-with-reddit-command-on-discord-js-bot
stop claiming that code is yours
who told its mine
mine and my friends
80% of your codebase is copypasted and the rest is being held together by external libraries that do work for you
I wish I had this many friends
You can 
tbh like 99% of my code is not mine
cuz of libs
🧠
yo help me with file paths lmao
i don't mind that, i mind people who keep claiming they kNoW javascript and that code they very clearly copypasted is theirs
99.9% for the libraries and frameworks of your dependencies
well if you include your runtime + compiler + operating system + everything else, your actual code is like 0.000001%
oh dont worry about that with me, i hide my plagirism very well
ok well can u guys pls help me figure out python paths?
E
path.relpath()
i know school level of javascript
like how do i fixy fixy this
the error said you are missing an argument
path is an argument
relpath(your path here)
well but yes mine and my friends fault
example of a path?
@vivid fulcrum ty very much for realizing my flaw
C:/windows/system32.sys
i must learn and master the basics first
this is the opposite of what i wanted
i mean i dont know
it didnt specify what kind of path
with relative paths
What are you doing
could be absolute or relative
Open from where and what file
Where are the txt and cog stored?
Try going relative from the main file
If it doesn't look ugly and works... 
lemme try,,
fuck FileNotFoundError: [Errno 2] No such file or directory: 'cogs.automod.words.txt'
when use dog
dot
FileNotFoundError: [Errno 2] No such file or directory: '/cogs/automod/words.txt'
That's absolute path since you added a slash at the beginning
Sorry, had to flip it around because you don't live in Australia
FileNotFoundError: [Errno 2] No such file or directory: 'cogs/automod/words.txt'
still no worky 😦
why not just use Path.resolve
oh python has that?
absolute_path = Path(relative_path).resolve()
any imports?
pathlib
sus












