#development
1 messages · Page 1613 of 1
yes, like everyone else
As soon as the bot restarts
add that, problem fixed.
yes, a lot of people had the problem. Add the line, the problem goes away, it won't cause issues in the future either, so it's not harmful.
Thanks
Yeaaa
if(!guild.available) return;
else{
console.log(`I was kicked/banned from: "${guild.name}" :(`);
client.users.fetch("601446917007736832").then((user) => {
user.send(`I was kicked/banned from: "${guild.name}" :(`);
});
}
});```
Like this right?
ook
is there a site where V11 and v12 embeds are written to pass the bot from v11 to v12?
what does git sync do?
it syncs with the remote repo
for example, if you commit an update on one computer and want to get it on another, you use sync
I need a table with changes in v12
thanks
ben turkum site does not translate into Turkish
@solemn latch can be done with node
aight
why am I getting a nullpointer exception on doing ```csharp
System.Console.WriteLine("some string");
you aren't by doing just that
but it says that its System.NullReferenceException:
like do i have to using System.Console ?
hmm you right... it is that part below it... but why does it then do nullref in wrong line?
oh nevermind
You dont have to read the english, just read the code
for example, this shows disableEveryone was replaced by disableMentions.
https://woo.pics/images/f97389b3c8.png
okay, i have been struggling with this:
https://sourceb.in/riCs5KCvx3 - When I use IDs to ban someone, the response "Please specify a member!" returns. However, mentioning a user works just fine. Any ideas on how to fix this?
get is a cache lookup
so you should use fetch which does a cache lookup first -> if not found do a REST request
it's a promise so you should await it
user not exist in memory
should use fetch because fetch first try to find in memory, if fetch doesn't find user in memory, fetch is going to ask discord to give the user to you
ah okay
cant you just use the member manager ban method with the id directly?
also this
i will try this
oh wait
i did .-.
you'll still have to fetch if you want to access the details like the tag though
yeah, mb i didnt realize you where fetching the user
you should fetch the user before banning
ok your doing that
i should look at code before answering

