#development
1 messages · Page 733 of 1
cant you write a scrapper instead of using a webdriver then?
Sadly the scraper need the webdriver to work
Was originally using Chrome till we found the lovley issue that the chrome drivers don't close when the page gets closed
i mean, cant you just use an http request and an html parser?
Possibly? I'd have to double check
I use selenium as my main module for scraping data etc...
i heard about it but i've never used it
but if it is as resource hungry as it appears to be, its probably better to switch
Probably
i mean, i dont think selenium was designed for production in the first place
its more like for testing environments
Surprisingly for python atleast it's main function is web scraping
But probably not on the scale this uses it
Still
Doing a command then getting a response on average in under a second is still pretty good going
if you're using it anyway, why do you need several of them? cant you use the same instance for all websites?
Each site has its own seperate stuff that's cached as sometimes caused interference
And increased the load times
So it was better to sacrifice on ram savings but loose time it takes to load
ah i see
welp, you can make a test using http requests directly and monitor its performance
Yh
See how it goes
Most of the ram is from the DMV site but ig that's cuz it's gotta load a unique specific URL and then add the .orcbrews too it
And the website is a lil underpowered atm
from my own results, http requests done from a vps is more than fast enough, latency-wise
even without caching
Fairs
I'll see how it goes tomorrow
If it seems like it's gonna be a big issue to switch over I might not do it
As on average the ram usage is tolerable just occasionally the system uses alot
yeah well, plan B is always "throw more ram at it"
Yh
Amazon tbf are pretty good on BF
Last year got 16GB for half price so was a good deal
nice
Anyway I'm gonna go to sleep for now
Cya
On a side note I think I'm gonna run out of storage before I run out of ram actually
XD
lul cya
Hi
So I am looking for way a basis to work off of for a command that I can run and will tell me how many times a command was used since last restart.... I am coming here because well idk how to start it I have tried linking it to my command handeler but failed
@hoary elm what language.
Node
Not a language, but good enough.
Save an object (or some list of commands you have) and set the number of uses to zero. Increment it for every use.
hi
If i have the ping 140.5
How to delete the . and after the .?
if you want rounding you can use toFixed(0)
you could also just .split('.')[0] for no rounding
Ty
note toFixed only works on Number, not on String
do typeof(client.ping) real quick
okay then use toFixed
np mate
^^
make what work
say i message !say Hi

