#development
1 messages · Page 1488 of 1
because like in C you need to define which files you want to compile in the compiler
in js you need to explicitly import/require the files you want
nothing is automatic
alright great.
Ay yo guys why is my bot not online?
General
alright
nice token
logen and you leaked your token
brb let me hack your bot
NO DUDE @quartz kindle
lets delete that image should we?
:^)
My bad..
refresh your token
I’m so dumb
regen your token
Alr did it I’m so fucking dumb I’m such a idiot
make an OCR selfbot that'll bomb every token it detects
Why am I so dumb I’m an idiot
if you regen your token then you can send the image
and how do i initialize it?
Damn I’m shaking @regal creek are you sure it will not do anything?
idfk it's your code
lmfao i am 100% sure
Damn I’m still so dumb
once you regen the token, the old token is instantly invalidated
so yes, you're safe
I found out it was Logen that was wrong lol
@quartz kindle lol you tried to hack me >:(.
i was just scaring you
I know you were joking dw
adding: you told your code "hey, this exists" and nothing else, you didn't tell it what value it has or anything, you just told it that it exists, so it takes a null value by default, because you didn't tell it otherwise
so i have to do this?
@quartz kindle @regal creek lol sorry I’m new to coding @earnest phoenix
that's totally unrelated
so how i can fix it
@earnest phoenix look in dms
but why is it or how is it pointing, when i am jut initializing it in the code line ,where the error is
ok so now i dont get an error, but the window doesnt apear too
but why is it or how is it pointing
everything is explained in that SO thread, which if you have bothered to read, you wouldn't be asking this
when i am jut initializing it in the code line ,where the error is
except you aren't initializing anything, you just told it that it exists, it exists period, you didn't give it a value
imagine having a chill conversation with a person and you mention you have an orange, the person asks you if they can have that orange and you say "i don't have it on me right now"
null means it doesn't have a value, it isn't a valid state
hence... null
Why does it show error?
I like that orange example 
you're using apple quotes
Why is it showing error?
you're using apple quotes
Yes??
you're using apple quotes
just saying that this " is a normal quote, but i sended that same message already
py?
i regret to inform you but it's not cyberpunk nor 2077 yet, we cannot peek into other people's eyes
It’s just showing error it’s uh glitchy @inner roost
but like is js, py or wot?
Ohh
Js @inner roost
Uh wtf
It just is not working..
I stopped by earlier and was told to do a personalized event. in short, I want the emission bot in the event again if the user is not found in the database, and with it already registered, execute the command
could someone tell me if this will work?
I am using eris
Test it and see if it does
(I'm not familiar with eris)
If you want to know if it works, try it ^_^
i only know py :(
:>
I tried, but it leaked memory, I wanted to know if this could cause problems in the future or did something wrong
WHY DOES IT KEEP SAYING ERROR?
WTF
Probably because it's creating a new event handler every time. You might want to look into how to delete event handlers (unregister them).
?
alternatively, register it globally and figure out how to give it the information it needs to run outside of that command.
Because you're not closeing anything. I don't see any of your } or }) anywhere.
I mean you have to close every { with a }
Understood, I will make a handler just to start the custom events
syntax in javascript needs both opening and closing.
You should probably learn javascript before making bots, to be honest.
^
Can you circle them?
I can't
ok
because they're not there.
Wdym?
Please read #development message
You need to help yourself before we can help you.
How make handler for 3 carpet commands
3... carpets?
I have 3 directory of commands how make handler
Take a look at https://github.com/eslachance/djs-handler it will probably help you
good example code for it.
I have an folder commands in the 3 subfolders i need a handler
Yes. Look at the code I linked.
Ok
@client.event
async def on_member_join(member):
role = discord.utils.get(guild.roles, name = "Guest")
await member.add_roles(role)
Wont work
No errors
Im confused
I dont have member intents enabled
you need them
because it's not really an error
Still wont work
For glitchy
code?
How to do put ```'s inside of a ``` bracket with ending without making it break the markdown?
Did not work.
Why not? @surreal sage
read pins maybe
My bad
I'm using .net (nodejs) as a server, problem is i cant send data to client manually, is there any way i can see each client
or send message to selected client
Why is this command not working and saying error?
@surreal sage
Ya know maybe?
Before you make a Discord Bot, you should have a good understanding of JavaScript. This means you should have a basic understanding of the following topics:
- proper syntax
- debuging code
- basic features (vars, arrays, objects, functions)
- read and understand docs
- nodejs module system
As much as we d like to assist everyone with making their bots, we rarely have the time and/or patience to handhold beginners through learning javascript. We highly recommend understanding the basics before trying to make bots, which use advanced programming concepts.
Here are good resources to learn both Javascript and NodeJS:
Javascriptinfo: https://javascript.info/
Codecademy: https://www.codecademy.com/learn/javascript
FreeCodeCamp: https://www.freecodecamp.org/
Udemy: https://www.udemy.com/javascript-essentials/
Eloquent JavaScript, free book: http://eloquentjavascript.net/
You-Dont-Know-JS: https://github.com/getify/You-Dont-Know-JS
NodeSchool: https://nodeschool.io/
CodeSchool: https://www.codeschool.com/courses/real-time-web-with-node-js
Evie s Accelerated JS: https://js.evie.dev/
Please take a couple of weeks/months to get acquainted with the language before trying to make bots!
why dont use python 😳