yeah no i know, but the get is above the ban, so when they change it its already in the right spot
await it, but yeah 👀
i tried awaiting it
the fetch?
the message.guild.members.cache.get(args[0])
uh
get != fetch
yeah
you were supposed to use message.guild.members.fetch
not message.guild.members.cache.get
for the await
attempting to see how many entries each user has in a database so i can find who has the most. this is the code i've got so far (that doesnt work) js let officers = await client.logdb.findAndCountAll({ attributes: [[sequelize.fn('COUNT', '*'), 'count']], where:{ guild: message.guild.id }, group:['user'], order:['count', 'ASC'], limit: 1 }) , with the error of SQLITE_ERROR: no such column: logdb.count now a working example would look like js let officers = await client.logdb.findAndCountAll({ where:{ guild: message.guild.id }, group:['user'], limit: 1 }) in which case this returns ```js
[
{ user: '252200781376258059', count: 1 },
{ user: '629841787720302593', count: 9 }
]
the code that doesnt work is supposed to make an alias(?) and i can order the database using that?
this is sequelize by the way
how do u turn this 10h5m20s into milliseconds? I tried the npm package "ms" but that only converts it if it's 10h or 5m or 20s not all together
Hey how do I actually add aliases to a command?
Such as !kick, but also !k is allowed.
you can do each individually and add them? or just do the math
does it NEED to be like that?
joined?
yes
Otherwise I could just split it and add individually
yes
then no, i do not know a good way
Could use some good ol regex
just split that string into 3
then use ms() and add them together
That’s going to be hella complicated if you try converting while it’s all joined
but it can also be 10h5m for example
That works?
sure I can make it split then ig
I wanted to have it all i narguments but Ican make a message collector
split by space, slice(-1), check if last item is s/m/h/d/w, then parseInt the rest, if !isNaN add it to total in ms
alright ty
why cant it all be in arguments if its split
!reminder 1d 1h 1m 1s
can all be in args
the way i did it is by splitting everyhing, harcoding arguments is stupid imo
so even if i were to do this
it just takes the highest
i had it before to add it, but that seemed like an annoyance more than anything
i mean, hardcoded or not, doesnt mean it cant be args. your way is args too, hes implying he must use a message collector if its split.
my method is exactly like that
I need to find the 2 and discord nitro wich isn't possible when having 5h10m2s split
remove them from args when you find them
alright ty
now im gonna have some random ass pings in that server without knowing why they were there in the first place
noice
also isnt giveaway bots really flunking?
Hey! I’ve got 2 questions. 1: how long does discord take to verify my bot? 2: how do I make a command alias?
i recall some talk about it somewhere
weeks, usually 2, but can be more
- depends on ur command handler
Logical or?
OR
if(command == "command" || command == "c") {}
np
highly recommend stop what you doing btw
and use a proper command handler
you know whats damn satisfying about working with c++ on node.js?
seeing your memory usage reflect immediately on everything you do
allocate 1gb of random stuff in a c++ map, clean it, watch rss drop from 1gb to 50mb in 1 second
Is the api issue already fixed?
no
anybody worked with mysql in combination with js/ts before?
gotta build an api with mysql for a school project. does it work well with js?
You didn't import/require Discord.
it works about as well as with any other language
okay ty nice to hear that
hi,sorry but mi pc all programs is with icone google chrome help!!! :c
how do i spread that?
Settings -> default applications
yikes requring inside function
Why tf are you requiring it that many times?
Bruh
I did
Thats what I said one sec for
same thing tho..
wait
dang it
message embed
one sec again
Where are the settings? default apps?
Little cog icon on start menu
Ah wait, is that windows 7?
Click settings on start menu then
I got this:
const Discord = require('discord.js')
const MessageEmbed = require('discord.js');
module.exports = {.....```
and it gives the same error
Why
cuz flat aparently isnt spreading the array inside
even though it should
the final is the one i wanted
the second last is without the filter
and first is just flat() after map()
which was supposedly to flatten with depth
but it aint
¯_(ツ)_/¯
can anyone help me? my bot by a command will create a role and a channel, how do I make it to where my bot creates a variable for each channel and role made?
use a database
aight thanks
long answer: choose a database, create a table (if relational) or a document (if not) and store the guild <---> channel/role relationships
its perfectly fine
somebody help me (discord.py) dm
read channel topic
ok
if thats not enough, read this amazing article https://dontasktoask.com/
@hexed citrus
Quick question, and I am sorry if it's been asked before.... How do I allow my recruiters the ability to approve or deny applications, instead of only myself as administration?
File "bot.py", line 26, in <module>
client.run(TOKEN)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 718, in run
return future.result()
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 697, in runner
await self.start(*args, **kwargs)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 660, in start
await self.login(*args, bot=bot)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 509, in login
await self.http.static_login(token.strip(), bot=bot)
AttributeError: 'NoneType' object has no attribute 'strip'
I need help
Yes
This is in python btw
Hi please specify what the content of your variable TOKEN is
It seems that your TOKEN variable is set to None
Can you try to set it to a string?
Containing your token
instead of a .env
Yeah
The argument must be a string
To pass environment variables you can read that: https://stackoverflow.com/questions/63530888/how-would-i-go-about-creating-an-env-file-for-my-discord-bot-token
So mystring=('token') where mystring is token?
discord.errors.LoginFailure: Improper token has been passed.
this is after I made it a string variable
Are you sure your token is correct?
Make sure it's not the client id you're passing
But the token
yes
Do you have a traceback
whats that?
The detailed error
in logs?
File "bot.py", line 26, in <module> client.run(TOKEN) File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 718, in run return future.result() File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 697, in runner await self.start(*args, **kwargs) File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 660, in start await self.login(*args, bot=bot) File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 509, in login await self.http.static_login(token.strip(), bot=bot) AttributeError: 'NoneType' object has no attribute 'strip'
@rigid sandal yeah same thing as thqt
that
File "/home/matthan/.local/lib/python3.7/site-packages/discord/http.py", line 293, in static_login
data = await self.request(Route('GET', '/users/@me'))
File "/home/matthan/.local/lib/python3.7/site-packages/discord/http.py", line 247, in request
raise HTTPException(r, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "bot.py", line 24, in <module>
client.run('TOKEN')
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 718, in run
return future.result()
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 697, in runner
await self.start(*args, **kwargs)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 660, in start
await self.login(*args, bot=bot)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/client.py", line 509, in login
await self.http.static_login(token.strip(), bot=bot)
File "/home/matthan/.local/lib/python3.7/site-packages/discord/http.py", line 297, in static_login
raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.```
You're executing client.run('TOKEN')
'TOKEN' is not your actual token
You need your token in the string
Why live on a monthly paycheck when you can earn $3000 in just a week through Bitcoin mining and you do not send money to anyone. Ask me how?
oh shit, annoying youtube ads are getting onto discord
Ok haha, Been searching for 2 hours. Is there any way to receive audio from a discord vc using python.
I already make speech to text just need discord voicechannel audio 
if Discord.py docs doesn't have anything, then you'd possibly have to create your own voice lib or use an external module similar to lavalink. Although, LavaLink is audio send only. Just need the reverse
Lmao yes. This is gonna be pain 
If you end up having to make your own lib, then you get to become one of the cool kids who has to suffer with udp
I only need to receive audio, Nothing else i have the rest already coded
😔
Well. I code in JS, so not much I can do to help other than suggest reading if dpy has receive
Does Discord themselves support bots receiving audio?
Im 99% sure discord.py does not have any built in method to catch Voice audio
And tbh I don't even know how you would even begin to catch Voice audio
U will have a Lot of work lol
Good luck with that one
they do I think
wait no
nvm
how do I do this using mongodb? my bot by a command will create a role and a channel, how do I make it to where my bot creates a variable for each channel and role made?
Whyy
File "bot.py", line 24
async def _list(ctx, arg):
^
IndentationError: unindent does not match any outer indentation level```
curb your indentation
Heyo nerds, I'm trying to use canvas to draw images but it seems that the avatar from the user is blurry. I read online that imageSmoothing should be disabled but it didn't work regardless of trying. The height/width is set so it fits in the circle just right.
Any ideas?
set the size to something like 512 in the avatar url function
np
How do I use this bot
which bot?
@rigid sandal
try m!help
Ask in that bots support server
please, if you are having trouble with an specific bot, contact their support server
@TJKIJimzy#9134 contact that bots support server
is test webhooks broken?
yes
For the discord api?
Sylvia-san Sylvia-san, why does it feel like there's something poking me?
(sorry, couldn't lose the reference)
e
if (ctx.guild) {
let missingMemberPerms = []
try {
for (let i = 0; i < cmd.neededMemberPerms; i++) {
// ctx.author is still assumed to be user
if (!ctx.author.permissions.has(cmd.neededUserPerms[i])) throw new Errors.MissingMemberPerms("MISSING_MEMBER_PERMS")
}
} catch (e) {
return this.emit("commandError", ctx, e)
}
}
whats the error?
Property 'permissions' does not exist on type 'Member | User'.
Property 'permissions' does not exist on type 'User'.
ctx.member?
what is ctx
and how do u get the specific member object
message.author doesnt usually have permission data
Is reaction role bot dead rn?
this isn't the reaction role support server
Mmmm can u point me in the direction in which it is
@oak cliff -wrongserver pls
-wrongserver
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Top.gg Discord" button at the top of our website. If there isn't a button that says Support Server, then we can't help you. Sorry :(
Channel overrides can be arbitrarily casted to User | GuildMember because the gateway only returns { id: "user id or role id", type: 0 | 1, allow: string, deny: string }
Keeping guild related stuff as GuildMembers is easier tho
To alleviate your problem, you can just get the GuildMember from cache based on user ID
channel overrides arent the situation here
users are different from members
members will hold the permissions data
author, which is a user, doesnt hold permissions
isn't there a predicate i can use to check if there's a member in the type. idk how to describe it
(thing instanceof GuildMember) // returns a boolean
use the correct property
but
(ctx.author as GuildMember).permissions
if its intentional
but it really shouldn't be lol
oh.
<label for="voteRoles">Add a role to bulk list:</label>
<select name="voteRoles" id="voteRoles" multiple>
<option hidden value="">Choose a role...</option>
<% guild.roles.cache.filter(r=> r.id !== guild.id).forEach(r => { %>
<option style="display: block" value="<%=r.id%>">
<p>
<%=r.name%>
</p>
</option>
<% }) %>
</select>
<script>
var dropdown = document.getElementById('voteRoles');
var i;
for (i = 0; i < dropdown.length; i++) {
dropdown[i].addEventListener("click", function () {
this.classList.toggle("active");
var dropdownContent = this.nextElementSibling;
if (dropdownContent.style.display === "block") {
dropdownContent.style.display = "none";
} else {
dropdownContent.style.display = "block";
}
});
}
</script>
So
This isn't really
extreme smells
ok go on
So
I am attempting to be able to click on the "select role" (first option) and it shows a drop down of the rest.
But for some reason it doesn't display as a single and as just a normal scroll list/dropdown and when I click one it just removes the one below it
Making a dropdown
to do what
why arent you just making it
<select>
<option>...</option>
etc...
</select>
oh u mean the name?
Yea
oh no
its just an html dropdown lmfao
if (argument.required && (Number.isNaN(argg) || argg === "" || argg === "undefined" || ((argument.type === "member" || argument.type === "user") && !argg))) throw new Errors.InvalidArguments("INVALID_ARGS") what is this, why did i do this

Yeah
This is cursed, Skull
Y'know. It really be like that sometimes
That is how I have mine setup
it really do be
Ignore the style part that is just me with the js stuff
yeah that should just make a default dropdown thing]
idk this is the only stuff i have for select
and thats mostly just for the box look
i barely even edit it
no
ejs?
custom solution
no
Let me go to your site rq and paste it into my thing and see what it does
not copying just seeing if I am dumb
i mean even with all my css turned off its fine
Yeah that is what my result was
so its probably something you added wrong that messed up ur thing
ah
Ok. Is it possible to receive any Audio from a voice channel at all?
discord.py btw 🙇♀️
@limber flume it is possible for bots to listen
but it's not naturally supported by d.py because it's not documented by discord
i mean, if you can find the undocumented section and make your own fork 
How to create a own Invite
Can we use <audio> tags on our page
why not. I don't see any reason
looks ugly af tho 
How do you style a select option when it's hovered?
you should use nice select
because selects aren't styleable, the plain ones look ugly as fuck
^
@blissful coral ^
Is it possible fetch Audit logs with many action like
type:"CHANNEL_OVERWRITE_CREATE","CHANNEL_UPDATE",
Ty
Is the method hasPermission(string) buggy?
can someone help me add an Audio element to my page
always getting false for hasPermission("MANAGE_CHANNELS") for a random user who actually has the permission assigned and true for the guild owner (which has it assigned, too of course)
is the user cached
you can only fetch one action at a time
he should be, but I can test to fetch him
uff
then i have to fetch and fetch
assuming you're using JDA which you're probably not, you'd have to use retrieveMemberById (or DJS equivalent) and then check the perm if you don't chunk members when you connect to the web socket
blame discord
¯_(ツ)_/¯
nope doesn't work
Did you check if the member is cached?
regarding the console log, he's already cached, but even fetching him doesn't change false
Are you doing has permission on a specific channel or on the member themselves
nope for the member itself on a message event
which page ?
Like hasPermission(channel, permission)
If you get their permissions what does it say they have
Bot description
btw i'll be deprecated to permissions.has()
my top.gg page
Not me, briish
Can't you just use like HTML ?
Oh yeah discordjs changed hasPermission didn’t they
Are you using hasPermission or permissions.has
well they will
I saw in the beta that it's changed
Well same result, owner has the correct bitfield - calling method permissions - a random user has 0 but has roles assigned with MANAGE_CHANNELS etc.
weird
I tried, but it shows up in the preview but not the main site when submitted
Does discordjs check the user or their highest roles permission
That’s possibly why then 
You’d have to check the permissions of their highest role if what @ornate otter said is true
Checking docs would probably clear that up
dont quote me on that, im dumb
But the user themselves can perform those actions which do require perms yea?
yeah he can
So it does sound like what briish boi said is true and in which case try checking their highest role instead
second..
I tried to make sure and Now I know that they remove audio tag
Bruhhh rooood
According to mdn audio tag has decent support
but somehow it dosent work
looks broken as well
all users have a role with the same id, name undefined etc.
they are moving on so there might be problem like this
see #site-status
or #support
Ok
guess it's fucked up however
is that possible ?
looking at the console.output, yes it is
Might be filtering it then
is the role cached? bcs its sounds like a partial
yea that's what i'm sayin
It's impossible for 2 roles to have the same ID
are you sure this are the same ids?
also did you get this as a answer from the API or from a database you host?
meh... nvm need to sleep at this point. as I said fetching results in the same issue like using the cache
might actually be an issue with the test discord server, idk...
thanks anyways, I'm tired as fuck
let me acutally try something else before going
gonna try to fetch the role, didn't do that so far
ok I see ... looks like it's my bad, doesn't seem to be cached for some reason
"disk image is malformed"
ok giving up... permissions are cache now, after removing the permissions from the user it's still cached, even after clearing the cache and restarting the bot
god damn shit... no more words for that mess
@summer acorn but in it you are responding to any packet
nope
But how to do with specific name
you give it the packet that you approved in your slash command handler
you give the function the packet data
and then it'll send the response to that specific packet data
it doesn't check for the command, it's simply just utilities to make it a bit easier
the sendMessage only responds to the slash command you wanted it to run
Can you send some example code?
I'ma show you an example real quick
slash/index.js
module.exports = (client) => {
client.on('raw', packet => {
if (packet.t !== "INTERACTION_CREATE") return;
var data = packet.d;
try {
require('./slashhandler.js').slashHandler(client,data);
} catch (error) {
throw new Error(error);
}
});
}
slash/slashhandler.js
async function slashHandler(client, data) {
var command = client.slashCommands.get(data.data.name);
if (!command) return;
try {
command.execute(client,data,sendMessage);
} catch (error) {
throw new Error(error);
}
}
module.exports = { slashHandler }
slash/commands/help.js
https://pastebin.com/RhSR0pjN
slash/commands/botinfo.js
https://pastebin.com/8Y6GjEfa
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.
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.
@old cliff
the commands shows how the sendMessage functions works
Thanks!
I didn't use the package in that because I made that before the package but the sendMessage function is the exact same
Really helpful
pretty much, the way you execute commands is just the same way just a bit more tedious because you have to use args inside of the packet
and then you also have to do a lot more checks
put simply, normal message commands are a lot less tedious than plain discord slash command packets
any way of fetching a large amount of users?
If they are all from the same guild, you can fetch up to 100 at a time
Juat fetch all from that guild
But must have intents
Or more if you have the server members intent
yeah, already doing that but I also have users that aren't on the guild anymore
You can't access them
well
you will have to fetch those one at a time then
whats wrong here https://i.imgur.com/1DcZXaK.png
https://i.imgur.com/HfeTtTU.png
Add __dirname
that doesn't look like a problem with ts
hey how that Slash thing community updayes are talking about works ?
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
want to make the changeable prefix system
you need a database
hey i tried to install topgg-autoposter on my ubuntu galaxygate vps, well always that fucking node-pre gyp that gives me fucking headache:
like what the fuck is its problem.
Permission denied
there is
what\
what module do I need to make a changeable prefix system
If you already have a database then it shouldn't be hard... if you know what you're doing
so uhmm.. you know how to fix the permission error?
why did you use the root directory for the bot directory?
becvause it's where my bots are

this will probably cause your permission issues tho
cf8, you use galaxygate right?
i have a problem i'm curious if anyone can solve r.e rotating bot statuses, now it should loop back to status 1 after but sometimes freezes/goes blank, any ideas? 🙂
"status 1",
"status 2",
"status 3",
]
client.once('ready', () => {
let i = 0;
return new Promise(resolve => {
setInterval(() => {
resolve(2);
const index = Math.floor(i);
client.user.setActivity(activity[index], {type: "WATCHING",});
i = i + 1;
if (1 === activity.length) i = i - activity.length;
}, 10000);
});
})```
it isn't?
no because its just a vps
i've asked them multiple times, they never answered.
because it's not their issue

running stuff in a protected area is a dum idea 
Welcome to running shit in protected areas not everything is equal
so should i migrate the folder to a unprotected area?
What's the best directory to run the bots from?
mmmk ty
use a txt file as db

use a css file as a db
Cache only
use json
should i move on to java !?
java is older than my grandma

it is
i saw on its official web now
If you are gonna use java use at least kotlin
what is kotlin !?
ok
but in this case you can think of javascript as the java
and kotlin as the typescript
const db = require("db.css")
const table = new db.Table("data")
await db.set("test", "value")
await db.set("json", { hello: "world" })
await table.set("hello", "world")
/* output in db.css file */
#root {
test: "value",
json: "{\"hello\":\"world\"}"
}
#data {
hello: "world"
}