how do i make the bot respond whatever i say after the (prefix+"say")
you need to slice the prefix and the command name and get the values as an array
example plesae
i dont speak javascript hepl me lmao
im new to discord.js sorry
xD
JS is not Java
Also not to be rude but please get a basic understanding of the language before asking for help
yes i am much new to javascript
dont know anything to do with it other than minecraft stuff
xD
Once again Javascript is not the same thing as Java
They are two totally different languages
When vote rest ?
The name of Javascript is quite confusing considering they're not even the same type of languages. Java is a stongly typed object oriented lang whereas JS isn't strongly typed and is prototype oriented
@earnest phoenix votes reset every 1st day of the month
@vital lark time ?
anyway for now i still need help with js
every 1st day of the month (ex: December 1st)
how do u set whatever a user replys after a command like !test <hi> how do u change the <hi> into a array
@vital lark time. like hours or minutes
what is the best way to incorporate localization in kotlin? i'm thinking of enum but not sure exactly how to do it (translating to korean/english and vice versa
Yes because as I previously said
you need to have a basic understanding of the language
not very kek but hey august come see if this works
enum Translation(val en: String, val kr: String) {
HELLO("hi", "korean hi lol")
}
to be fair, you should come here with specific help that doesn't already have an answer on so or something
You're setting yourself up for trouble if you don't know the gist of the language. @halcyon ember
language specific questions are fine, but if it becomes clear that you don't know the lang use google.com
ok
cant find the answer for this on google
how do you add a variable in a .setDescription on RichEmbed
?????
like .setDiscription('hi <var>')
string interpolation
<var> being a variable i declared earlier
`${var}`
very useful yes
this has everything on taht type of string
highly recommended read
ooh
thanks
btw
how do u track number of messages in a channel
@valid frigate
read the docs
like this is how i have it
let messagecount = numberofmessages var numberofmessages
??
but the variable shows up as undefined
like now it shows
but its undefined
.setDescription('Successfully purged '+numberofmessages+' messages')
i got it to display variable
??
well
it looks like you didnt read the docs dude
also it means that numberofmessages is undefined
else if(message.author.id !== "430117093573394442"){ message.channel.send(embedNoPerm) i have this
but when on a alt i try the command this is attatched to it starts spamming the NoPerm embed
Cuz there's no command check it looks like it's just checking everytime a user talks
@halcyon ember https://discordjs.guide <-
Hey I need help.
@glacial lynx node index.js
Okay one second
i did it
Wait
k
nope
I mean everything is fine
And he can't get online
Another idea?
@small prairie Should I change software?
Did you ch ange token in bot files?
Whats Your code??
DM me Your screenshot
Alright
Hey bois
Why does my bot collect logs from every server
I have access to everything that was said here
its your bot, you should know
Idk man, did we write it?
hi how to make any bot or which bot makes something add to someones username for example [P] OFF-WARD
instead of OFF-WARD
psl tell
i want to make very pro server and is my first yes
you need to set the user's nickname to it
not that I know of
my friend has htis bot but he doesnt want to tell
ill tel u names of bots on his serer
Rythm dank memer discord server list discord servers donate bot dyno giveawaybot greenboy invitemanager mee6 reactions roles statbot tatsumaki xenon
i think its statbot
but not sure
i wotn get the answer anywhere : (
can anyone help me with this?
that makes no sense
is that all there is on line 6?
but like, if you're only doing that on 2 items, you might as well just do it in two lines instead of using a loop
anyone know how to make val? Discord.py rewrite
What is val
C++ and discord bot development dont mix lol
why not? c++ is used almost everywhere
CPP is fine
If you know how to code it and actually read the docs
¯_(ツ)_/¯
Also @earnest phoenix gonna need more info?
no, : )
Hi
why am I not going to put the description in the bot, that is, I do it with embed.setDescription (), etc., but it does not appear in _help (the bot command)
do you use javascript?
Have to created a new rich embed
try this:
let Embed = new Discord.RichEmbed()
.setDescription("Your Text")
ok
and then:
message.channel.send(Embed);
oh you use it as Function
Hi
how
if you do like this it should work. (no function needed)
client.on("message", (message) => {
if (message.content.startsWith("help")) {
let embed = new Discord.RichEmbed()
.setDescription("Your text here")
message.channel.send(embed);
}
});
bruh just define discord
btw i have also a question. I'm making a mute command but it seems not working. If i would like to mute someone, the bot says undefied and unmute the user instantly.
Here is the script i made after i learned to not copy codes:
https://paste.mod.gg/igakebutuk.js
anyone here using JDA for his bot?
stop misleading him lol, he already has RichEmbed imported
he doesnt need to get it from Discord
the problem is most likely something else and he needs to show his code, dont tell him "do X" without seeing his code first
i did try to help him
@past pike client is not defined
see, now hes trying to randomly add what you told him without context lol
then i don't help people anymore. fine
not every code
if you delete const info = client.categories .map (cat => stripIndents`` ** $ {cat [0] .toUpperCase () + cat.slice (1)} ** \ n $ {commands (cat)} ``) .reduce ((string, category) => string + "\ n" + category);
It's going to put embed.addDescription , but I want everything
tim don't give arguments that are not true
This is a original code
https://discordapp.com/channels/264445053596991498/272764566411149314/647452440748359683
Wanting to help does not always guarantee that you actually give correct help
yes but what tim said was not necessary
@charred loom console.log(info) after your reduce function
damn why 90% people here use JS
see what appears in your console
The one thing i'm learning from this is that I don't have the patience to teach people
ok
He already made the entire embed, but just sends the info part. Just send embed?
move the embed.setDescription(info) outside of the .send() and put it above it
and send embed
I dont like his code layout
Could be better, but should work
ok
if we judged code layouts, we would be flaming each other 24/7
his layout says I just copy/paste code here so whatever
also the stripIndents is wron
Let's not judge layout here
lets focus on the actual problem
i use await messages in js. works fine
I mean true, but it will be a pain later
a pain that must be experienced
is there a way to remove all reactions for a specific emote on a message besides looping through each reaction user and deleting it in discord.net
in order to grow
i know theres a RemoveAllReactions() function but i want to remove just a specific emote not all of them
Can't u just pass it reaction?
the api doesnt have an endpoint for that unfortunately, unless its not documented
so the only viable way is going through one by one?
@twilit rapids a example, because it does not come out
they have
DELETE/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/@me
DELETE/channels/{channel.id}/messages/{message.id}/reactions/{emoji}/{user.id}
DELETE/channels/{channel.id}/messages/{message.id}/reactions
rip
the function you want would be DELETE/channels/{channel.id}/messages/{message.id}/reactions/{emoji}
if it exists, its not documented
yeah so close yet so far xd
xd
whatever ill try and figure something out
you will have to remove one by one
even the official client has to do it like that
thats true i guess
Would be a better idea just to disable emoji adding
Nd manually clear it
As for you is just right click n clear reactions
"move the embed.setDescription(info) outside of the .send() and put it above it
and send embed"
Example please?
message.channel.send(embed)
ok
I don't think .setDescription really returns anything
The one with description?
yea
well rip my hopes and dreams
_help
now i have my own script for muting people, does it still not work -_-
Still have not verified my bot
This is rip
If you can try keeping your embed stuff in one place it will make it way easier later
.setDescription(`${user.username}'s Avatar:`)
.setImage(user.displayAvatarURL)
.setAuthor(message.author.username)
.setColor(0x00AE86)
return message.channel.send(embed);
});```
this is why i hate coding sometimes, no error but bot responds with undefined
JS be like
Idk how to do code blocks from phone lol
console.log() your variables to see why it returns undefined
i will try that
Aha i found it, it was a subkey `
i made a message.send method lol
I just typed it wrong in my code block
but yeah, it doesnt exist on default d.js
what were you expecting to get?
why the bot says undefined when i am trying to mute someone
i mean
your variables
you should have a general idea of what data they contain
for example if a variable you made to hold someone's user id, you should know that it should contain a user id, and you can console.log it to make sure it actually has a user id like you expect it to
so console.log your variables to make sure they hold the correct data as you made them
or if there is anything unexpected going on
that still doesnt help, so debug further until you can recognize what your code is doing
i logged now the ms command
` let messageArray = message.content.slice(" ");
let cmd = messageArray[0];
let args = messageArray.slice(1);
let mutetime = args[1];`
That's what he's trying to do. I dont have the patience to explain it to him
You're getting warmer yes
i downloaded now visual studio code so he gives me options which i can use
🤣
how dare you assume its gender