smh
member.kick().then()
@subtle hedge
😱 
boobies operator
NOOO
(.)(.)
@subtle hedge wat
spam
WHYWG ERROR
Where
Like where
me coding all my things in mobile cus i dont have pc: 
40wpm pain
lol

this is definitely wrong
but just saying ERROR doesnt help
you have to show the actual error you got
all of it
also, idk what you have before line 7 and after line 41
there could be more issues there
xd
Sanwich
😱
Can somebody help me figure out what's wrong with this file? https://github.com/TannerReynolds/Techies-Top.gg-Bot/blob/main/src/bot/commands/leaderboard.js
It won't log anything under this loop
for(let i = 0; i < sortedVotes.length; i++) {
if(sortedVotes[i].id === msg.author.id) return authorPlace = i + 1;
}
console.log(sortedVotes.length)
Trying to make a leaderboard. This is the output from running the cmd
Discord bot designed for Techies Hideaway https://discord.gg/h2Pgcpfm4g - TannerReynolds/Techies-Top.gg-Bot
yah
poggers
u use the shareX thing?
It’s still saying error..
there are many issues with this, you should probably learn js
I used it for a while before I made my own
what DB are you using?
@earnest phoenix did you read anything of what i said?
Well a bit little got a bit confused @quartz kindle
your code has a lot of problems, just delete most of it and stick with the basics
First I read introduction then manual thingy and then code editors etc?
and note what i said about errors
Hm what was it I can’t remember I’ll write it down this time
you are complaining about errors but you never say what error is it
you need to show the exact errors you have
I am confused too I have no idea what the errors is
otherwise its a guessing game for most of us
it says what the error is
I don’t see anything wrong
click on tools
Almost saying the same things
Do you think I should change from BDFD to DBD?
the most important part of the error is the beginning, the first couple lines
Wtf?
BDB*?
if u want ofc yes
pls stop
spam
@quartz kindle
are you not reading my messages?
I did scroll up...
I mean of the coding?
Most people don't actually read
tru
@earnest phoenix scroll up the error log, there should be one line that does not start with "At.."
@earnest phoenix he means the start of the error in the logs
im thinking its just returning the entire function, not sending the message or anything
That could do that with no error log or anything
yeah im thinking thats the issue
@quartz kindle syntax error?
yes
thats the part of the error that actually tells you whats wrong with your code
thats what you should look for whenever you have an error
It’s dosnt really say anything.
and thats also what you have to show people when asking for help
what does it say lol
Unexpected end of input @quartz kindle
what line?
opened { or ( that you never closed with a ) or }
never closed
thats why i said, delete most of your code and start over
Do you guys know a place where I can get some like codes for kick commands, ban command etc....