kotlin gives some extra functionallity and a lot of syntax sugar to java
i am gonna delete my full code in python 😁
lol
oh god
i should make a "js library concept" for a db in every language
what language is next
Spanish 🥵
Big meme lul
😳
I started learning python is it wrong?
Well nvm i took those personally

Depends
If you ask a Clod-Blooded-C-Coder then YES you mad a mistake.
If you ask some ordinary ppl like CF8 said then it's not wrong
If you ask a web dev then "Anything is better than Javascript"
If you ask someone coding Python for 3+ years then "Fuq choose another language"
If you ask someone coding Python for 3+ years then "Fuq choose another language"
no?
so how long do i have left to wait until i hear about my bot?
weeks
i see
Hmmm
google: shows modern high level language
also google: shows it being used in netbeans
I have a botinfo command that uses client.users.cache.size to show how many useres are in all of our guilds but for some reason it is not working anymore
i am also using discord.js
How is it not working? Be more specific
If you're getting wrong numbers, it's because not all users are cached, in order to get the total amount of users, you'll have to loop through all guilds and sum theirmemberCount property
Hey, I have this:
(node:895) UnhandledPromiseRejectionWarning: TypeError: fields.flat is not a function
at Function.normalizeFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:450:8)
at MessageEmbed.addFields (/app/node_modules/discord.js/src/structures/MessageEmbed.js:266:42)
at Object.execute (/app/Commands/Debug/botinfo.js:16:8)
whats the problem?
You're using an old node.js version
oh
update to node 12 or 14
You can set that in the package.json I think
yeah under "engines"
Thoughts on the login / register form design?
the background is lookin a little empty
.addField(`Çekilişi Kazanan`, `${message.guild.members.cache.random()}`, true)
how can i block bots in this code i am using d.js v12
use filter on the cache to filter out the bots
ah okay
i will try thanks
login/register is almost invisible
and I'd suggest either using a monotype font or Ubuntu
maybe jetbrains mono would be perfect there
I'll try it out
${message.guild.members.cache.filter(m => m.user).random()} i did this but the bots are still valid
You don't actually filter out the bots, you turn all members into users
Hmm
In order to filter them out you need to check if the m.user.bot property is true
I had one in around 600 servers that used around 70mb of RAM
js?
i see
This one also had an express server running on the same process
python is not particularly good at managing memory
kek
mine is in 100+ish and uses 100+mb
And this one uses node-canvas so the memory usage is reasonable
Mine is about 200mb with 300k cached users and less than 100 guilds, d.py. No clue if that's low/high.
Actually, the sum of member count is about 250k-ish, but I cached old user objects so
the base interpreter itself uses about 10 - 25MB idling, if you have lots of small objects or reference cycles you'll get an increase in Ram usage and no so much lowering because of the bump allocation, Python's memory management generally increases upto about 500MB before it starts to become more aggressive with it's memory management otherwise it keeps that allocation space and uses it for new objects, TL;DR your ram will keep increasing to a point so that your allocations are quicker in the long run
why do you cache 300k members?
Not members, just users
For a message leaderboard command, to reduce requests, don't ask why I made such a command 
that doesnt require a member cache but sure 
like, when i just start the bot there's 880mb free for example, after a week turned on non stop there's 720mb-ish free
why not a database smh
It's on redis
actually, why even cache?
yeah thats to be expected
Also why store the entire object and not just the message count
I actually only need the username and the discriminator, but I also use that for presences, sometimes discord sends partial user, so I can get it from the cache instead. It's so trivial doe
i noticed that turning off presence intents decrease cpu usage by a considerable amount
yeah cause they happen very often
because it accounts for a good 90% or so of all your WS events
yes, it went from 15%ish to 1-2%
that'll however backfire once you get a high enough count
Probably, I might need to either decache it if they leave the guild or flush the redis regularly. Or just don't cache at all
but I can't rely on discord's mentions.
less API calls and faster response times
how i can fetch url from req.params? i tryed app.get(path/:link) and const mylink = req.params.link but not work
looks like express.js
express
how do you remove a reaction from a message
lib: discord.js
im doing self-roles and the user reacts to get the role how do you remove that reaction that the user got the role with
ty
Not from the UI, but the bot itself can filter the guilds cache by those where the member is present
That woudl, however, require you to cache all members which requires the member intent.
unless you loop through all the guilds, try to fetch the member, etc, which then takes time and spams the API.
So... basically, "technically yes, but no not really"
hmmmm 
Without member intents it's gonna be hard, yeah
Then yeah, you could loop through each guild's members and check if they contain the member you're looking for
Might be a pretty heavy load though, depending on how many guilds your bot is in
Personally I think it's a horrible idea to cache all members just to get common servers. It takes a huge amount of RAM to cache those members, for an extremely minimal and fairly pointless feature.
yeah i guess
that did not work
In what way did it not work?
hi Tim
it just didnt do anythin
not even an error
is there a known issue about not being able to open my own bot's page?
if there is sorry i couldnt find it on #site-status
k thx
Does anyone use native MongoDB?
Just ask your question instead of waiting for an expert, maybe we can help when we know what your question is.
it works
it doesn't work in different files but it works in same file
What should I do to use it in different files?
well you could just export the db connection as a module that would make things simple
somone hare use discord.py ?
(await this.channel.messages.fetch(this.messageID)).edit.edit(embed)
error: (intermediate value).edit.edit is not a function how do I fix this?
well it's not. why do you have .edit.edit
a module?
🤦♂️
oh thank you
just go right ahead and ask your question, someone will be able to help but not before you actually ask it!
Yeah, what's up?
im ok
Uh, alright? Cool
import discord
from discord.ext import commands
@client.event
async def on_ready():
await client.change_presence(activity=discord.Game('Sea of Thieves'))
Error coming in await
no indentation at all
Done now also not running
Post the error as well, please
Also, using code blocks will make your code more readable
^
also bot.run won't work if you call it client
I'd recommend learning Python before trying to make a bot ^^
U should take a better look at the docs bru
i think this page is quite important here
or disable flash at least smh
Gyazo ftw
Btw I know the website is having some issues rn
But im able to access literally any bot's page except my own
Is that like expected or smth
Man thats an weird issue
welcome to webdev
kappa
oi
Diga meu bom
Hey, why does my bot not show a servercoutn?
you will need to use the #topgg-api to provide the server count to top.gg
ah okay ill look into it
import discord
from discord.ext import commands
client = commands.Bot(command_prefix= '*')
client = discord.client()
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Game('Sea of Thieves'))
See
Wrong indentation
I don't have a learnpython tag, but, you should consider learning python itself before trying to make bots in python. There are plenty of resources online to learn the language before trying to make a bot, which is not for beginners and requires a solid grasp of simple programming concepts at the very least.
pasting your unidented, broken code more than once doesn't help
go learn python
did i do this right? ```py
import pymongo
from pymongo import MongoClient
cluster = MongoClient("mongo link here lol")
db = cluster["name here"]
collection = db["name here"]
post = {"_id": 0, "name": "timmy", "amount": 0}
collection.insert_one((post))``` as i got an error and nothing showed up inside my dbs collections also apparently 'import pymongo' isnt accesable and is greyed out?
dont have client = commands.Bot() and client = discord.Client()
choose one
also indent await ... after async def on_ready():
while(NaN !== NaN) {console.log("$")}
This is how you nuke your pc
i cant invites botshttps://top.gg/invite
we know
Yeah js is a joke
Read #support , it's a known issue
can i get some help with my pymongo please #development message
windows 
yes, heres some help:
- dont use pymongo (its mongodb and not asynchronous)
- dont use mongodb (if you have to use motor not pymongo)
- spend time learning sql
postgres is good
^^^^^^^^^^^^^^^^^^^^^^^^^
Why bad for windows ?
imagine using windows
Why not ?
hosting mongo on windows?
ctrl shift printscr
ok
I use a hackintosh macos along with triple boot windows and kali linux
sounds good but it doesnt fuckin matter
code on windows
And hack my friends on kali
i code on linux
lol
i need to migrate my data to postgres
not really
It is
I am just starting ro learn hacking
ok
i wonder what i would do if i hacked one of my friends
nothing
because i wouldnt hack my friends
yeah
My friends know hacking too
true
hacking war
And we dont steal info
lmao
ok nice
And hackintosh is legal
have fun with that
found a skid
apart from its not apple hardware
Yeah
which is well
an entirely grey area
pretty sure its not legal, distributing software you dont have the right to distribute(apple's OS)
you may not be breaking any laws using it, but laws where broken to let you use it.
We are not distributing it
We use original apple files downloaded from their appstore
Even linus tech tips has videos on this topic
Literally no laws broken
import discord
from discord.ext import commands
client = commands.Bot(command_prefix= '*')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Game('Sea of Thieves'))
bruh
According to law mac can be (ONLY) installed with device manufactured by apple (Or legal modification by any authorized third party)
Error coming
use code blocks
@wanton dust
import discord
from discord.ext import commands
client = commands.Bot(command_prefix= '*')
@client.event
async def on_ready():
await client.change_presence(status=discord.Status.idle, activity=discord.Game('Sea of Thieves'))
Bro I am literally just using a public os
It works on browser too
:(
Who can help me, I have this:
(node:25585) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'toString' of undefined
at Object.execute (/app/Commands/Info/help.js:29:67)
at module.exports (/app/Events/Messages/message.js:38:11)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
(Use node --trace-warnings ... to show where the warning was created)
(node:25585) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:25585) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
you're trying to do .toString() on something's that's undefined
yes
show your help.js command, especially line 29.