and what is sublime?
an attack helicopter?
A zenxzio or some shit like that LMAO
and now my whole script doesn't work -_-
at least you know your changes are working
i mistyped a letter lol
Positivity :wesmart:
my worst nightmare has always been when i change stuff and the code behaves like i didnt change anything
happened lots of times due to dns caching
Like yesterday when my VS went to full shit somehow
happened lots of times due to dns caching
literally my worst nightmare
dns caching was happening at my ISP's level and i was wondering why my content changes didn't work at all
now i thought it is going to work but nope
learn how to debug
not everything is going to work first try
step into your code and inspect where's the issue
make it work one step at a time
i already know one let command is wrong, but i am not sure which one
for example
"when the code reaches this point, these variables should contain the user id and a proper time in milliseconds, lets put a console.log here logging them, and fix the code until this part works. then move on to the next part"
you mean this?
thats mostly for debugging compiled code, js doesnt need that
how to get an user object via discord tag in discord.js
filter through the users collection
keep in mind that it only keeps cached users
there's no actual way to get a user by the tag
or by username ?
again, same
you might even get multiple users if you filter by username
it's safer to filter by username & discriminator
what the hell now he says args is not a function
but i haven't changed something
this is more difficult then i thought

i am at a point to remove the whole command. i changed the code but still it gives undefined
Well carefully read/examine what your code does from start to end
and like they said, console log the variables to see that they contain what youd expect them to contain
i used different console logs but still don't know what the problem is
I'll give a hint where to start
This line of your code let messageArray = message.content.slice(" ");
thats about as helpful as saying start at client.on('message'...
If you're so eager to help, do it yourself
im only here to criticize /s
And that's your problem :^)
at this point i dont even know what "gives undefined"
what is ms?
args[1] is the user mention
-_-
i'm pretty sure they're just listening for the event for each command
which like
why
memory leaks
that is not the problem for now
hi i brought a bot from Tbjbu2#0001 last week.
and his bot and server is banned from top.gg due to his misconduct(i think?)
i already email to appeals@dbots.zendesk.com but it says it take up to 3 working days.
So i try ask here,first.
Is it possible to get the bot and server unbanned?
as i am not related to the previous owner.
sorry if this is not the right place to ask this
If he was the original owner of the bot and the one who listed it on the site it probably isn't comming back

unless the appeal is successful
Yh nah he isn't gonna get let back
He was warned multiple times got alot of warns and massively abused the system
but the bot have a change of owner,so i hope they will allow it.
as i am the new owner
@brittle pasture We are not going to be letting the bot back onto our site.
And also
The bot n that got banned back in April
Like you should of checked before you brought the bot if it on the site or if It got banned
If you had known it got removed and the original owner got banned why buy it
he told me if i appeal most likely will have no issue 
Should of looked up the reason for his ban
🤷 sorry
really cant give me a chance?
no. Its been our policy in the past, I don't believe we are going to change it.
i mean his crime isn;t mine
Best you could do is make a new bot
oh i forgot about that lmAO

nah making a new bot wont work @modest maple
shave your head, change your identity, move to hawaii and start over
I'm saying if you want to own a bot and list it make it yourself so you can maintain it
wut even new bot wont work?
If you program it new it'll be fine
But you gotta understand
If you can't program it what u gonna do if there's a update
chillfish is taking this out of context
and trying to help
when its not needed smh


F
wonder if the other voting site even useful
idk
depends if he got banned from there aswell xD
but thats nothing todo with DBL
he using the other site 
speaking of which, i've lost track on what lists my bots and servers are in
it will be a pain in the ass to find them all and remove the listings
F
one of my servers has half a dozen bots for server listing, but idk what lists they are from
lmao
gg
good thing that most people migrated to dbl/top, so now you dont need to maintain 2353452 listings anymore
bad thing is most of those bots are straight up copies but that's another story :^)
yh
they all want to be the next mee6 that does everything
so they just copy moderation code and other stuff and slap it together
welp, let them try
on an actual note:
Anyone got any experience using Google Drive API with python?
they'll give up after a few months probably
glitch is shit
i wonder how many thousands of dead bots are listed rn
eh... probably 1-2k
glitch is most time down or it does not start the bot (that's the problem i had)
cuz its not designed for bot hosting
thats most likely a code problem, not a glitch problem
nope
as bad as glitch is, if your code is good, even glitch will run it
i moved to Heroku and now everything runs fine
i use javascript
there is a dedicated essay on the issues with heroku
from __future__ import print_function
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
# If modifying these scopes, delete the file token.pickle.
SCOPES = ['https://www.googleapis.com/auth/drive.metadata.readonly']
def main():
"""Shows basic usage of the Drive v3 API.
Prints the names and ids of the first 10 files the user has access to.
"""
creds = None
# The file token.pickle stores the user's access and refresh tokens, and is
# created automatically when the authorization flow completes for the first
# time.
if os.path.exists('token.pickle'):
with open('token.pickle', 'rb') as token:
creds = pickle.load(token)
# If there are no (valid) credentials available, let the user log in.
if not creds or not creds.valid:
if creds and creds.expired and creds.refresh_token:
creds.refresh(Request())
else:
flow = InstalledAppFlow.from_client_secrets_file(
'credentials.json', SCOPES)
creds = flow.run_local_server(port=0)
# Save the credentials for the next run
with open('token.pickle', 'wb') as token:
pickle.dump(creds, token)
service = build('drive', 'v3', credentials=creds)
# Call the Drive v3 API
results = service.files().list(
pageSize=10, fields="nextPageToken, files(id, name)").execute()
items = results.get('files', [])
if not items:
print('No files found.')
else:
print('Files:')
for item in items:
print(u'{0} ({1})'.format(item['name'], item['id']))
if __name__ == '__main__':
main()```
ahhhhhhhhhh
lmao
fuck Gdrive api man
i have no problems with Heroku
no
i do
vscode
Pycharm
i use sublime text 3
I use VSCode, IntelliJ, and Rider
wtf is this
lmao
google for html a tags
urls should be placed in <a>
<link> is for linking resources, such as js and css files
anyway, whats the actual problem you have?
yeah look up <a> tags
thats exactly what an <a> tag will do
imo Google API python wrappers are hard, but then again I never worked with Google APIs
google drive api in particular is hard
because it needs to have so much security and shit
Judging by the code snippet above, I can't disagree
Has anyone worked with CLion?
no but ive heard its pretty good
<p> <?php echo json_encode($_SESSION['guilds']); ?></p>
How do I filter the servers that only the administrator has?
only administrator has? what do you mean?
help
How do I save an image to local?
@charred loom
lmao
welp from reading above
im facked
slowly we will get there
atleast ive got it listing files stored
and can acsess files
but pguihdaguahd
help now?
Discord is not defined
How do I get this key
help?
@earnest phoenix
@quartz kindle
and what do i do? help me?
Anything correct is marked with green
anything incorrect is marked with red
Apply common sense to replace incorrect with correct
Try it
@_@
that code is from the internet isn't it?
I mean
if that's your own code then you'd know why it isn't working
What code
there it is
what did yoy expect to happen
the bots you just made won't go online by magic
you have to code 'em
you can learn to code online
Where I start
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
there
find a language
then learn that language
@native cypress do you know any programming languages?
Bruh
@native cypress check our #502193464054644737 channel for a good headstart
i would take a look at the highlighted area
ok
What happends when I’m there
you read it
and you need to learn how to actually code
its a skill that needs to be developed
K
not something you can do in an hour and be done with it
Where I learn how to code
Ah, I had not really read it, I will remove the link
@native cypress https://www.codecademy.com/learn/learn-node-js you start here, learning the basics
how old are you btw? I can get some guides that would be suited to your age group
Which node.js do I download
just go on that website and sign up so you can start to learn how to code
Can I pick a random file from a folder?
Do you have a code for example?
no, we dont spoonfeed here
look at your language docs to figure out how to read a directory
then get a list of the files in the directory
then pick a random file using your languages randomness
hint, fs.readdir returns an array of every file in a folder 😎
I tried this
var fs = require('fs');
var files = fs.readdirSync('/resources/');```
But gives me this error:
Error: ENOENT: no such file or directory, scandir '/resources/'
lol idk much about fs
but try fs.readdir('./resources/');
wait no youre ok actually
just the input is invalid
How do I know what the right input is
try fs.readdir('./resources/');
TypeError [ERR_INVALID_CALLBACK]: Callback must be a function```
var files = await fs.readdir('/resources/');
idk
that is what i did
kinda
no nvm it is what i did
So can I program my discord bot I made now
@glacial mango need to add an async keyword in the callback
I don't know where the callback is
did you add the callback in readdir
Might wanna use readdirSync to do it without the callback
so like readdirSync(path) which returns an array of files
thats what he was using already
the problem is has nothing to do with async or callbacks, just that it cant find a folder named "resources"
oh
fs.readdirSync('/resources/'); is correct, but keep in mind the following:
/resources will look for a folder called "resources" in the root directory, not the current directory
./resources will look for it in the current directory
../resources will look for it in the previous directory
I was kinda talking about https://discordapp.com/channels/264445053596991498/272764566411149314/647523439950692377
because he told him to use await fs.readdir('/resources/'); lol
oh ok
which is wrong eitherway because readdir() is not a promise, unless you promisify it first
I guess I kinda misinterpreted that 
What are your must haves for development? Curious and kinda wanna use new stuff
Lol. I’ll try some vim stuff
vim out of the box
^ absolutely
isnt that just writing code on prod with extra steps
well, yeah but what are the extra steps?
would you prefer coding inside an ssh terminal?
yes i do that sometimes
:(
That or just do it locally then open WinSCP or something and move them over there
but it's much more hassle
i experience more lag on school pcs and those dont even have any connections theyre just bad
lmao
I mean tbf the latency on SSH isn't really noticeable at least to me
Yeah
I would use postman for rest apis
Then again it differs for everyone. I find that I can see it, but it's not really too bad unless I'm typing rather fast
also depends on your location, its not that bad if you live in the same country as your vps for example
yeah exactly
its a bit noticable but not too bad for me
I live in the same country as my VPS so it's < 100ms there and back
at least when my internet isn't dying
I really wish windows explorer natively supported SFTP tho
it supports FTP but not SFTP for some reason
ye
I'm just so used to Explorer that any non-native one running on Windows feels off
Couldn't you just have it so that you have to type in your password every time tho?
Unless you use keys huh damn
yeah but how would that work if you're gonna edit a file directly on it
is it smart enough to keep a session open only for that file?
Yeah nvm
does the discord api give me an error if a message embed cant be dispalyed because no perms
Well the solution to that is not to get a crypto virus
nice typos/edits
you get a perm error if you dont have embed links permissions i think
does anyone know how to add a Status on to a discord.py bot?
read docs
im getting a 'm3u8stream/lib/parse-time' module not found
Theres no redirect to the file where the prob is
Ping me once asnwered
Pls and ty
code? @short ocean
Ytdl core
and what language
http://zetcode.com/python/prettytable/
This module exist for javascript?
PrettyTable tutorial shows how to use Python PrettyTable module
to generate ASCII tables in Python.
its open source so you could probably write an implementation of it
@earnest phoenix idk lmao
do you mean https://npmjs.com/package/table ?
nvm after 10 seconds i found https://npmjs.com/package/prettytable
No anguwu
oh
MMmh i will test this
But this use console log
you can just console.log(table)
yeah you can configure table to use custom chars
oh yeah
stupid me
i promisified the fs.reeddir
but it doesnt matter anymore lol
!help
my bots like not connecting at all for some reason
it usually works fine, but now it just cant login
is there a bot login rate limit? I'm getting "shard took to long to get online"
discord.js
api might be shitting itself
possibly
got a connection issue on mobile a few minutes ago
ill try regenning my token
discord developer portal is inaccessible
api is shitting itself yeah
my already logged in bots are functioning fine
yup. i was just running some tests on my bot, tryna log it back in, and just couldnt
portal working again, regenned my token and now my bot can login again @tacit stag
just tried to login again. thanks 🙂
np
let tchf = guild.channels.filter(c => c.type === 'text');
if (tchf.size > 0) {
client.guilds.map(g =>
if(humains < 5) return await tchf.first().send(`:flag_fr: Le serveur n'a pas un minimum de 5 membres\n:flag_us: The server does not have a minimum of 10 members`) && await client.guilds.get(guild.id).leave()
}```
It doesn't work, how do I do it? :/
You're trying to use await in a function that's not async. Make it async.
@atomic quarry you need to code your bot to make it online
check #502193464054644737 for more
No wait
@loud salmon I know that I have it coded but the code isn't working so well
ah gotcha
Would you like to see what I have?
uh yea, post the specific issue that you're having
and then someone may come along and help
Ok
ers`) && await g.leave()
^^
SyntaxError: Unexpected token if
client.on('message', async (message) => {
if (message.content.startsWith(`${prefix}cg`)) {
if(message.author.id == config.owner){}else{return;}
const total = guild.memberCount;const bots = guild.members.filter(m => m.user.bot).size;const humains = total - bots;
let tchf = guild.channels.filter(c => c.type === 'text');
if (tchf.size > 0) {
client.guilds.map(g =>
if(humains < 10) return await tchf.first().send(`:flag_fr: Le serveur n'a pas un minimum de 10 membres\n:flag_us: The server does not have a minimum of 10 members`) && await g.leave()
)
}
}
});```

oh god
put them in a {} @earnest phoenix
you can't use ands to chain statements unless there's some extremely odd thing I'm not aware of
Oh okay ty
Guys anyone know about all ytdl audio quality type's ? i need all like highest, lowest etc.
@amber fractal there is only two types for audio highest or lowest
did you read the itags part
@amber fractal yes but still didn't find anything there

help?
@charred loom why are you using .setDescription in thin air
there's nothing to use it on
you need to add embed or whatever your embed constructor is defined as
embed
.setDescription()
.etc
i gave you an example
well it doesn't work
but
ok
move the embed code to below the setColor or add embed in front of setDescription
that might help
Can I let my bot have multiple prefixes?
what's the estimated time to get your bot approved?
#502193464054644737 @thin acorn
@charred loom remember this from yesterday?
since you can make multiple fields
you don't set them
but you add one
simple if you think logical
its easy, really simple
but
xd
telling him to use ${} would probably result in him doing \message.guild.me.displayName, message.guild.me.displayAvatarURL`${}`
cough
nvm
but yeah just remove the backticks
imagine backticks if you only want to display a value and nothing else
and no additional text
@client.event
async def on_member_join(member):
for channel in member.guild.channels:
if channel.name == "general":
await channel.send(f"""Welcome to the server {member.mention}.\n Current number of members in the server: {guild.members}""")
how do i make a member count?
Member count of which server exactly? The one the user joins?
Your member variable is an instance of a Member class, which contains a property guild...
<guild>.member_count if you don't cache everything
len(<guild>.members) if you cache everything
<guild> being an instance of a Guild
guild being the server id?
Do you know the difference between a class and an instance?
yeah
That you literally used in your for loop
so i need to define guild
So to get the guild the user joined, you use member.guild
and to get the member count of that guild, you access the member_count property of the guild instance
Let's apply common sense
if we define guild variable under the lines of code where it is used, will it work?
meh fck it, just put it above your for-loop
lol
wait did someone actually gift you nitro today because of ur status?
yeah lol
damn sounds like something I need to try
I suggest you go through python courses after this
Because I don't think you understand how to declare variables
Unless the bot issue is urgent, I really advice you to take a step back and get cozy with Python itself before getting to complex variables such as discord.py
You don't understand the difference between declaring a variable and a function
okay\
See, you didn't take your time getting used to basic Python syntax first
and that's not the right way to make a good Discord bot
i dont know python, but isnt it just guild = member.guild?
or something like thqt
I wouldn't spoonfeed
okay
but yes

nah cry, it's more of a "learn python" thing at this point
yeah tbh
:p
bruh
oh boy, Python with its indents will be hell for you at this rate
oh yeah
haha
shiv
i have no idea lol
if you are indenting something normally, then on one line you indent further than needed, what does that cause?
That causes an IndentationError
yeah
Did you seriously just declare an unnecessary function under an event
oh ok thanks
bruh
gonna just point somthing out yh...
do you understand how async works with python and the await command
and how its used in discord.py
how it's used in python and discord.py
dude, idk much about python, or the syntac
i learn when i get an example
Copy->paste->learning->developing->pr0
jkjk
surprisingly
that's what a lot of "bot devs" here do
lol
bruh I can't even get a member count working
its so confusing
also how do you get bot dev role
in this server
okay
dude you dont even seem to know how await works so no wonder why member count isnt working
await