you are coding blindly without understanding what your code does, so it will be very hard for you to try to fix errors like that
thats why im suggesting you to go slowly
Yea, I’m just watching YouTube tutorials for codes @quartz kindle
the issue is that everyone codes differently
But none of them seem to work
because code is not copy-pastable
so things from other people won't work
code is like a puzzle
How do I make my own coding?
for a piece of code to work, all other pieces need to fit
I’m very new to coding that’s why I might be a bit yea....
if you copy paste code from the internet it will likely never work, because it was made to fit with other pieces you dont have
thats why you have to learn to understand what the code is actually doing, once you know, you can easily change the code to fit yours
But I don’t really know how he pieces work
If you wanna learn w3schools is a great way to learn basics
you can try stuff like codecademy
Are those websites?
yes
Thanks guys you guys are very supportive! @quartz kindle @tulip wave @crimson vapor
@undone rose is it working now?
@tulip wave confused again I’m at the uh coding place but I don’t know what to write

@earnest phoenix just read through it. It has all the basic functions that JavaScript can do (yes it is web based js but most of it can be used in nodejs)
its like learning a new language, its a process that takes some time
The uh website is very very very very confusing
w3schools?????
Ye


IMO (and probably other people) w3schools is easy to understand
There's a sidebar that shows you different topics
Whats confusing about it?
@earnest phoenix try this one https://js.evie.dev/
probbaly too fast tbh
Lemme try @quartz kindle
discord.py for the @command.has_permissions() decorator, is there a way to say has_permission() OR has_any_role() in the decorator?
yeah but does the command decorator allow me to say if @command.has_permissions() or @commands.has_any_role() then run the command?
you colluding with evie arent ya, ya cheeky wanker?
you'll have to use an if statement then
inside the command?
rip the easy way out...
yeah i know
but i was hoping i could do it in the decorator to make it easy
xD
Just 1 if statement
i dont know many guides or courses around to recommend, so i just default to the few ones i know
yeah but now i gotta reformat it and ugh
It's fineeee
its FINEEEEE
im just playing around, its a good guide
THIS... This is fine

