#development
1 messages ยท Page 1323 of 1
They are not ordered tho
it shouldnt matter regardless
if the first one is the bot mention, get second
you are expecting 2 mentions either way
if its not one, its the other
Wait what do you need the bot mention for?
they are using it as an alternative prefix
Then just do if(message.content.startsWith("@plush kindle")...
oh nice
be careful, mentions from mobile are <@! whethere on pc are just <@
exactly what im explaining
includes() or indexOf(), and just look for id, ignore the <@! > bits
or i can just tell the user?
// Check if the message is a command and get the args
if (message.content.startsWith(`<@!${client.user.id}>` || `<@${client.user.id}>`)) {args = message.content.slice(23).split(/ +/);}
like that:
if(message.content.startsWith(`^<@!?${bot.user.id}> `)) return message.channel.send('please use the `!` prefix for this command.')
// Check if the message is a command and get the args
if (message.content.startsWith(`<@!${client.user.id}>` || `<@${client.user.id}>`)) {args = message.content.slice(23).split(/ +/);}
@opaque seal fairly certain you cant do that
startsWith() needs to be done twitce
and it works like a charm
startsWith() needs to be done twitce
@opal plank nope hehe, that's js power
didnt i do a thing for matches?
hold'up
if (message.content.startsWith(`<@!${bot.user.id}>` || `<@${bot.user.id}>`)) {args = message.content.slice(23).split(/ +/);}
still didnt work, its still killing the bot
cuz i told you
its not about the prefix
you still getting .first()
told ya to use a spread operator and get the second mention
idk how
[...]
spread the map onto an array
get index [1]
remember to spread the values rather than the map itself
otherwise you'll get pairs of keys/values
if (message.content.startsWith(`<@!${bot.user.id}>` || `<@${bot.user.id}>`)) {args = message.content.slice(23).split(/ +/);}still didnt work, its still killing the bot
@tardy hornet what do you mean with killing the bot?
i got a command. !kill @mention and its killing the user.mention.first(), but because the mention prefix, its killing the bot
lol just check if the ID isn't the BOT's ID
user.mention.first() returns the FIRST mention, you need the SECOND, which would be fine for spreading the map MENTIONS into an array, and getting index[1]
or doing .last()
he just asked
seen that there are only two mentions most of the times
so i told him @opal plank
mentions.size > 2 => throw error
it should be .second() tho
idk if d.js has a second() method tbh
what im suggesting is vanilla js
treating a Collection as a Map
since collections arent native
actually this is the bot made for studding discord server it can answer maths question which are there in lessons if yo like it invite.
When is my bot going to be in my server and be active I created my bot like 5 mins ago
ooof
Mate you need to code your bot
you need to invite it as well
How ?
check out a youtube video
generate a link in the portal
Lul
dont
thats where youtube come to the picture
youtube videos is the worst source you can link them
they are outdated most of the times
Depends on the video
90% of the videos is like that
they are outdated most of the times
@opal plank you can see the once that were uploaded in the last 30 days
as a dev its good practice to foward them to docs, as you'll need to grow accostumed to reading documentations either way
good luck finding youtube videos on small or advanced libraries that are updated and throughly explained

thats what docs are for
its always up to date
they give you ample examples/snippets too
and are thoroughly explained
Or just go on github find open source stuff and learn from that
i'd much rather foward them to w3 schools, which is a very simple and interactive website to learn js and the sorts
if they already have a footing, mozilla docs are much better, though also harder to learn if you are a begginer
actually, use the discord permission calculator
i prefer that over the one they provide in the portal
Huh?
K

Start here @still wave
https://discordjs.guide
you should indeed read that too(if you plan to use JavaScript) ^^
it's the easiest way to make a bot
but one of the least efficient
i dont have enough proficiency in other langs to say anything, so imma be quiet about that

what i can say is that Ts aint bad
its cozy and nice to play with
JDA ftw
I have a link now what to do now ?
mate follow the guide I sent you
Omg I am not new to make discord bots I made tons 2 years ago I forgot how to now!
If you werenโt new Iโd suspect youโd understand that guide
itโs frankly the easiest guide to understand and someone with no coding knowledge could make sense of it pretty easily
we aren't here to tell you step by step what to do sry
It said to Copy the something token I did but where do I put the link on am not on laptop so I canโt do somethings that itโs saying .
are you saying you are trying to make a bot from mobile?
Uhm your token mate
you exposed it @lyric stag
0ops
help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee plz
why my bot isn't working https://prnt.sc/uzt0lq
try node index.js
save the file
@lyric stag you didnt save the file
Ctrl+S
Yes
thx it worked
help meeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee plz
hello?
anyone here
oh and i use unity
@vague jay not enough information, i have no idea what youre doing or what thats supposed to be
uh...
I have never worked with unity before so idk, but have you tried googling the warning?
fine
Says player is missing
no
Then do so
9 times out of 10 the code youre copy pasting is linked to or relies on another code
So it wont work unless you adapt it
Well you can always learn
sigh
We all suck at one point
made for discord bots
@opaque seal we support general dev questions too
can somebody help mE PlZ
i did that:
message.channel.send(`${message.client.guilds}`)
and it sent:
[object Object]
Lmao
?
Hes not talking to you dash
what does he need?
unity c#
oh and tim,
message.channel.send(${message.client.guilds})
its sending
[object Object]
https://discord.js.org/#/docs/main/stable/class/Client?scrollTo=guilds @tardy hornet
@opaque seal ty
dude...
then plz help me
@vague jay with what?
unity c#
Nobody can magically help you without more details about your project, and the fact that you copy pasted code means there might be a lot more missing on your project than only that
I think you'll have more luck if you ask in a dedicated discord server or if you search documentation online
i searched the docs
i changed it to that, message.channel.send(${message.client.guilds.cache})
not its sending [object Map]
cache is a collection
Basic tutorial on adding player movement. We make the player move forward, backward, left, and right. He will also sprint forward!
Script: https://pastebin.com/p3NyWT5b
Google+: https://plus.google.com/u/1/116701053346441320174/posts
Instagram: https://www.instagram.com/nick...
can it help?
use .size on cache
yes
i think you got my idea wrong
ik how to see how many servers my bot is in
i want to get a list with invites to the servers
@opaque seal
then you need to loop trough every guild and generate an invite
iirc that's against something I don't remember what
i.e. you shouldn't do that
well i dont know the guilds that added my bot
i want the bot to send a invite to me
not workin? https://prnt.sc/uztvc7
im so confused. im doing a leveling system. if the user is level 1, what should the xpNeeded be?
nevermind
Should I make it like this?
why not use a math function
Or something like level = floor(exp/1000)
exponential with cap would prob be my recommendation tbh
and then root to calculate the level
https://prnt.sc/uztvc7 why isn't workin?
that way you just store one int, which is the exp the user has
dealing with math and one single gauge would be the smartest move imo
how do i make my domain from get.tech form github studend pack link with my cpanel vps?
i currently am on a shared vps, with same ip and subdomain as another website
you need to add it under additional domain?
I'm not too sure how restricted is the cpanel on your side
I'm not too sure how restricted is the cpanel on your side
@fluid basin yea, i put the cpanels (Subdomain)s name servers
but i think thats the issue
its not like updating
like last time it never fully propagated after like 4 days
but it semi does
you need to ensure the nameservers for your domain is pointed to your cpanel
I believe according to the service you are using they should have some instructions on how to do that
what hosting are you using for your website rn @drifting wedge
what hosting are you using for your website rn @drifting wedge
@fluid basin well its my friends vps
the domain is get.tech
the domain provider
oh then you just need to change the domain to point to the vps ip
its shared tho
sorry if this is promotion: so my friends website is eukserver.com
mine is arch.eukserver.com
so i put the ip?
they both have same ip?
u should actually ask your friend on this
u should actually ask your friend on this
@fluid basin he gave me the nameservers
do i need his help?
if you changed the get.tech namesevers to the ones he provided
and setup the domain as an additional domain
yea
it should work
but it gives an error since its not propagated
well in that case you should ask your friend
Can anyone help me with this?
https://stackoverflow.com/questions/64324555/cant-modify-embedded-list-in-morphia
cannot close my bot to restart it Ctrl+c
it do nothing
the icon path is the same but its showing big for main page and small for another page i want to make it small any way
https://prnt.sc/uztvc7 why isn't workin?
@lyric stag
you need to change thesendmessage('pong')tosend(pong)
Ok
@earnest phoenix if you want it to be small like your second screenshot, you shouldn't be using og:image as that represents the image field of the embed, which is large.
still have to write it one by one ๐ณ
You could make a function that does that callback hell for you, preferably in a promise-like way.
const getStats = (index) => new Promise((res, rej) => {
cpuStats.usagePercent({ coreIndex: index, sampleMs: 2000 }, (err, percent, seconds) => {
// handle your error here and stuff. Call `res(...)` resolve the promise, or `rej(...)` to reject with an error.
})
})```
See this: <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise>
If you find yourself writing a lot of code that's very similar, you may want to rewrite it as you're not following DRY - don't repeat yourself.
oh wow, thanks 
@sudden geyser Is there something that also shows a image/thumbail metatag that discord will embed it
reply() causes a mention
@lyric stag also check for your prefix before running commands
my prefix is /
how it also worked?
i just told you
@earnest phoenix would setting it to og:thumbnail work?
https://prnt.sc/uztvc7 why isn't workin?
@lyric stag
to send it in the channel that the user typed the command in:message.channel.send('pong')
to mention him the with answer:message.reply('pong')
to send the user in DMs:message.author.send('pong')ormessage.author('pong'), one of them, i dont remember.
@tardy hornet you are replying to an old problem
he updated his code
that code wont even work as sendmessage() isnt a method
bro
?
i sayed message() not reply() so why the bot maked the both commands?
show the code.
ok
he probably didnt save/break
send() should not yield a mention
save it
save and restart the bot
yeah

ctrl + c on the terminal
click on the terminal
then run the command again
and Ctrl + c
option + c in mac os 
im fairly certain you got another bot running somewhere
yeah
ctrl + shift + esc => then kill all node.js apps you see there @lyric stag
before people get their bot running 24/7 they need to learn to make the bot

ctrl + shift + esc => then kill all node.js apps you see there @lyric stag
@opal plank
just do that
i hate you .
bro you have your bot running any where? @lyric stag
bro we are just trying to help
r u thinking i am stupid?
WHAT?
whats ctrl + shift + esc => do?
what?
nothing can delete that bro
do you know what Task Manager even is ?
do you know what Task Manager even is ?
@opal plank srry bro .
๐
og:thumbnail is not a thing tho
flying gorrila
no u
killing node.js should also kill the terminal inside VSC in case they have a debugger running
which i doubt*
@opal plank srry bro , i didn't know who am i for a while it worked https://prnt.sc/uzw0vt
๐
yo @opal plank
thats me
my bot got added to 30 servers today ๐
hell yeah good shit
@earnest phoenix Use og:image
lol good for you
@hasty sparrow it keep showing the big image
im getting a couple per hour on twitch, discord is much more calm in this regards
@earnest phoenix Use
og:image
@hasty sparrow imagine explaining blasted Cloudflare how to use OpenGraph
My bot is stuck at 60. I think I should completely redesign it
...
hm
Hasn't moved much since the first week in dbl
and i guess thats made my bot roll
mine is more targeted to streamers, its quite uncommon for people to use my bot for other uses
@earnest phoenix Imagine having to explain to a service provider that uses lavalamps for randomness how OpenGraph works
mine is more targeted to streamers, its quite uncommon for people to use my bot for other uses
@opal plank give it's invite link ๐
thats ads, cant do
๐ฆ
||wink wink check my status||
@opal plank can i see your bot?
anyone here is expert at css?
@earnest phoenix i am an expert in being a expert in expertness of css-expertize
I localhost a bot which is in Python but there's been an issue where it just stops posting feed anymore. How would I go on about resolving that?
might need more information
It runs and keeps querying but somewhere in the middle just stops posting to Discord.
without seeing your code we can't help
also please don't ask me for help with python i am da javascript guy
consider setting a breakpoint and stepping through the logic
Is having a single file for an entire project normal in python or something?
My bot is hosted on AWS EC2 in Ohio. Will users of my bot in other places, let's say Australia, experience very high ping when using the bot?
And if so, how do other developers fix this?
AWS is pretty good for global ops I'd imagine
Nope. I will just link the github. I thought that file is where the issue might be
๐บ Monitor your game servers on Discord and tracks the live data of your game servers. Also support one-click deployment to Heroku, self-hosted. Invite: https://discordgsm.com/invite - DiscordGSM/Di...
the lag wont be noticable, unless you have a music bot @gritty bolt
yeah
well you will need a server closer to their region I guess
but discord is already doing a good job at routing so it should be too bad
you really dont need to worry about this imho
https://prnt.sc/uzwt99 why not working
read the errors?
====?
๐
= assignment
== comparison, equals value
=== comparison, equals value and same type
iirc this is what JS does
what about ==== 
doesnt exist
damn
First human to use 4 ewual signs
why not working
@lyric stag #development message
@opal plank i have seen so many bot that do that and i want to know how, when a bot, for this example: rythm added to a server he send a message in a random channel, like how to use him
and i want to know how to do that
but when he join
iterate thru the channels available and get the first one where role @ everyone has SEND_MESSAGES permission
thats it
guild.channels.cahce.forEach
@lyric stag define token ffs
Define bad
im not trying to be rude
but if you dont know about it, dont suggest it
its better to be quiet sometimes
you CLEARLY dont know what you're talking about
and time after time i see you giving users here bad advice
for example, this is a indentation error
nothing to do with defining token
also forEach is horrible iterator
forEach 
for loop 
please, for the love of god, do your research first or dont try to help people with half assed knowledge, you harm more than you're helping
bought nitro before 2019 @tardy hornet
o
Im still confused why having ; cause error
erwin i think you mean unclosed braces
i assume its all under 'message' =>
Yes
blocks*
})
likely }); missing in the end
hence why i said to show the code
copy paste the code in here https://paste.awoo.rocks/
remove token for the love of god
for the love of god
@opal plank ah yes
I'm still confused on why Erwin hates forEach
every morning I wake up to discord token reset because a stupid bug in v11 didnt get noticed by sempai
ok
Your missing } in line 29
Jerry, why not use functions for your bots logic instead of placing it inside the switch statement
close your else statement
that was for the switch
bro i am new in programming
Jerry, why not use functions for your bots logic instead of placing it inside the switch statement
@faint prism
https://paste.awoo.rocks/ paste ur code here
i swear
I know. So consider my advice since it's a learning experience
message.channel.send(`Invalid Args`)
}```
i paste it!
send link
djsv11 has so many bugs I swear
Yeah im on mobile
right...
const Discord = require('discord.js');
const bot = new Discord.Client();
const token = '';
const PREFIX = '/';
bot.on('ready', () => {
console.log('This bot is Online');
});
bot.on('message', (message) => {
let args = message.content.substring(PREFIX.length).split(' ');
switch (args[0]) {
case 'ping':
{
message.channel.send('pong!');
}
break;
case 'invitelink':
{
message.channel.send('https://discord.gg/tpbz7XM');
}
break;
case 'info':
{
if (args[1] === 'version') {
message.channel.send('Version 1.0.0');
} else {
message.channel.send('Invaild args');
}
}
break;
}
});
bot.login(token);
Ads
erwin what in the world
what?
it would only break if it fell under else
it would continue on the next if he had another case
or default
Can anyone help me?
with?
Discord.js
yeah what's the problem?
+1
He forgot to add }
?
or just remove { xd
Uh, im just creating a new bot rn, so thats what i need help with. Basically, i need to set the bot's status to the number of servers and members its serving
Uh, im just creating a new bot rn, so thats what i need help with. Basically, i need to set the bot's status to the number of servers and members its serving
@torn jasper setActivity('') TYPE: PLAYING {
heres a tip for you
or
ugh
something like this
link them the docs
const discord = require('discord.js')
const client = new discord.Client()
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.cache.get('766262827476320276')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + 'HEY!', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 1);
});
client.login("XXXX")
Thats my code till now
But it doesnt show the status
both
client.user.setStatus('online')
client.user.setActivity('โ
!help For All Comands!', {type: 'PLAYING'})
setPresence is for setting status and activity under one method
uh you cant convert a string to int
oh interesting
thx @opal plank

Who would wanna change their bot status?
client.user.setStatus('online')
client.user.setActivity('โ !help For All Comands!', {type: 'PLAYING'})
@earnest phoenix Thats different. I need it for showing the numbers of servers and members its serving
Me i guess...
ok
const discord = require('discord.js')
const client = new discord.Client()
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.cache.get('766262827476320276')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + 'HEY!', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 1);
});
client.login("XXXX")
client.user.setActivity(`${client.guilds.cache.size} Guilds`, {type: 'WATCHING'})
you can use client#guilds#cache#size for guild count
@earnest phoenix Thats different. I need it for showing the numbers of servers and members its serving
@torn jasper ${client.users.guilds.cache.size}
client.user.setActivity(`${client.guilds.cache.size} Guilds`, {type: 'WATCHING'})
@carmine summit trying this one
and for members, you can either accumulate all guilds' member count or use client#users#cache#size
Wait thats a thing?
client#users#cache#size can be unreliable though since it relies on cache
Ah yes
unless you fetch all members
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.get('GUILD ID HERE')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + ' people verifying!', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 5);
});
what about this?
const discord = require('discord.js')
const client = new discord.Client()
client.on('ready', () => {
client.user.setActivity(`${client.guilds.cache.size} Guilds`, {type: 'WATCHING'})
});
client.login("XXXX")
Right now i set it to this
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.get('GUILD ID HERE')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + ' people verifying!', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 5);});
@torn jasper
how u did that code embed
damn
I am getting uhh, an error before ${client......
thing?
const discord = require('discord.js')
const client = new discord.Client()
client.on('ready', () => {
client.user.setActivity(`${client.guilds.cache.size} Guilds`, {type: 'WATCHING'})
});
client.login("XXXX")
Hope Erwin doesn't scold me for that
client.on('ready', () => {
setInterval(() => {
targetGuild = client.guilds.get('GUILD ID HERE')
if(targetGuild) {
client.user.setPresence({ game: { name: targetGuild.memberCount + ' people verifying!', type: 'WATCHING' }, status: 'online' })
.then(console.log)
.catch(console.error);
}
}, 1000 * 60 * 5);});
@earnest phoenix now its not setPresence now is setActivity
ohhh
it was earlier
i did for my bot
bcz u have discord.js v11
yes
v11
Hmm
vs code
ye me too
vs code
how do i create something like image manipulation?
in embed?
in js
Canvas
ok
I have 12.3.1
I have 12.3.1
@torn jasper ok
I have 12.3.1
@torn jasper you sureM
Thats how you know a man is in a mobile
HE TYPES BOT IN A DISCORD BOT MAKER ANDROID!!!
Its showing an error
const discord = require('discord.js')
const client = new discord.Client()
client.on('ready', () => {
client.user.setActivity(`${client.guilds.cache.size} Guilds`, {type: 'WATCHING'}) \\ The error is after setActivity(**`**... That ` is where the error comes
});
client.login("XXXX")
and what is the error?
they did
oh
Wait..
FFS STOP COPY PASTING CODES FROM THE STREETS
indentation error
FFS STOP COPY PASTING CODES FROM THE STREETS
@carmine summit hi
who copypasta?
Hallo
Okay the error's gone but the status aint coming
maybe change WATCHING to PLAYING
:D
tysm
Yeah I just thought WATCHING is not an qctivity
Now if i also want users, i just do client.users.cache.size ?
You can call me stoopid now
watching needs a valid twitch stream url
Yeah
oh yeah
stream
streaming ye
Lol
watching needs a valid twitch stream url
@pale vessel STREAMING???
Now if i also want users, i just do client.users.cache.size ?
@torn jasper Uhh am i correct?
no
it existed
Tryna remove .cache if no work
no
Okay lemme try it once
damn
If no work
Wait
client.user.setActivity(`${client.guilds.cache.size} Guilds and ${client.users.cache.size} users`, {type: 'WATCHING'})
?
Thats the code i wrote for showing users and guilds
static class Factory
{
ICommandLogic GetSomeCommandLogic(IConfig config) =>
new SomeCommandLogic(config, AnotherFactory.GetSomeThing())
}
...
public class SomeModule : ModuleBase<SocketCommandContext>
{
[Command("something")]
public async Task SomeAsync() =>
await ReplyAsync(embed: Factory.GetSomeCommandLogic(config).Run(ctx););
}
How does one implement a factory is JS
Ewww Java
eww C#?
Im pretty sure that is Java
i thinks its c#
looks like elm
perhaps haskell
Pretty sure Java doesn't use PascalCase for methods
I just coded the bot to show the numbers of users and guilds its in but how do i make it refresh like every minute, coz i just kicked an alt from the server, and the users is still the same (using discord.js)
camelCase i guess
i tried c# for the first time a while back it was kinda fun
@torn jasper use setInterval
I just coded the bot to show the numbers of users and guilds its in but how do i make it refresh like every minute, coz i just kicked an alt from the server, and the users is still the same
@torn jasper
setInterval(foo => {
//Do stuffs every 3000ms
}, 3000)
Like where do i do that.
I dunno
client.on('ready', () => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
});
``` In here where?
Ask urself
Hmm
do it outside an event emitter
I will remove it from there
Does nobody use a factory design pattern?
i kinda just make my code very bloated and call it a day
Anyone know what this means? Can't find a reason.
RangeError [BITFIELD_INVALID] : Invalid bitfield flag or number.
i assume your using djs?
Yes.
its probably because you didnt use a bitfirld or number in a permission firld
field
Well, it works in a private server. But when i test it on a bigger server it resolves into that error.
I used MANAGE_GUILD.
Show code
const member = message.mentions.members.first() || message.member
let text = ''
const test = [
'ADMINISTRATOR',
'CREATE_INSTANT_INVITE',
'KICK_MEMBERS',
'BAN_MEMBERS',
'MANAGE_CHANNELS',
'MANAGE_GUILD',
'ADD_REACTIONS',
'VIEW_AUDIT_LOG',
'VIEW_CHANNEL',
'READ_MESSAGES',
'SEND_MESSAGES',
'SEND_TTS_MESSAGES',
'MANAGE_MESSAGES',
'EMBED_LINKS',
'ATTACH_FILES',
'READ_MESSAGE_HISTORY',
'MENTION_EVERYONE',
'USE_EXTERNAL_EMOJIS',
'EXTERNAL_EMOJIS',
'CONNECT',
'SPEAK',
'MUTE_MEMBERS',
'DEAFEN_MEMBERS',
'MOVE_MEMBERS',
'USE_VAD',
'CHANGE_NICKNAME',
'MANAGE_NICKNAMES',
'MANAGE_ROLES',
'MANAGE_ROLES_OR_PERMISSIONS',
'MANAGE_WEBHOOKS',
'MANAGE_EMOJIS'
]
const testy = {
true: 'yes',
false: 'no'
}
const embed = new MessageEmbed()
.setTitle(`Testing a new command`)
.setColor(`DARK_VIVID_PINK`)
test.forEach(p => {
text += `${p} โ ${testy[member.hasPermission(p) ? true : false]}\n`
})
embed.setDescription(text)
message.channel.send(embed)```
Tryna remove READ_MESSAGES
<@!>
Or you can use user
message.author
client.users.cache.get()
Nono
You can litterally just use message.channel.send(message.author)
<@! is an indication that a member has a nickname afaik
which makes about zero sense or difference in the end
Top left corner is 0, 0
^
@vale garden wat
A bit stretched
Hi, how can I eval the on_guild_join event with my eval command please?
Typing -eval await discord.on_guild_join(ctx.guild) doesn't work
x1 is 650 and x2 is 660
@vale garden howw is it so stretched
x1 = 25 and x2 = 200 looks fine
why is this like this
Is it strechted across the y axis
you want to evaluate an event?
@pale vessel Yes! To test if my bot is correctly working when he joins a guild
you should avoid doing that
is there a reason why my user count of my bot is not accurate? its using client.users.cache.size but its in a server with 100k people but its not showing up
not sure that's how it works
And I know it's possible cause I already did it with eval on_member_join but I forgot how..
did you cache all members?
is there a reason why my user count of my bot is not accurate? its using client.users.cache.size but its in a server with 100k people but its not showing up
@fervent goblet not all users are cached
you should avoid doing that
@pale vessel Why?
why not just add and remove a bot from a testing server?
I think there is only x, and z axis
because it could lead to memory leak and what auger said
Cause it's simplier with a simple text, I'm just trying to know if the bot sends a message when joining a serv! @faint prism @pale vessel
Right but the discord js lib handles events from the api
not from when you want to call it I think
how do i cache users?
I'm using discord py, and I already did it with on_member_join :/
how do i cache users?
@fervent goblet Take a look at theIntentswith the 1.5
@fervent goblet fetchAllMembers under ClientOptions and make sure you enabled the guild members intent
and if your bot is verified, make sure it's whitelisted for the intent
Wont that cause a lot of unneeded memory usage
yeah it'll keep creating a listener for it
I don't really understand the problem :/
But I figured out, it wasn't discord.on_guild_join() but -eval await bot.on_guild_join(ctx.guild)
what the living fuck did you even want to do

ok im confused
@commands.Cog.listener()
async def on_dbl_test(self, data):
print(data)
user = self.bot.get_user(data['user'])
if not data['isWeekend']:
await bank.deposit_credits(user, self.weekday_coins)
await user.send(f"You were given {self.weekday_coins} for voting for me on top.gg!")
apparently get_user is returning a NoneType object
Its iirc
client.on(guildCreate, guild => {
//Ur code here
})
Wait nvm
U not js user
what the living fuck did you even want to do
@slender thistle ๐ณ
lmao
yeah
Ok bye
@unique stump int(data['user'])
hi
im back
so i have a question
if x1 is 650 and x2 is 660
it means that the x1 coord is 650 and x2 is 660 riht
right
Yes
So your image is 660 - 650 = 10px across the x axis
I agree
What coords do you have set on the y axis
oh kk
(Guessing the image is square)
but how
Get the size in px of your src image and use those for on the canvas
Maybe the src image is just wierd
see 25 - 200 looked fine
25 - 200?
Cracking the sweet spot in canvas is oddly satisfying
Why don't you just add the image pixel's so that it is not stretched
Okay uhh, i need help with the refresh thing for user and guild thing that i made
thx a lot
client.on('ready', () => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
});
When i put that set activity code out of ready, it caused and error, so i put it back in.
Main Thing - I need this code to work every 1m. So that it refreshes how many server's it is in, and how many users its serving.
V12?
Latest i guess
You need to set the timeout inside lf the ready event
You error because you call it before the bot is ready
idk what u mean, im new to bot making
ready event: settimeout(function, time in ms)
Maybe someome else can make a snippet but i am on mobile so i aint doing that
Where do i need to put this?
Inside of ready ๐คฆ
Sorry lol
client.once('ready', () => {
setTimeout(() => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
}, 1000);
});
client.once('ready', () => {
setTimeout(() => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
}, 1000);
});
Wont you get rate limited for running this every second
i removed one person from the server, hasnt updated yet
Not me
it's a timeout
there were 5 users, and it didnt went down to 4
That 1000ms thing i can set it 10000 for 10s
i mean you can change it
But the code didnt work, my bot's status didnt get updated
it wont
I need something that changes it every (1hr i guess?
1hr should be fine
@wary flame its not a loop tho.
that code is a timeout, not an interval
its a timeout
Fuc i ment interval
Means i need interval yeah
yes
yeah
a timeout only runs once, an interval runs forever
I just change setTimeout to setInterval?
yes
Yes
Okay
client.once('ready', () => {
setTimeout(() => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
}, 1000);
});
@fervent goblet API ABOOZ
I need help bot developers
ok
ask a question
go on...
So you know plasma bot
Wait
nope
Actually no
nope
Bruh
Yeah itโs been offline 10days now
ask in their support server
rip
๐ธ
I changed the code to setInterval
Idk the link XD
should be in their bot page
Lemme kick one person and see if it works
This aint the place to ask
on my VPS I run my discord bot. Around every 60 seconds there is a spike in the cpu, does anyone know what causes this or how I can fix it?
@narrow crescent send me the support server link in DMs pls that would be nice
I dont have man
run htop or something million
on my VPS I run my discord bot. Around every 60 seconds there is a spike in the cpu, does anyone know what causes this or how I can fix it?
@crimson vapor what are you doing every 60 seconds
@crimson vapor what language does it run on?
Oh
node js, using klasa framework
I set it 5s for test, it didnt change rn, lemme check again
5000ms
Nope it didnt change
I can tell that node is causing the cpu spikes because htop and I know it is the bot because I stopped everything else to make sure it was
do you have any interval running?
I do not think I have any intervals
client.once('ready', () => {
setInterval(() => {
client.user.setActivity(`${client.guilds.cache.size} Servers and ${client.users.cache.size} Users`, {type: 'WATCHING'})
}, 5000);
});
This code should change that guilds and users every 5s?
node 14.12.0
@narrow crescent yes
yeah the spikes are just under every 60 seconds
But it isnt i think
does it happen on roki too?
how many guilds is your bot in? @narrow crescent
how to use py on glitch.com
since he's using klasa too right?
yes but I think his are more random
how to use py on glitch.com
@narrow crescent i just checked the source code, discord.js does not remove users from cache
only members
yeah roki's are less consistent
I didnt understand..
basically in d.js, your user still exists
how to use py on glitch.com
pllzzz tell
there are two types of user data, users and members

I put in users.cache
a user, is a discord user, it has a username, profile picture, tag, id, etc...
a member is a guild-specific user, it has nicknames, roles, etc
@earnest phoenix no one is answering you because no one here uses py or knows if it is possible
Okay so i should put members?
when you kick a person, their member version gets deleted from the guild
@narrow crescent restart our bot problem solve
but their user still exists because it doesnt depend on guilds
Okay
I am only creating this bot for my server, so i dont need to really care about guilds
I will change that to member
ok so you can do something like client.guilds.cache.first().members.cache.size
how to start py file on package.json
How to do the impossible










flazepe