{message.client.emojis.cache.get(infoEmojiId) is undefined. that emoji doesn't exist.
he exists
I put this on a config.js
you might've put the wrong id
the emoji is: 729353637985517568
Thankx
But my bot is not showing any status with it
ℹ️ 729353637985517568
how do you get the emoji id
is your bot on that server
Yes
You cannot get an emoji from a server that you're not on.
I was not talking to you.
🙄
Don't roll your eyes at me kid, I already told you to go learn python.
That's all the help you get from me.
Ok sir
Isn't that a core emoji in Discord?
🛠️
yheah it is
that's not going to come from client.emojis at all
You want to send the unicode version: \🛠️
that'll work
hey i tried to add a avatar in the webhook when i create it but it gives out a error.
code:
web = await channel.create_webhook(name='xyz', avatar=self.bot.user.avatar)
error:
startswith first arg must be str or a tuple of str, not bytes
How do i fix it any idea?
@umbral zealot its a problem with tostring but tostring is not definied?
no
the problem is that's not an emoji you get by ID
that ID is probably one from a message, not from the emoji
Literally just send \🛠️ instead of trying to "Get" the emoji, it'll work fine
avatar needs to be a url.
that gives this error:
'Asset' object has no attribute 'startswith'
but how to take emoji id?
when i use self.bot.user.avatar_url
there is no emoji ID
it's a unicode character
Emoji IDs are exclusively for custom emojis added to servers, not for default unicode emojis
oh
try str(self.bot.user.avatar_url)
what is the website to take emojis like this?
alright one min


no?