ye evie's stuff is good
@umbral zealot we expect the ads payment by the 2nd of january btw
i need java.evie.dev
lmao
what are you doing in javaland, come back to js
ravy no longer friends with js. go new best friend
im still frien with js
it's like this
I was born in Germany but I primarily speak English
because my job demands that
Sometimes relationships are ending, Tim.. the world is brutal 
but if I want to speak German I can and way better than English
same with js
Like
Help
Die
Suffer
Nerd
Bruh
but i dont need it rn
you mean ... how to add embed fields?
my native birthlanguage is my third language, and way worse than the first two languages lmao
every time I try to make a list it dosnt work
or how to add newlines
@tight heath new lines
So
Alr thanks
ich must habe ein grosser wurst
lmao
Probably makes ur girlfriend happy, us not
how can i get flask to send/update a variable on html with js without reloading the page
no im just hungry
like for example
a vanity url
if vanity url is taken
it responds with ano
if its not taken
lmao... that’s what happens if you trust Google
@tight heath it isn’t working?
you dont literally write new lines in the code
Uh
you just add the new line character, like ravy showed
but keep the code in the same line
No lol
Idk why it aint working smh
the code editor should automatically break likes that are too long
if not, an alternative is to use template strings
Ban bans a user
Kick kicked a user
Lol loled the user
Noob noises the user
what even is that code editor
glitch probably
Glitchy what should I use? @tight heath
oh no it hurts me physically
The output will be parsed like that, not the code
How lo?
anyway, you can use template strings instead of quotes
for example
"abc\nxyz"
`abc
xyz`
notice the different quotes
how can i get flask to send/update a variable on html with js without reloading the page like for example
a vanity url
if vanity url is taken
it responds with a no
if its not taken
it responds with yes
and then itll show a worked or not worked message
Yes @quartz kindle
node v14 be like
@tight heath what should I use instead glitchy#
node 15 is bae tho
please dont ping me
Sorry my bad
how about catch and default to null then do the optional null
im still using v12 in prod lul
Lol
but im gonna change to 14 soon
but i updated a few of my benchmarks from node 12 to node 15
and had a performance increase of 250% on some cases
especially zlib
i should probably use two docker containers
for building and running
to save space
but I have no clue which deps are build and which are runtime
especially for canvas
isnt runtime code all self-contained in node_modules/module/build?
after its built
how can i get flask to send/update a variable on html with js without reloading the page like for example
a vanity url
if vanity url is taken
it responds with a no
if its not taken
it responds with yes
and then itll show a worked or not worked message @placid iron from earlier
use XMLHttpRequest or fetch from client side js
show code
@quartz kindle I've tried saying that multiple times with flazepe 
where are the new lines lol
ban\n> bans someone\n\nkick\nkicks some one
rip
Something like that but actually correct code
why patch method?
Uh, it was for a modules thing so he wants to patch the data in the database I assume
i understood he only wanted to check if something is available or not
Yeah, on my bots dashboard I use post for everything but I'm trying to get into the habit of using the correct methods
ye
my issue is that i have an API with very long and complex GET requests
so i cant use GET because it risks running out of length
so im forced to use POST
There is a max length for URLs?
@quartz kindle ayyyy thanks man!
first answer has lots of interesting data
@quartz kindle how do I make spaces lol?
ye
Yes lol
you make spaces with spaces
Uh I did that..
you want more spaces? or what
on the website you are going to have a form i assume with a submit button and a text input for the vanity url. when the submit button is clicked you can run a js function, that function will send a get reqeuest (or any type you want) to your server. something like domain/check_vanity_url?url=:user_input and your server will then check if it is available. if it is then the server will respond with a status code of 200 or 503 (unavailable) this will be in the response from the fetch function in the website. the website can then check the status and change a dom element to indicate that
mhm, how would it send the request? like it would redirect the user there? then it redirects the user back?
you know python has teh requests module
javascript has bascially the same thing but it is called fetch
lgbtq+ bot? 😱
@drifting wedge
aiohttp > requests
requests easy 😎
isnt requests blocking?



Yea
But blocking 
guys I use a cell phone and I don't know how and where to program my bot with DBD help me pls :(
what is dbd @jade juniper
why don't you give up
i thibk u can use repl.it
:>
is a page?
I programmed my Reaper bot solely on repl.it
Even hosted it on repl.it
700 lines of python code later...
mhm
gimme a min ig
bruh
you have had like 109823 hours
https://img.rovi.me/zgCcJhnhzV.png done this in that time
Server count with?
it's a good option danbot?
how do i make a form submit button not reload the page?
@placid iron should i have the js get the inputs and send the request, or should i use flask to get inpit
input* then validate
then send back
Google it
alr ig
- How do you think flask can even get the input.
Not really
alr
well i got it working, it gets the input with no js
but like should it go to a js func, js func do fetch on url to get a response
Query strings from the form ig
and then depending on response, do it
If it works why change it
well cuz i need to show a thing or another thing depending on validation
like if its valid i want it to say: worked for example
Yeah you got to write js for that
and if not: say: didnt work
mhm
so id get all the awnsers from the form, and send it with js with a fetch from the "mini api"
and the output is what it shows?
cant i keep doing the way i do, but then adding something for js>
Idk how you are doing it but do what you just told me
Yeah basically what you have to realise is that the website is basically independent to the server once you sent the other and you communicate data through web requests (a mini API as you call it)
how can i get if a checkbox is checked in js?
Element.checked
so im getting an error of Member <ID> not found when referencing a user that has been banned from a server. Im fetching the user info via await bot.fetch_user(member.id) is there a better method for fetching user information by id?
im using discord.py btw
is there a way to grab the user even if they dont share a server?
thats gonna be a huge bummer
Circle Bot does this somehow
Yes
If its in the cache
Or you have their Id
You can also retrieve users from the banned ones list on a guild which seems like what you want to do, correct?
I don't understand much just by looking at that, but I guess there's an error presumably at line 291
can we count how much message has user send in js?
It's some sort of ffmpeg error
Ah
So not something I coded
Not regularly, you need to store it in something like a database for it however that'll only count the messages after you make that unless you somehow do big brain math and add it on
oh
thanks
👍
discord.Object(id=)
repl.it cannot run mongo
You can connect to another server though
but repl doesn't run server apps
More on this, it's mainly for hackbans that some bots do to ban people not in the server
just their Username and Discriminator (if given id) or ID (if given username and discriminator)
oh shit. really? coming in clutch if that works

