#development
1 messages · Page 801 of 1
go through it step by step and see where's the issue
@earnest phoenix you cant ban a person that has a role above your highest
wym
What if I do open eval but without client
if they arent in the server they arent bannable..
different library.
LumapToday at 7:15 PM
What if I do open eval but without client
don't
idk
look it up
there's a 99% chance that your eval in fact wont be sandboxed and someone will find a way to break it
mee6 uses their own private thing iirc
Hey.
let crow = await con.prepare('SELECT * FROM codes');
const { code } = await con.prepare('SELECT code FROM codes');
if(code == args[0]) {
would this work?
¯\_(ツ)_/¯
then why are you asking if you aren't there lol
planning future coding I guess...
@pine aspen that will likely not work
idk which database and library you're using, but prepared statements are not promises and dont do anything by themselves, they must be executed after being prepared
how would i make an embed that showed the users username and pfp in an embed, using discord.js
something like this but with the name and pfp
using discord webhooks
if you mean changing the author's name and pfp
like pretending the bot is someone else
you mean in the embed footer?
new Discord.RichEmbed().setAuthor(message.author.avatarURL, message.author.tag) I think
whoops backwards
yeah
.setAuthor(message.author.tag, message.author.avatarURL)```
ok thank you
var server = <Client>.guilds.get("id");
server.name
server.owner.tag
server.iconurl
Etc...
isnt that privacy breach tho?
I'm actually stuck on how the rolling system is going to work.
@quartz kindle i think this is allowed, before i have seen a bot who get any users from any serveurs the bot his
it doesnt mean its allowed just because you seen someone doing it
I think it's allowed as long as it can only be used on the server itself
You should never leak server data/info to other servers
Do most people have loads of then and catch sections of their code because up until now a lot of my commands assume that everything goes smoothly and I'm just getting round to improving stability
But say I was doing x code but something went wrong, I'd surely need to use a catch?
Even my new rewrite has some gross code
Could be worse
Also my editor mixes hard tabs and soft tabs
java itself is gross
No u
Damn
If I had an async function and an error occured while running it, could I put a catch on the point I call the function to run some code if it goes wrong?
async function uhoh(){
sadjajlasdk
}
uhoh()
.catch(() => {
console.log("Upsie")
});
Like this
Is that allowed?
that will work yes
Thank you
Like if I wanted to add an rp roll system in my bot, how would I make my bot see the number they wanted to roll?
Ok, that doesn't clarify much, I'll look into it.
consider the following:
prefix!roll 20
if we split it by whitespace, we'll get two Strings: prefix!roll and 20
take the second argument and apply a rng on it
Integer.parseInt(20) * Math.random()
then send a message containing the result
Ok.
Thats good for a pre-alpha right? Lol
guyys
I have loads more commands to put in
it says that it is locked
Im not sure
'SERVER LOCKED'
🤔
i just asked a mod
Yeah lol idk
This is my premium version of the bot (better quality commands, embeds, DM tickets etc)
Currently unavailable since im using it as a test bot for now lol
@violet obsidian looks good for a pre-alpha you can always work on it and add more as time goes on.
@unique nimbus wouldnt it be member.username? Or does Python not use that
It doesn't do it most likely
I always used .name
it might be an aliasis
¯_(ツ)_/¯
Ahh okay wasn't sure. Don't really use python
would a say command be NSFW?
no
No
ok
but if you let anyone execute that command your bot is probably going to get deleted by discord themselves - users can make it say straight up racist and fucked up stuff
then delete their message and report the bot
Snipe commands exist I guess
ok then im not going to do that
Every bot (almost) has a say command, and 99% of the servers have rules against that
im for sure not going to do that then
Every bot (almost) has a say command, and 99% of the servers have rules against that
every shitty* one
none of the mainstream bots have one for a reason
nadeko != shitty
nadeko is indeed shitty
kwoth is equivalent to yandev in programming skills
Mine had an echo command
But I deleted it because then when a user writes a message they can delete it
Ofc pings were disabled
but still, deletions didn't register in audit log
yeah for that very reason it's best to just not have one
it does more harm than good
Oh
I could add a user id in front
and indent newlines
like I do with chatlinks
Well, I don't yet indent newlines
but same point
nadeko is the core bot in my server so
doesn't mean its good or your choice was good
@bot.has_role('BotAccess')
async def cadhelp(ctx):``` ```Traceback (most recent call last):
File "C:\Users\culan\Desktop\beach hosting\beach hosting.py", line 240, in <module>
@bot.has_role('BotAccess')
AttributeError: 'Bot' object has no attribute 'has_role'```
my guy
youve been here some months
and you always get the same fucking error
would it be so hard to learn a little bit of OOP
what can you expect
OOP is so much better than procedural
What do you mean?
yea
I remember now
people just dont seem to want to learn the basics first and jump in WAY over their head
Ah ok
oof my bot has super basic stuff
i can't do anything advanced yet
So?
Just cuz your bot cant do complicated things doesn't make it bad
Hey someone know how can we get memory and cpu usage of bot
How use it
scan the node.js docs
if you're using pm2 it can get both for you
Thanks
any library better than lavalink? for example that can actually do playlists and livestreams?
(for music)
@earnest phoenix do you know if all of the elements are stylable?
#bot doesnt seem to work for the background, even tho browser says it should
you talking bout the page background
ye
just do body
facepalm
yup
i'm dumb
thx xD
also
i can give u a template if u want
sure :3
there's a few steps you'd have to take tho
iusfdgfub jfersgfb j
like?
there's an image u have to edit
it's the little up arrow
for the upvote count
o?
to what tho
you gotta edit the color
i'll show you how
oh to make it match?
give me a second
yeah
o
oki
i was gonna do black/blue
so it might fit
I think my computer's clock is off from Discord's
That would explain the numbers I got
As I am definitely subtracting correctly
String ping = String.valueOf(msg.getTimestamp().toEpochMilli()-send);
But then how do I write a ping command?
what lib?
Discord4J
cuz they'd probs already have a ping
I'm trying to use my computer's time and Discord's time to calculate ping and pong
But I think our clocks are off
I'll see if my lib has a ping thing I missed, but I don't think they do
if you are running a bot on a computer, it would be normal to have a litle high ping, maybe 2000ms as a max, negatives would not make sense though
This is the more code
I'm not seeing any logic errors far as I can tell
The read underlines is just my IDE not working
it compiles (and runs) fine
if you hover on the red line it should say whats wrong
It's missing the "Projects and External Dependencies"
Despite refreshing and building with the eclipse plugin applied
So the IDE is not correctly recognizing my argument types - "refers to the missing type"
Anyways though,
I really don't see any errors in my logic
So I dunno why I'm getting negative ping times
Except for clock inconsistencies between Discord and I
rn
?
This is my testing device, not production device, though
well if you want to see, windows settings, time and language, date and time
then click
After syncing
I pressed sync now
It still gives a negative ping
are you doing it backwards?
So should I repost the code snippet?
I would subtract the older time sample from the newer sample
right?
ye
cadapter.send(text, msg->{
String pong = String.valueOf(System.currentTimeMillis()-msg.getTimestamp().toEpochMilli());
String ping = String.valueOf(msg.getTimestamp().toEpochMilli()-send);```
No
Indentation is bad
Though you can copy+paste
Anyways
If I'm subtracting the older, smaller time from the newer, larger time
It should be positive
Unless our clocks are still out of sync
long send = System.currentTimeMillis();<-older
msg.getTimestamp().toEpochMilli()<-newer
ngl, im clueless
I think
it's just not syncing properly
Despite pressing "sync now"
You are comparing the system time with the discord time?
dont compare the times of 2 different machines, they are never in sync
How do I check the ping then?
Unless I did them across messages, but than that's not really a ping
Or I guess I can just merge my ping and pong times maybe
Though that then shows less information to the user
record the start time > send a message > wait till the message is send > record the end time
or use the ping that is build into the api
Yea
That would be merging the ping and pong
There is no ping built into the api
or, if there is, it doesn't seem to be documented
what library are you using?
D4J
give me a minute
Really
client.getResponseTime()
2 of my bots also use D4J
How does it calculate that?
Discord and the bot sometimes send ping messages to each other to make sure the bot is still alive
And that message contains the ping time
Ah ok
And then how about my pong time?
I assume that is off too
It would be really nice
If my IDE would actually work
2nd time is client.getResponseTime()
3rd time is sending a message and checking the send time
Oh I see
I can subtract getResponseTime from time elapsed locally
Right?
To get the pong
no
No, client.getResponseTime() is a 2 way time as far as i know
there are two latencies to discord: websocket and rest
then x-ping is pong
websocket latency is the time taken for discord packets to reach your machine. they are recorded by the library, averaged, and saved into the getResponsetime getter
rest latency is the time taken for your machine to send a request to discord and receive a response
So can I just not divide my ping and pong times then?
rest latency is not recorded by default, you can record it by sending a message and waiting for a response, and measuring time elapsed in between
I was just hoping that I could make ping the amount of time to send a message
And pong the amount of time to recieve
But I guess I can only check the WS ping then ):
As far as I know a ping is already a 2 way response time, and not 1 way
But I could be wrong
It would be really cool
If our clocks were in sync
Because then I could have gotten the 1-way time
yes, but in case of websocket, whose main function is receiving packets from discord, it is safe to say its ping is the amount of time taken for discord to reach you
@earnest phoenix I sent you the theme template and instructions for how to edit it.
if you want the 1 way time then take half of the time, usually packets will take roughly the same route
but if you take the 1 way time it's not a valid ping time
one-way time is impossible to get, you can only estimate it like spirit said
It's just an estimate
but I can specify that
since all requests require an acknowledgment to be returned
It would have been lovely if our clocks were in sync
I'm quite upset about that
all ping checks are A>B>A where A is one machine and B is another machine
You could sync your bot time to discord's time if you check the time of a received message and take the delay in account.
But that will be very unreliable (Messages might be received late, or the ping might fluctuate)
Why is it even important that the time is in sync?
To get the correct 1-way ping and pong
i think he wants to compare bot timestamp to message timestamp
what you could do is record the time, then send a message to discord and check what timestamp discord gave to that message
Except
Our clocks are off
just remember that there WILL be some delay between you sending it and discord receiving it
Our clocks are off
I am recording the time
and checking what timestamp Discord gave
but our clocks are different
Because it is quite hard to sync clocks when syncing itself involves a) having the correct time and b) dealing with latency of the time syncing service
I'll just suffice for the 2-way ping
but I'm sad
So my actual 2-way ping is 74 ms
Not negative, not large
I think the Discord servers that communicate with bots are in New York
a weird thing you could try:
on message event -> check message timestamp -> deduct client.getResponseTime() -> compare to system time -> get offset and save to a variable
all further time comparisons involving system time shall include this offset
offset could be updated on every new message event
basically an attempt at manually syncing the clock with discord lmao
xD
Will probably try that out sometime before I submit my bot
I love it
same, 2am here
Goodnight to ya'll then
lol only 9:03 here
Your ping already told me you are in the USA 😛
xD
70ms ping means there is no ocean between you and the discord servers
Discord lets you choose the server region, doesn't it?
Bots always connect with New York as far as I know
Oh
interesting
What's a ping look like where you live?
Oh
it's only slightly longer
It could always be network delay
hopping the ocean is close to 100ms
So I wanted my bot to send a welcome message in my server and came up with this but I wanted the bot to mention the new user.
Here is what I got
client.on('guildMemberAdd', member => {
member.guild.channels.get('660593478807322634').send("Hey there");
});
So I feel like you have to place message.mentions.members in
member.guild.channels.get('660593478807322634').send("Hey there");
^^^^^^^^^^
mmm
i think it's something like member.mention?
So it would be like this?
member.guild.channels.get('660593478807322634').send("Hey there", message.mentions.members);
or probably close to that, I might have missed something.
Not sure if it is that.
message How do you get the message?
'member.mention'
There is no message when a user joins
Oh so then.
member.guild.channels.get('660593478807322634').send("Hey there", member.mention);
I have no experience with JS bots, so I can't help with any details
To get it to ping them you can do <@${member.user.id}>
Or yeah ${member.user.tag} will work
Yeah I know I messed up
So this will be the final product of the code because it looks to the point where it looks correct?
client.on('guildMemberAdd', member => {
member.guild.channels.get('660593478807322634').send("Hey there", '${member.user.tag}' );
});
catra you could use member.guild.systemChannel too
Yeah to get the default welcome channel
^
There is no default
there is
welcome channel
Yeah
I turned it off
there still is a system channel
it might not show welcome messages
but it still exists
I'll keep it as is because I don't really want to change a whole lot of things in my server.
you wont tho?
It's just easier then defining the channel how you did but whatever works
well just know that if, for some reason you ever have to change the welcome channel, you'd have to change the bots code. and with the way you get the channel now, the bot can never send welcome messages in any other server
That channel existed for I dunno 3 months
my 2nd half still stands
Yes but what he means is that because you called the channel by ID it will only run in that channel
No other server can use the welcome messages
if it ever gets in another server, you'll have to either 1) make it configurable or 2) use the system channel
so you might as well do it now
My bot is private to only my server
its good practice anyway
so i have an array here, ['h', 't'], when i use .slice(0, 1) i only get ['h'], why's that? it should slice both
Okay well that's different private bots don't really need it to be for everyone
element 0, stops BEFORE 1
nice reply!
and it stops BEFORE the 2nd arg
slice(a,b) goes between a and b, INCLUDING a, but EXCLUDING b
so (forgive my python notation) "0123456789"[2::6] would be "2345"
so instead of 0,1 i should do 0,2?
yup
ah ok, ty
np
now it show this for some reason
line 12
column 90
like the error says
you didnt teminate (end) a string
you used " to start it and ' to end it
And ${} should also be ran in ``
back ticks ``
yup
Yeah
Or it won't read it how it should
It will send it as a normal message instead of outputting the ping
Im getting guild is not defined, can anyone help me out?
https://pastebin.com/2gGHUQjH
this is the error
@lavish seal try message.guild
you aren't defining guild anywhere to begin with but yeah try that ^^
that would work
i think
sheet, ill try that but how would i define it? tbh i thought it was enough to require discod.js
you define the parameters when you call the function but the function itself doesn't take any parameters 
member.guild afaik
At the top async function play(message, guild, serverQueue) {
Otherwise message.guild should work or you could also do const guild = message.guild; but that's just the lazy way 🤷🏻♂️
xD
will try all of the above
So I'm trying to use noblox.js in node.js, but I don't get how the cookies necessarily work,
so I have a command that logs someone in using an alt's cookie, and I have a command called "shout", which is supposed to create a group shout, however, I'm calling roblox.shout(groupid, message, cookie[HERES MY PROBLEM]). If I call it with a cookie then it says I'm not logged in, but if I call it without a cookie, it works just fine. I can confirm that the cookie variable is correct and is working.
Can someone tell me how I can use a robloxsecurity cookie as an argument in it so I can have multiple users?
???
use fucking lua
The welcome message won't work, I tested by getting help from someine in my server.
client.on('guildMemberAdd', member => {
member.guild.channels.get('660593478807322634').send("Hey there", `${member.user.tag}`, "Welcome to She ra");
});
Sends nothing.
ofc
You shouldn't be passing args that don't need to be passed.
client.guilds.channels.get
should do it
member is the object of the member that joined
use fucking common sense
If the channel by the ID exists in that guild, it should work. If it doesn't, no work.
no

that member object has nothing of that
what do you mean?
K, I get it.
now i get this error and the bot doesnt start
try msg insteas
oh no don't do that lol
can't use a variable outside of it's scope
are you sure you defined it
so you have to do that in the message event's scope
cuz I guess you put it to the 3rd line of the whole file
i did as they said
Hey,
let crow = await con.prepare('SELECT * FROM codes'); const { code } = await con.prepare('SELECT code FROM codes'); if(code == args[0]) {
can you show your code
How can i check if a data is in a column?
what 

Does my code work up there?
I assume it does but the rest of the code does weird things.
@sudden geyser
https://pastebin.com/nrxp9JhF
I assume it does but It does weird things.
Free text/code sharing site supporting 450+ different languages!
no
pastebin reeee
Can you show the code in commands/fun/MusicBot.js
I don't believe that's the file.
thats the file
the one i uploaded
oh i removed the consts that were causing the error
because bot wouldnt start and they werent helping the command
but they were right under the top 2 const like this
const discord = require("discord.js")
const ytdl = require("ytdl-core")
const msg = message
const ch = message.ch
const guild = ch.guild
then i removed
const msg = message
yes, you can't use a variable before it's been declared. are you having anymore issues?
yes i originally added that as the recommendation to define guild because when i did s!play with my bot it joined the channel but did not play the yt link i provided
@lavish seal You have to define the consts under the async function since that is where message is originally defined
oooo i c
i also don't recommend using multiple different methods to call the same function or event or whatever
use one if it doesn't work try the other
Example: if you define Guild in the async function you shouldnt need to define it again anywhere else it should be able to be called and used as is
hey guys
I just got Contabo VPS (4 core 8GB tier), and the response time is pretty slow for some of my commands
does anyone have any suggestions on what I should do? I'm using Heroku right now and was thinking of migrating to Contabo, but I'm not sure now since it's kind of slow.
Maybe I should get a better tier for Contabo, like the 8 core 30GB RAM one?
Would appreciate any help!!!
Still doesn't work
client.on('client.guilds.channels.get', member => {
member.guild.channels.get('660593478807322634').send("Hey there", `${member.user.tag}`, "Welcome to She ra");
});
What you trying to do?
nope
take out those commas
client.on('client.guilds.channels.get', member => {
member.guild.channels.get('660593478807322634').send(`Hey there, ${member.user.tag}, Welcome to She ra`);
});
@pine bear
now ```js
("Hey there" ${member.user.tag} "Welcome to She ra");
^
there is suppose to be a comma here right?
But then it just shows error
wtf
Wow
is it js or am i dumb?
Oh I needed to seperate them
Yep
("Hey There " + `${member.user.tag}` + " Welcome to She Ra")
Make sure you add spaces or it won't
can someone tell me how i can add custom prefixes? 
I fixed it a moment ago
Okay
I know how to code lmao
@regal saddle per server?
yep
Link a DB of some sort make it create a default prefix on GuildCreate and store the prefix in the DB via Guild.ID
Then create a command to allow them to replace db prefix
k thx m8
(`Hey There ${member.user.tag} Welcome to She Ra`)
There's something called template literals
I already told him this @copper cradle but he says there will come a error

more complaining abt toxicdev xD
LMFAOOO
🤔 hey now!
no but what me and @copper cradle said is the way to go
He said that would error so I recommended a different way 🤷🏻♂️
it doesnt error tho?
yeah but why in thw world you you separate a string and put it inside another string
He also had it as "" `` "" without the + so I corrected
("Hey There " + ${member.user.tag} + " Welcome to She Ra")
("Hey There " + member.user.tag + " Welcome to She Ra")
you can do it the ES5 way
client.on('client.guilds.channels.get', member => {
member.guild.channels.get('660593478807322634').send(`Hey there, ${member.user.tag}, Welcome to She ra`);
});
exactly that
^

NOT ```js
"Hey there, " ${member.user.tag} "Welcome to She ra"
no
zSnails, how your day goin so far? @copper cradle
so you're telling me
@earnest phoenix I'm not talking about what you just sent
mk
I'm talking about what I suggested
use template literals when possible
Using Discord.js Docs: 
Using templates without understanding it:

My main problem with coding bots is that there would be so many variables to learn.
wha
wha
ahW
wym so many variables
ill go sleep, its 6am lool 
xDDD
i didnt even noticed it xD
eh, not like javascript variables but like what variables are going to affect the outcome of the javascript
i was like, ight im gonna sleep around 1am or 12pm and now its 6am haha
is there an API limit on what messages a bot can edit? for some reason if I restart my bot, then try to make it edit one of its message, nothing happens
its cuz the cache of your bot gets deleted
Your bot cant remember that he sends the message
ahh okay thanks
somehow i doubt
i can edit a message from years ago if i want
as long as you have the id and channel you should be fine
oh... well then there must be a deeper issue... I will have to do some more digging
you can make an message cache.
just get the message id and channel id and your should be fine
can be solved so that my robot can speak multiple languages?
google translate api?
Hey!
hi?
I just joined this one server where the "bot" appears to be on mobile? How does that work?
more debugging reveals that lukas is right. The message id points to the right message, but the bot doesn't see it as SocketUserMessage anymore. Though Im not quite sure how to make the bot see it as such again...
How come I get an error (shown below) when trying to require a .json file?
let c = require("./configMsgs.json");
```Error:
```diff
- Cannot find module './configMsgs.json'
what file are you running that line from
A command from the commands folder.
../configMsgs.json ../ goes up one
^
- SyntaxError: Illegal return statement
that's a different error
Yes.
Ah.
I thought it had to do with the require function.
Thanks, it must have worked! 🙂
Im making my bot check to make sure that the userID is me to run an admin command, but it doesnt seem to be working with message.author.id(). Does anyone know how to do it?
discord.js
cant help you there
rip
does d.js have a similar command to discord's isOwner()
not sure, dont think so tho
sadness
rip
lang? library?
oh, sorry. Discord.js
@halcyon ember ```js
if(!message.author.id === 'UserExecutableHere') return
thanks, it worked:D
Lol np
i have a question, does anyone know how to implement music into a discord bot? I've tried to install the npm package discord-music-core but it keeps failing
I do @celest drum
You could use lavalink
But I have one issue
I don't know how to install a lavalink voice node
could it be found in npm?
?
I'll link a GitHub guide
thankyou
Anyone here have experience with the discord api?
Specifically redirect uris?
oauth you mean
yeah what with it
i need some one help me
I need to make my bot on
you are aware we don't have superpowers and can't read your mind right? you need to provide your error, library, language etc for us to be able to help you, we need context
ok
Uh I just did like in #502193464054644737 and it isn't work.
what
yeah
????
And my bot just disconnect
which library are you using
library
...
which tools and programming language did you make your bot with?
command prompt
node
what
It's my first time
have you even tried reading the docs
yes
3 times
also it's not a good idea to faceplant into making a discord bot without any prior programming knowledge
if your bot is written in javascript language, using node js, your likely using eris or discord.js. you likely have a file called something like index.js, or bot.js, and a package.json file etc.
go to the directory your bot files are in, shift and right click to open command prompt (may be called windows power shell), then type node filename.js, with whatever your bot file is called. you may be able to instead run something like npm start depending on the package.json file's configuration.
thats it, im out ~
😄
@neat ingot wait, do u know how?
its a box-shadow in the css
how much are we allowed to do with the html we put into the page?
anything except hiding ads and buttons/links
^
well, what about umm..
<iframe src="" onload="window.location.href='https://dekbot.com'"></iframe>```
couldnt help but notice thats what the medal bot does
yes iframes are allowed
@neat ingot what happens
that is not allowed i think
probably isnt
so clearly exemptions...
<iframe id="botiframe" src="https://test.com"><p>ehm, uwu? Your browser does not support iframes</p></iframe>
i just use that
but its still better than letting google harvest your data on top.gg lol
medalbot doesnt do it
oh
thats from view src on pokecord page
it's commented
yes i noticed that
but medal still redirects 😄
it doesnt for me?
noah you need to put it into a style block
i did
@earnest phoenix you need to pay attention to css specificity
<style>
html {
background-color: #7289DA;
box-shadow: blue;
}
.owners a {
color: red;
}
</style>```
lol
more specific css rules will always override less specific rules
smh
rip
dont abuse important
lmao
just make your css equally specific
sure
use the same selectors they use when you inspect element
yeah
so im now curious why medal tv bot redirects me but not you
its always redirected me, thats what caused me to notice it
exactly
and then, are they allowed to be redirecting?
and then, are we?
cause i mean, its incredibly simple to do so, but i dont see why the site would allow for it tbh
no redirect in firefox either
could it be location specific maybe?
lmao
im in uk: scotland
this is what their iframe looks like for me in the source code
<iframe id="botiframe" onload="setCampaignIframe('');" width="100%" src="https://medal.tv/?ref=dblbotpage" id="botiframe">
@quartz kindle he's not lying... Here look https://streamable.com/glb3z
aha, another person! where are you based toxic>?
🇨🇦 lol
ahh rip location theory 😄
Lol
@quartz kindle could it be your browser/isp cache
i figured it out
also, is there any other thing in their source, like the script tag i found in pokecords thing?
lol
I saiddd
its not an iframe redirect
Bruh
its a backend redirect, and it only works via top.gg/bot/medal and not via top.gg/bot/medalsBotID
oohhh
Send bot id
https://top.gg/bot/medal
301 Moved Permanently
https://medal.tv?utm_source=dbl&utm_medium=dbl&utm_campaign=dblcard&ref=dblcard
200 OK```
its a 301 redirect
https://top.gg/bot/307998818547531777 this one doesnt redirect
it just shows their iframe
wait, are we allowed to set the css for a custom background image? 😄
wheres that rules thing
scrolls up
yes you can use custom backgrounds
It looks cool their page
XD
does someone know how to put bot icon in circle?
i mean i knowh ot to but i need the style
border-radius: 50%
yeah but i need like .bot-img
yeah just give it the border-radius
css specificity
?
img needs to be at least as specific as the original
give it to the background instead
border:none
you know, you can just test it out directly in the element inspector
i just flat out copied some stuff to make my bot avatar float like medals does 😄
i wanted the round border anyway, but now he bouncy 😄
help
Heroku
client.on("messageUpdate", async (oldMsg, newMsg) => {
//let prefix = await db.fetch(`prefix_${newMsg.guild.id}`) || ayarlar.prefix
if (newMsg.author.bot) return;
if (!newMsg.content.startsWith(prefix)) return;
let command = newMsg.content.split(" ")[0].slice(prefix.length);
let params = newMsg.content.split(" ").slice(1);
let perms = client.elevation(newMsg);
let cmd;
if (client.commands.has(command)) cmd = client.commands.get(command);
else if (client.aliases.has(command))
cmd = client.commands.get(client.aliases.get(command));
if (cmd) {
if (perms < cmd.conf.permLevel) return;
cmd.run(client, newMsg, params, perms);
}
});```
client.on("messageUpdate", async (oldMsg, newMsg)) = { @toxic jolt
You forgot a ) at the end
Lol I said the issue
whyy??
wtf
@hoary elm can you help mee
=>
@quartz kindle please help man
hm, how to remove this
i tried adding a background image and still appear that
and changing background color and same..
@toxic jolt => not =
the correct way is => WITHOUT the extra ) lol
I was gonna say, it should be a callback
client.on("messageUpdate", async (oldMsg, newMsg)) => {
//let prefix = await db.fetch(`prefix_${newMsg.guild.id}`) || ayarlar.prefix
if (newMsg.author.bot) return;
if (!newMsg.content.startsWith(ayarlar.prefix)) return;
let command = newMsg.content.split(" ")[0].slice(ayarlar.prefix.length);
let params = newMsg.content.split(" ").slice(1);
let perms = client.elevation(newMsg);
let cmd;
if (client.commands.has(command)) cmd = client.commands.get(command);
else if (client.aliases.has(command))
cmd = client.commands.get(client.aliases.get(command));
if (cmd) {
if (perms < cmd.conf.permLevel) return;
cmd.run(client, newMsg, params, perms);
}
});```
here
client.on("something", (a,b) => {
// where are the open brackets?
})```
That's what he used the first time
okay
and he was correct, just missing the >
the closing bracket gets pushed to the end to make room for the callback function
client.on("something", (a,b) => {})
Yeah that makes sense
how did that fix his issue tho
it didnt
No it didn't
LOL
Now it doesn't sync with github
@toxic jolt try turning the dyno off and on again or just wait a minute for it to catch up with the updates
@earnest phoenix
Synced but still still the same error
remove the extra )
okay
.shapes-background {
display: none
}```
?
@steel heath omg
wow
wrong channel fam
i how to fix this error
how do you have client defined?
Yeah I was just thinking the same thing
Ended something wrong prior or isn't defining client but then it would just say it's not defined
const DBL = require("dblapi.js");
const dbl = new DBL('API_TOKEN_DBL', client);
dbl.on('posted', () => {
console.log('[DBL] Server count has been updated!');
})
client.on('ready', () => {
setInterval(() => {
dbl.postStats(client.guilds.size, client.shards.Id, client.shards.total);
}, 1800000);
});
dbl.on('error', e => {
console.log(`Oops! ${e}`);
});```
this does not work ^
it posts the guilds count but not shards
@toxic jolt show code before that
@earnest phoenix you dont need to use .postStats if you have client in DBL
it will use the autoposter instead
@earnest phoenix if server count is posted, token is correct. Are you sure that your shard system works like that? (client.shards.total for number of shards...)
wait
i do this
const dbl = new DBL('API_TOKEN_DBL', client, client.shards.total);
?
no
then
if you do this new DBL('API_TOKEN_DBL', client) you dont need to use postStats
you only need to use postStats if you do this new DBL('API_TOKEN_DBL')
of d.js?
yes
in your package.json
require('discord.js').version
version: 11.5.1
yes, client.shards doesnt exist
then how to
const dbl = new DBL('API_TOKEN_DBL', client);
but if you use the automatic posting, it will do it for you
Just that
@tight plinth but i want to post shard count too
It's automatic
how can i transfer app from team to my self i am the owner of app and team
the automatic posting will post shard count if your bot is sharded
oh
const DBL = require("dblapi.js");
const dbl = new DBL('API_TOKEN', client);
dbl.on('posted', () => {
console.log('[DBL] Server count has been updated!');
})
dbl.on('error', e => {
console.log(`Oops! ${e}`);
});
then this?
yes
thanks
@quartz kindle
any ideas why when running nodejs under systemd it has no read/write perms?
idk, did you create a service file for it?
.owners a {
background-color: #23272A;
color: #ffb53b;
}```
how to remove the white color
idk, did you create a service file for it?
ye, its running as User=root
^past 30 days bandwidth for my bot
is it normal to be using so much since hes in this server?
its almost all inbound
That's what my CPU utilisation graph looks like so I guess this server be thicc
If you think about it, every time a message is sent, your bot checks if it contains your prefix
So that means a lot of incoming messages
help ^
lmao
But in proportion its a big jump
well yea i guess thats true 😄
wondering what kinda bandwidth these bots with like 100k servers+ use 😄