you can actually get a significant amount of useful information with a user fetch by ID.
if it works. ill buy you a coffee tomorrow no joke
Ignore the last 2 those are added by discord.js I think.
well i was doing bot.fetch_user(ID)
different language, different syntax ¯_(ツ)_/¯
yeah but in python if the user wasnt in a realted server it would error out
that looks like it works in ANY server which is ideal
The API permits it, and I'm... fairly certain discord.py does it
though I don't write python so I wouldn't know
you only really need fetch_user if the user isnt in your cache
else get_user or get_member is fine lol
im not caching the entire server (at least i dont think i am)

i wouldnt have the users cached in this bot unless its cached on entry to the server
i wanted some code help
mainly because I dont have the storage to cache 10,000 + users or the wherewithall to code it in any efficient manner
can anybody help?
we can't help if you don't ask a question
post question
ok
then ask for help (:
That's a big server

i want a command code that triggers when a bot is invited to a server
you want the GUILD_CREATE event, then.
will it work with js?
u telling me?
so
how you implement it depends on the library you're using.
yeah
i mean
what library are you using
whats a library?

here this might help. #development message
so im passing in the id as a arg in my command. and based on previous help from you an others the member id arg is member : discord.Member so thats where its failing to find the user. any suggestions on ways around this? We used member : discord.Member cause i wanted either a ID, or Username+discriminator to be taken as an arg and this worked splendidly...
discord.ext.commands.errors.MemberNotFound: Member "652373046900031489" not found.
Which member is that?
a banned member from our server
and you want too?
Log their information?
yeah, ID, Username, Reason, Server, Moderator, Date
That may not be possible using discord.Member
you'd have to store that info in a database
in 2 large servers that often share a userbase, so making a bot that has cross server ban logs essentially
well im storing the info i just need to get the info after they are banned
🤔
its not the most important of shit atm but it be very useful to figure out
whats a library?
oof
Bruh
Well that's interesting
like circle has a !ban ID reason command. mine piggybacks off it and takes the info and stores it and then pings the other servers if that user joins (as a sort of watch out for this guy)
a library is a library
Yes
i have made a music bot but... need that guild_create command
and cry is not being helpful
you're annoying
Command or event
event
the word is native to its meaning, doesn't have anything special in programming
it's quite literally a library
Lol
What you could do uh shin is store the persons id
And you could check if member.id == that user who's in the database
again it pulls the information THE FIRST TIME correctly no problem. but if for some reason there was an issue (ie banned user but no reason and wanted a retcon) then it fails where others have succeded IE circle bot
and at this point i might just have a command to retcon an entry in the db.
it does not exist
and your a fucking inbred. fuck off
other bots can get the username because they make a REST request to get the user on a global scale, not guild-bound
what do you not understand about if user go ban, user no longer in guild
thats where im thinking of going have a separate command to retcon data entries since the mods cant @ the user anymore so an ID is gonna have to be used anyways
how do i make a command which triggers when a bot is invited to a server
thats not the question at hand. maybe if you could read youd have more insightful messages
have you tried reading #development message
But you decided to ignore it I guess. ok.
You didn't understand "please take the time to learn the language you're using"?
Yea thats what you might have to do, find if the ID the user is trying to get is in the database
I library is like a wrapper class to some functions and methods.
can someone give me the code
well thanks for brainstorming with me. if you want that coffee tomorrow let me know
you're quite literally complaining about a member not found error
no
We don't spoonfeed here, so no.
ok
WE're not going to do your job for you as a bot developer.
Learn JavaScript first then make a bot.
all you have to do is take an id as a parameter and from there you can do whatever you want
What code do you want ? we can guide you
no. im looking for a way to grab a member not in a guild we already knew the problem we are trying to find a solution you knob head
No problem, rn what you want is kind of interesting so im gonna try that in a few hours when I can
If I find a good way ill let you know
You can't grab a member not in a guild. Members are linked to guilds. You're looking for a user.
Just getting the terms straight, here.
if it works for our couple servers it would massively help since we get alot of knob heads that like to cause wonton chaos
might be too complex to understand
WONTON CHAOS omg
btw cry how did you grab a partial user without it being in the guild the other day ?
yeah member isnt the right term i need a user. you are correct. just using member since they were originally memberts
Hold up ill do that rn shin
I Cannot abide by wonton chaos. Wonton must be presented in a precise, defined manner.
I'm sorry, I'm feeling a little facetious 😂
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
its a fun side project none the less and could actually be useful
I believe discord.py provides you with the discord.User object but.....I've never played around with it so if errors arise

im glad you like my wonton chaos
ive been using discord.Member cause you suggested it
How can I figure out which file is causing this? Can't seem to figure it out
unless you're not using discord.py
I doubt you'll find anything useful in the stacktrace.
See if the stacktrace does point to a file in your project and not your node_modules folder
or go looking through your files to see if you make some api call for doing something with an emoji
so nothing useful
Not what he wants here
Shows its from node_modules
Then what does he want, he's talking about users no longer in a server?
That error happens if it tries reacting to a message with an emoji it doesn't have access to right?
What the heck else would that be?
what you linked is not helpful in this situation. already read the docs. already using it. its the object arg being passed in thats the issue.
take an id as your parameter
Ok and what, specifically, is missing from that user object?
that would error out
I thought ctx.author was actually a member?
but you can't do that because the user isn't a member anymore
sounds like you got a Catch 22 going on.
Do this:
@bot.command()
async def foo(ctx, user: int) -> None:
x = await bot.fetch_user(int(user))```
Mobile so indenting is fucked
issue is most likely the arg is being passed in as a discord.Member object. and that appears to only apply to (as you guessed) members. rewritting it to try with discord.User object instead
exactlyt
I dunno it sounds like you may want to allow the use of passing an ID directly within a message.
¯_(ツ)_/¯
yeah but to appease the overloads of the servers they want Mentions as well added in
🤔
Well, then, do some conditional checks
i originally had it as an ID int only
if conditions are a thing in python, right?
yeah
yea
So, check if there's a mention and if the ID exists. If it does, fetch with that ID. If not, well, tell 'em you can't get that user?
but discord.Member handles both ID, and Mentions as well as some other edge cases
Hey does anybody know if you can put a function across all cogs? discord.py btw
edge cases is why we have conditions in programming.
they wouldnt be able to mention them regardless, no? the member gets dropped from cache when banned, so no @ menu
so utilizing that helps immensly
correct
More context
which is why i think im gonna pass by id in a retcon command just to save myself the headache
@terse finch try this
Ok so i have a function called sendMessage, which sends an embed. Is there anyway i can define it in my main bot.py and have it across all my cogs?
oh
it works how i expect it to
ik you can with variables
and thats what im gonna be doing
from .file import sendMessage

yea that should work, how are you storing info in the DB tho?
I always use the uuid module for cases
And generate them
So You can view full details with them
ok so .file, would that be .Bot.py?
right now its a csv file lmao but im setting up sqlite to store the infor
Say for example digital_tech
We had something like
- Folder
- root
- main.py
- utils folder
- messages.py (utils/messages.py)
- sendMessage function```
In `main.py` now, we can do
```py
from utils.messages import sendMessage```
ok
whats the uuid module?
you could just have an incremental primary key when you migrate to sqlite, it's going to serve as an id
oh no we got a bunch of volunteers from our servers that are getting banned on the daily testing it (it doesnt actually ban so i can ban them as much as i want)
That's how most bots do it yea
thats the plan for noww
Old pic but under ID thats how it looks
Incrementing number sounds easier to type tbf
yeah thats kinda what ares is gonna do.
Yea might switch to that
i figured since all User ID's are unique those would be the primary key in sqlite
But my ORM has a UUID field so I was just like fuck it why not
Can't a same user have multiple cases?
Ok so i have my code in a folder right? Then in that folder i have a folder named cogs, with the function. Would i do from cogs.sendMessage import sendMessage?
unless it's not a modlog thing, just something else
from cogs.your_file import sendMessage
yeah we just append to the data field for the keu
^^
Incremental numbers for case IDs is also easier for the user to type (especially on mobile)
but they're predictable
we arent tracking cases tho
Mobile moderation 💪
ok, you said i can do this in my main.py, can i do this in the another cog?
yes
then UUIDs are probably fine for your case
we are just tracking if a user gets banned and what reason for that ban
tho if its a function thats gonna be used every where, i would put it inside of like a utils folder
🤢
Ok for this, can i just name the folder untils or should i alr have one?
Im sorry if im being dumb, im new to cogs and im trying to organize things
you can see the structure of this
yea
cogs is great once you get past the intial learning hump
yeah i bet
once i learn how to do this i should be set i think...
i have to go sadly, ill see about getting help tomorrow
Cya 
In .replit file
language = "go"
start = " "
What should I write in start?
hello
async def play(ctx):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
channel = ctx.message.author.voice.channel
await voice_channel.connect()```
can anyone help?
plox
@anyone?
breuyhfghfgjkhjlk;kl';
What's the problem
I need to contact the server which has added my bot and has 1k+ members
How can I get the ID
of the server
Hii
anyone knows why when i try this it says 4 users?
${client.users.cache.size}
d.js
client.guilds.cache.filter(guild => guild.memberCount > 10000).map(guild => {guild.name})```
It just says
xl```
can I make a Map readonly?? for ts
nvm
s!eval client.guilds.cache.filter(guild => guild.memberCount > 10000).map(guild => guild.id)
this worked
what is this
remove the braces, around guild.name, to get the names
kk but
bcoz it is not mandatory that the owner will be present in the cache.
<Guild>.members.fetch("owner_id")
ok thanks
the fetch method first checks the cache, and if it is not there, than it will actually fetch it.
So u r always safe there
await it
oh ok
or use .then
But
I have owner ID
can't i directly fetch user
client.users.fetch('ID');
like this
const guild = client.guilds.cache.get('712666566939902033');
const owner = await guild.members.fetch(guild.ownerId);
ok thaks
s!eval let object = client.users.fetch('683307434894164016')
object.username```
Returns undefined
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
channel = ctx.message.author.voice.channel
await voice_channel.connect()```
please help
bcoz that returns a promise
Oh
please help
k
@rocky hearth
``@client.command(name='play')
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
channel = ctx.message.author.voice.channel
await voice_channel.connect()``
?
so I just need to resolve it right
I see it
How do I know, what I need to help??
my bot not joining vc
;-;
`@client.command(name='play')
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
channel = ctx.message.author.voice.channel
await voice_channel.connect()`
You never define voice_channel
yep
...
But the scope
Look here
Edit the reference from voice_channel to channel
Can they access channel outside it? 
yes
Yes
oh
Authour
because it's not under the else
@client.command(name='play')
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
voice_channel = ctx.message.author.voice.channel
await voice_channel.connect()
change voice_channel.connect to channel.connect
yes
Great
that looks more correct
ok
Well that works also
would this actually work?
i am so dumb
Yes
gg
Kinda
It's global?
iirc vars are function-wide so
na na, indentations fks for python
thanks guys
No problem
Python is weird
still didn't join xD
async def play(ctx, url):
if not ctx.message.author.voice:
await ctx.send("You are not connected to a voice channel")
return
else:
voice_channel = ctx.message.author.voice.channel
@client.command()
async def stop(ctx):
voice_client = ctx.message.guild.voice_client
await voice_client.disconnect()```
No error gets printed in your terminal?
no error
It should be this
