#development
1 messages · Page 1376 of 1
@client.command(aliases= ["leaderboard"])
async def lb(ctx):
if ctx.message.channel.id == 775495382016458772:
with open("leaderboard.json", 'r') as json_file:
pop = json.load(json_file)
embed = discord.Embed(title = "Leaderboard", description = "This the leaderboard in the How Do Bot Support Server!")
for item in sorted(pop.items(), reverse=True, key = lambda x: x[1]):
idpop = int(item[0])
points = int(item[1])
user = await client.fetch_user(idpop)
embed.add_field(name = f"User: {user}", value = f"How Do Points: {points}", inline = False)
embed.timestamp = datetime.datetime.utcnow()
embed.set_footer(text = f"{member.guild}", icon_url = f"{member.guild.icon_url}")
embed.set_author(name = f"{member.name}", icon_url = f"{member.avatar_url}")
embed.set_thumbnail(url=f"{member.avatar_url}")
await ctx.send(embed = embed)
else:
lbchannel = client.get_channel(775495382016458772)
await ctx.send(f":warning~1: You can only run this command in {lbchannel.mention}.")
When I tried just doing it in a diff channel, it still didnt work
JS
How would one use node-schedule to schedule a cron job that'll start on a specific time every 24h? say, cron jobs work based on local time, if i wanted to use UTC + 8 or some other format while my timezone is GMT - 2 or some other time, how would i set a cronjob to sync with another timezone?
Bob, what didn't work?
@sly wing ask in the mimu support server
send me the link
@earnest phoenix what's the problem? I didnt understand completely
it doesnt print anything
I think its because the embed has too many images
Max is 1 or 2, I can't remember
Look it up though, I'm not sure
schedule.scheduleJob(`${convertedTime.getHours()} ${convertedTime.getMinutes()} * * *`,() => {});```
would this be valid for my previous question?
@earnest phoenix hope I helped
kk
thx
if(CommandCooldownList.indexOf(msg.author.id)) {
How can I check if a value exists in an array
ive tried tons of things like includes or indexOf but I get an error saying its not a function
@earnest phoenix what is CommandCooldownList?
arrays are presented with []
JS USES []
xD
im used to languages where its {}
thats an object
js is weird
in lua its called a dictionary
if you try rankers["128641987246123"] it will return true
yeah i know i know
thats just an object in js
i havent dicked with lua much
best i know from lua was some scripts i made for openComputers for minecraft

bot.on('message', msg => {
if(CommandCooldownList.indexOf(msg.author.id)) {
if(msg.content.toLowerCase()==="") {
msg.channel.send("")
};
} else {
setTimeout(() => {
var CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
setTimeout(() => {
CommandCooldownList.splice(CurrentElement)
}, 5000);
}, 0);
};
});```
wait why doesnt this work
Its supposed to be a command debounce
are you using VSC?
yes
good, i'd much rather teaching you how to debug rather than just feed you this one time
take a look at this
ok ill debug it
well the debugger ran
so its fine
now do this
right next to the line you'll see that red ball
add that to where you want your script to pause
and then hover over the variables to see current real time values
step over is what you'll mostly commonly use
to follow the code
do what now
basically add a breakpoint(the red ball in the gif) on the first line
if(CommandCooldownList.indexOf(msg.author.id)) {```
now type something to trigger the bot, and it should pause the it on that line
then you click that button to see what the code is doing
and why its not going where it should be
you can hover over the variables to see their current value too
ok the script didnt stop
bot.on('message', msg => {
if(CommandCooldownList.indexOf(msg.author.id)) {
if(msg.content.toLowerCase()==="!twodoritos") {
msg.channel.send("https://www.youtube.com/channel/UCk9BPJqFsMj8zbZ_KLDEgwg")
};
} else {
setTimeout(() => {
var CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
setTimeout(() => {
CommandCooldownList.splice(CurrentElement)
}, 5000);
}, 0);
};
});```
why isnt this else statement running
but the if statement does
wgat
jsut type in a message and the bot should pick it up
that doesnt make sense ill just print debug
just go
but its pointless
yes u click red button and the thread pauses when it reaches that line
i know how to do it
so whats the issue?
cuz its passing on the if
its easier for me
ok
but it isnt tho
the array is empty
wel
it is
but idk why
the array is empty
did you populate the array?
no
what
i didnt populate it
so it shouldnt be passing
by populate do u mean add values
look debugging wont help
use includes
this is a logic issue
bot.on('message', msg => {
if(!CommandCooldownList.indexOf(msg.author.id)) {
if(msg.content.toLowerCase()==="!twodoritos") {
msg.channel.send("https://www.youtube.com/channel/UCk9BPJqFsMj8zbZ_KLDEgwg")
};
} else {
setTimeout(() => {
var CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
setTimeout(() => {
CommandCooldownList.splice(CurrentElement)
}, 5000);
}, 0);
};
});```
dont use indexOf
then what do i use
bot.on('message', msg => {
if(!CommandCooldownList.includes(msg.author.id)) {
if(msg.content.toLowerCase()==="!twodoritos") {
msg.channel.send("https://www.youtube.com/channel/UCk9BPJqFsMj8zbZ_KLDEgwg")
};
} else {
setTimeout(() => {
var CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
setTimeout(() => {
CommandCooldownList.splice(CurrentElement)
}, 5000);
}, 0);
};
});```
im so confused
wait
i think i see what i did
ok yeah that was dumb
bot.on('message', msg => {
if(!CommandCooldownList.includes(msg.author.id)) {
if(msg.content.toLowerCase()==="!twodoritos") {
msg.channel.send("https://www.youtube.com/channel/UCk9BPJqFsMj8zbZ_KLDEgwg")
setTimeout(() => {
var CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
setTimeout(() => {
CommandCooldownList.splice(CurrentElement)
}, 5000);
}, 0);
};
};
});```
so i can make a new thread
hmmm fair but still shouldnt clog
it shouldnt really affect performance whatsoever
not quite
it leads to unintended bugs
since they are hoisted
oh like id getting interpreted as an int instead of a string, things like that?
take this as example
even though im calling var before it event exists
it doesnt error
what is the difference between let and const
which it should, cuz im calling a non existent variable
let is mutable/changeable
const, is constant, immutable, cant change
oh so if u plan on something being defined in a scope
u would define a let variable outside said scope
yes
assuming u wanted it globally
let and const are teh same, its just that one is variable and one isnt
dont do globals
it just pollutes workspaces
its top 5 shit NOT to do on js
How to make a bot dashboard
vars also dont respect scopes which is a bother
Any idea
with code
How
css, html, ngix/apache/ vue/react/angular
theres the kit, have fun learning that
what
you dont need to declare string
if you like strong typed stuff, i'd recommend TypeScript
talking to me or the other dude
you
ts IS js
there isnt best code
whats the difference
in js you do this
let string = 'abc'```
in ts you do
```ts
let Str:string = 'abc'
oh what
you can annotate variables to a specific type
say you want str to ONLY have string in it, and dont allow any other type
if i were to try to do
let message.content = '!help'
message.content = {};
//somewhere else in code
message.content.startsWith() //errors
let message.content:string = '!help'
message.content = {} // errors, it doesnt let you assign anything other than a string to that variable
// rest of code is clear, no bugs
ts allows you to catch bugs like that beforehand
rather than debugging them in production
@opal plank we create my bot on Mobile . Do you want to check?
is tha really valid
@earnest phoenix id highly recommend watching this https://www.youtube.com/watch?v=ahCwqrYpIuM
TypeScript has forever altered the lives of JavaScript developers. Learn why TS is so awesome and the basic concepts required to be successful using it https://angularfirebase.com/typescript-the-basics/
Deep Dive https://github.com/basarat/typescript-book
TypeScript Docs http...
let message.content = "fnkdalsfsdf"
setTimeout(() => {
let CurrentElement = msg.author.id;
CommandCooldownList.push(msg.author.id);
console.log(CommandCooldownList[0])
setTimeout(() => {
console.log("SPLICED")
CommandCooldownList.splice(CurrentElement)
console.log(CommandCooldownList[0])
}, 5000);
}, 0);```
i think im using splice wrong
the value stays in the array
you could filter it too
@opal plank we create my bot on Mobile . Do you want to check?
Maybe you ignoring
splice arguments:
- the start index
- how many to remove from there
- the remaining args are the ones to at that index
@earnest phoenix i have no idea what you meant
bruh
ok thats not what i want then
i just want to remove a value from an array
filter((a) => a !== inputhere )
what
@earnest phoenix https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/Array/filter
You could use it like: <Array>.splice(startIndex, 1).
Removes 1 element from the startIndex.
CommandCooldownList[CurrentElement] = null;
wait this should work
@sudden geyser no because multiple people may have their id in the array
i find easier to use filter rather than get index and then splicing at that
CommandCooldownList = Array.from(CommandCooldownList.filter((a) => a !== idhere))
that should work just fine
i miss lua where you could just do table.remove(tab,v)
also
recommendation
use map and time values for that
rather than running that many setTimeouts()
user does command => date.now() + cooldown amount => map userid + when the date expires
on new command => if map has userid, and date.now() is higher than cooldown expire , run command and clear
its more efficient than running timeouts unecessarily if the user may not respond in hours
I'm getting this error for a task that runs once an hour to fetch 10 users: discord.errors.HTTPException: 503 Service Unavailable (error code: 0): upstream connect error or disconnect/reset before headers. reset reason: overflow
anyone know why?
somehow my own bot managed to block me. anyone know why and how to get it to unblock me? im using discord.py
Wdym it blocked you?
I'm getting this error for a task that runs once an hour to fetch 10 users:
anyone know why?
@hollow sedge it's a server error.
aka it's not your fault. It's the server's fault.
Discord was having issues recently.
@past sable you should make a command for it
i cant msg it
apparently bot accs cant actualyl block and stuff according to dpy docs
I think that might require an intent
which intent
Maybe just try the members one
Yeah how did it block you lmao
i have no idea
How do you know it blocked you
Anyone else can?
no idea
It might be you have DMs off
Just bc you have DMs off doesn't mean you can't DM someone
Well if clyde is sending you that message then it's probably something else
Doesn't hurt to try tho
hmmm
JS
I got a date converted into a specific timezone UTC + 8
and i can get my date locally(will be dynamic);
How can i get a conversion of date , so when the first UTC + 8 date is at 00:00 i get the equivalent in my time?
If both timezones won’t change u could use a non-dynamic way, just adding/removing the time difference in seconds from the timestamp and after convert the timestamp to a date-time format.
@boreal iron they do change since they'll be used on different hosts across the world
so i need a dynamic way of doing this
the target is always the same, but the local will change
its basically sync'ing different hosts to run cron jobs at the same time
Then just use the date function to create the correct time for you.
Just add the offset to your time (string) and create a new time.
https://developer.mozilla.org/de/docs/Web/JavaScript/Reference/Global_Objects/Date/getTimezoneOffset
Like in the example
Adding GMT+ or - XXXX
The offset should show the difference to GMT
With that you can create a new date
It’s called GMT previously
It’s just called UTC today
UTC isn’t a timezone just the so called world time
But = GMT
hmmmmm
i got both dates already
which theres already a shitton of logic behind
but i cant get the difference
actually
hmmmm
this is what i got running
howcome?
@boreal iron
those 2 bots are in different timezones
target is the same on both cuz im converting it to UTC time with the offset
Yeah but the offset doesn’t match the actual time
what time?
Any why 3600000 * 8?
offset returns in ms
8 is hours
GMT + 8
which is that same time
well, now 30 minutes after i ran that command
Huh I thought u wanna get the local system and compare it to UTC
like i said, i have a target UTC
and then i gotta match local based on target
im generating the target fine as you can see
the issue comes with getting when that target is at 00:00 and then converting it to local time
so i can run cron jobs
everytime target is at 00:00
Ah ok ur target in on UTC
its a Date, yes
And local has get the offset
could get UTC or GMT
Well speaking about timezones it would be GMT
I still didn’t get why u would add 8 hours to the local time
I mean 60000 is correct, minutes to milli secs
May I actually didn’t read careful enough what u wrote 
fake rn
Shhh... just wanna make sure UTC is not a timezone. I’m not the police lel
Anyway gonna get some sleep
how can i find a user by their username with fetch in discord.js?
You can't. fetch only supports IDs
welp
so the only way to find a user by their username is with client.users.cache.get()?
(await client.users.fetch()).find((u) => u.username === 'username')
if you need to fetch
otherwise use .find on .users.cache
Ok but you won't be able to fetch all without the proper privileged intents so that's usually out of the question "just for finding a single user"
so enable it.
how can i in python get whats only after a /?
spoken like a true tiny bot owner without a verified bot 😂
is it really that bad
i wont be needing it
i havent made any public bots in a while
python =
python for ifs ==
js ===
my pp =======================
1, verification needs time
2, if you already verified, you need to dm suport to get you intents that are priviledged. also takes time
You can't enable them on verified bots without a good unique feature
1, verification needs time
2, if you already verified, you need to dm suport to get you intents that are priviledged. also takes time
@opal plank mine was fairly fast
i still cannot fathom that they verified my bot within 3 days
they did mine in less than 24 hrs
To give me the intent I need
The current intents request queue is over 2 weeks
so you cant just say i need to fetch all users in a server so i can search by username
or nickname
The current intents request queue is over 2 weeks
@umbral zealot na
not even evie
i got a response in like a day
3 days
No no, privileged intents queue
again
ye
i got response for intents in a day
that's interesting. because it still says it's way over 4-5 business days
you guys are shpechial
thats probably an estimate or super luck
wait. no you already had a request before this
they asked for more info, clearly
no?
EVie
just straight up approved
weird
And then
They responded
Asking for the exact same stuff
Then I waited 2 days
and finally got a response
Now I am waiting again
Oh, you're still waiting
Yeah
so it's not done then
Which means... that's what takes (last I heard) about 13-17 days
i just checked, my verification was sent at 6/11/2020
today 9/11/2020
https://cdn.discordapp.com/attachments/655288842433200129/775535505063411743/unknown.png
3 days basically
no middle steps either, just filled everything in the portal
That is a verification request, not an intents request
Bot verification is not the same queue
which includes intents
we were talking about adding intents to an existing verified bots.
Great, now that we've established that two people that said "adding intents is super fast" were not, in fact, adding intents (or don't have them already), I'm still confirming that if you have an existing bot, that is currently verified, the process to add missing privileged intents is still, in fact, about 2 weeks, due to a very large request queue.

is it possible to do stars
i also preemptively requested for message_content intents in the request, im amazed i didnt get any laughs from that
ok
***Do this***
in JS, you have to double-backslash because the backslash itself is an escape character in JS
So like
\\\*\etc...
bruh
Wtf
****\
um
Ur method doesn’t even work with typing
*****\
And that works great
it really does
Wait it is lmao
you have 4 stars there
there ya go
yes. Except you're missing a * at the end
because that's, y'know, what you're escaping. the asterisk 😛
yep, that is the asterisk.
******
discord.js.
how can i know which emoji was used in a messageReactionAdd ? the name is shown as '?'. I need to do something only if a certain emoji of the form ':emoji:' was used. How can i check for that?
uh
msg.author.send(`**\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\***\n> Byte Memory Usage: ${process.memoryUsage().heapUsed}\n> Bot Uptime:\n> Seconds: [${Math.floor(bot.uptime/1000)}]\n> Minutes: [${Math.floor(bot.uptime/1000/60)}]\n> Hours: [${Math.floor(bot.uptime/1000/60/60)}]\n> Days: [${Math.floor(bot.uptime/1000/60/60/24)}]**\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\*\\***`);```
is there a way to do like repeated string patterns
because uh
just look above
loops
you can also use string.repeat()
does anyone know why on_ready take so long to fire?
d.py btw
my on_ready function is run after an hour
so I'm looking into using Heroku as a bot host/data management, so I'm wondering if Heroku Postgres or Redis would be better for me, I'm looking for a place to store data for users which can be quickly accessed and changed
of startup
and sorry i use discordjs
like a currency system
anyway thanks
?
the intents thing
How can I help?
how do we fix this again?
@dusky mason
Give deets
what library are you using
Lang, and all the shit
py
Ok that’s my area
here's code
What code?
"here's code"
well of the intents
kekw
discord.js.
how can i know which emoji was used in a messageReactionAdd ? the name is shown as '?'. I need to do something only if a certain emoji of the form ':emoji:' was used. How can i check for that?
so it's not fixable?
HOW DOC U GET MEMBERE?!
Your activity can’t be the servers member count
Not how it works
How did u get the members?!!!!!
discord. Intents. all()
yeah
i think it's that one
The members var doesn’t exist
it worked perfectly fine
5 minutes ago
but the problem was the on_ready took 1 hour
What did u change?
Ehh imma go sleep
i am still on 1.2 hehehe
It's individual files that combine to make a single bot
can someone tell me why
my bot randomly spews this
im editing a message
and it says this right after the edit
here is the code
message = await ctx.send('`Beginning Downloader...`') await ctx.send(message) await asyncio.sleep(.7) embed = discord.Embed(title="Click To Go To Downloader", url=f'{url}', timestamp=ctx.message.created_at, color=0x2F3136) embed.set_footer(text=f"Requested by {ctx.author}", icon_url=ctx.author.avatar_url) await message.edit(content='', embed=embed)
mb im a fucking idiot
i added
that stupid await ctx.send again


Is it possible to create these type of messages?
no
@rocky hearth just use dms
Hmmm, but that feature would be cool. If they let us to use.
If you really know photo editing or whatever it is using py or js. Then it's possible
what would photo editing have to do with anything
how do i remove the 8ball in the question section thingy below THE 8-BALL HAS SPOKEN
@hazy sparrow https://stackoverflow.com/help/how-to-ask
nice, no code given, and your question makes no sense
ok so what i want is that in the description it says "question: 8ball test test test test test" but i want it to say "question: test test test test test"
hi
i am following this tutorial https://www.youtube.com/watch?v=j_sD9udZnCk
Code your own Discord bot! Coding a discord bot isn't hard at all! with a couple of simple lines you can get a bot up and running on your server. Make sure to stay tuned for upcoming discord coding tutorials. Discord.js makes it very easy to code your own bot without having to...
but i can't seem to do: npm install Discord.js
ok so what i want is that in the description it says "question: 8ball test test test test test" but i want it to say "question: test test test test test"
@hazy sparrow heres the code https://pastebin.com/ubRCkDeC
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.
how do i remove the 8ball in the question section thingy below THE 8-BALL HAS SPOKEN
@hazy sparrow splice it out from args OR substring message.content
@earnest phoenix can you stop flooding chat with embeds
ok
@earnest phoenix go to the command promt of your bot folder and type npm i discord.js
but i can't seem to do: npm install Discord.js
@earnest phoenix you have to run it in the terminal NOT in your javascript code
also discord.js should be lowercase
args is an array?
no
then do the second method
substring out 8ball
ik ik i ran in the folder with cd "foldername" i also checked for a firewall... @earnest phoenix
i didnt understand that 
message.content.substring ("whatever part you want to remove".length);
ik ik i ran in the folder with cd "foldername" i also checked for a firewall... @earnest phoenix
@earnest phoenix can you screenshot the errors in the terminal
sure...
i will
ohhh... i'm running on a vpn smh
well thanks @earnest phoenix
hey can someone help in discordbot development? I can't find the "Server Welcome" function ; when someone adds our bot, it should send message: Thanks for adding me in your server...
lmao send the screenshot here
hey can someone help in discordbot development? I can't find the "Server Welcome" function ; when someone adds our bot, it should send message: Thanks for adding me in your server...
@open obsidian there is no definete function for that you have to build it yourself
@open obsidian there is no definete function for that you have to build it yourself
@earnest phoenix ok thanks
join both of them then compare the strings
so array.join("")?
arr1.join("") == arr2.join("")
so array.join("")?
@silver lintelwhat is ternary doing hereyes
or loop through the arrays and compare elements one-by-one
okay thanks, and how would i compare strings like [1, 2, 3] and [1, 3, 2], to see if they have the same things but not in the same order
or loop through the arrays and compare elements one-by-one
@sonic lodge that's possible but that'll take a fucking long time to do
ig
okay thanks, and how would i compare strings like [1, 2, 3] and [1, 3, 2], to see if they have the same things but not in the same order
@silver lintel sort both those strings using the same sorter
then compare
*actually reject the joining part just sort the arrays
arr1.sort () === arr2.sort ()
dbl.hasVoted(message.author.id).then(a => {
if(!a){
return message.channel.send(`Hey, it seems like you have not voted me from the past 12 hours, this command is limited to voters only`)
}
})
message.channel.send("some message")``` why does it send both message?
the second send() is outside the function
thanks
peace out boys gtg attend online class
@earnest phoenix now it says "I test test test test test" instead of "8ball test test test test test"
what's going on here
const args = message.content.slice(prefix.length).slice("ball").trim().split(" ").join(" ");
that .slice("ball") does nothing
bruh
yeah i made it to .substring("8ball".length)
i meant this:
let question = message.content.substring("bow 8ball".length);
whats empty character? /200b?
whats empty character? /200b?
@silver lintel \u200b with the backslash
also it's called zero width space not empty character
well what i made works too
@hazy sparrow no it does not
hello, i have a verified bot, and how do i change this to the number of servers?
how?
check out the docs https://top.gg/api/docs
Hi
Hello
Hello
at Array.forEach (<anonymous>)
at C:\Users\Administrator\Desktop\CalypsoBot-develop\src\Client.js:121:13
Help Me
this.logger.info(`${files.length} event(s) found...`);
files.forEach(f => {
@sonic lodge @silver lintel Help Pls
"path": "/channels/774041136934551584/messages",
"code": 50035,
"httpStatus": 400,
"stack": "DiscordAPIError: Invalid Form Body
embed.image.url: Not a well formed URL.
at RequestHandler.execute (C:\Users\Administrator\Desktop\CalypsoBot-develop
ode_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (node:internal/process/task_queues:93:5)"
}
2020-11-09 22:54:21 - error [app.js]: Invalid Form Body
embed.image.url: Not a well formed URL.
{
"name": "DiscordAPIError",
"method": "post",
"path": "/channels/774041136934551584/messages",
"code": 50035,
"httpStatus": 400,
"stack": "DiscordAPIError: Invalid Form Body
embed.image.url: Not a well formed URL.
at RequestHandler.execute (C:\Users\Administrator\Desktop\CalypsoBot-develop
ode_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (node:internal/process/task_queues:93:5)"
}
2020-11-09 22:54:35 - debug [app.js]: [WS => Shard 0] [HeartbeatTimer] Sending a heartbeat.
2020-11-09 22:54:35 - debug [app.js]: [WS => Shard 0] Heartbeat acknowledged, latency of 119ms.
2020-11-09 22:54:51 - error [app.js]: Invalid Form Body
embed.image.url: Not a well formed URL.
{
"name": "DiscordAPIError",
"method": "post",
"path": "/channels/774041136934551584/messages",
"code": 50035,
"httpStatus": 400,
"stack": "DiscordAPIError: Invalid Form Body
embed.image.url: Not a well formed URL.
at RequestHandler.execute (C:\Users\Administrator\Desktop\CalypsoBot-develop
ode_modules\discord.js\src\rest\RequestHandler.js:170:25)
at processTicksAndRejections (node:internal/process/task_queues:93:5)"
}
Add
hello
@earnest phoenix you described your problem very badly can you explain it better
And why are you sending discord.js's source code
Can someone please help me regarding gif's? I want to set the embed image of my bot but it's not displaying the image
Can someone please help me regarding gif's? I want to set the embed image of my bot but it's not displaying the image
@sick fable embed image of bot wdym?
I want the bot to send embeds and I want that image into the bot
But it's not showing it
It's a gif
so get the image from a link embed then set it as bot avatar?
@earnest phoenix you won't understand it. I have a test server with only two members where I test my bot commands before releasing it. Maybe join it and I'll let you know. I am confused lol
No don't join lemme send ss
ads 
See
The image isn't showing
I want it to show the gif from tenor or Giphy or Imgur
send the embed code here
and how you are fetching it from tenor or giphy or imgur
@earnest phoenix ok iam stop
@earnest phoenix how i can get another whit out heroku?
read the pins
and how you are fetching it from tenor or giphy or imgur
@earnest phoenix I am just copying the link of those gif's
And pasted it in the embed code
send the embed code then
how can i get a link for the avatar of a user with a gif?
is there like a npm package for that
in discord.js btw
you don't need an extra package for that lol
you can use user.displayAvatarURL({ dynamic: true })
client.on('guildMemberUpdate', (oldMember, newMember) => {
if (newMember.guild.id == "724602779053719693") {
console.log("a");
require('./expirePremium.js')(client, oldMember, newMember, fact);
}
});
this isn't emitting for some reason. I also tested console logging outside of the if statement, but nothing ever got logged even on a guildMemberUpdate.
There are no errors, it just doesn't get emitted.
It does not have the guild members intent, but that's a privileged intent which I do not have access to.
although, I do get guildMemberRemove and guildBanAdd
Guys i have a question, is google cloud or amazon web services good for bot hosting?
i can say microsoft azure also
do you guys have an idea about these?
oh wait actually I guess I don't get guildMemberRemove
well then, time to contact support I guess
yeah
Hey, a small question: I bet some of you are also using pm2 to daemonize their discord bot written with discord.js. Is there a way to create an error log that shows only exploiting errors, not exceptions?
console.log(channel);
if(channel.type==="category" && channel.type==="voice"){
return;
}else{
console.log(channel)
channel.createWebhook('test')
}
})``` i am getting the error ``channel.createWebhook is not a function`` . Can someone help me figure this out
you should change it to just if (channel.type !== "text") return;
@ivory seal voice channels
oh
bruh that if statement's condition is wrong
You can't create webhooks for categories
Or voice channels
ye its supposed to be if(channel.type != "text")return;
also you don't need an else on an if that has a return
the function will end anyways
Guys, what should be the minimum features of the server I will use for the discord bot
Can someone help me please
There are no requirements to invite a bot.
Some bots probably need permissions to handle stuff but this has nothing to do with the server in general.
All you need to do is make sure your bot follows everything in #502193464054644737 and #rules-and-info
Bet we’re both wrong and he meant something completely different 
Nah it’s fine
anyone know, how to call var interval?
i need to clearInterval when embed tes2 appear.
https://sourceb.in/Vzf80lqKsC
Can’t open that link
But u declare the interval first and clear it after.
let timer = setInterval... clearInterval( timer );
@boreal iron
client.on('message', async message => {
if (message.channel.id !== '741602504881602561') return
for (let embed of message.embeds) {
if (message.embeds[0].description.includes("tes")) {
\\ so something
var i = 20;
var interval = setInterval (function () {
i = i - 2;
if (i == 0) {
// do something
}
if (i > 1 && i < 5) {
// do something
}
if (i > 4 && i < 11 ) {
// do something
}
if (i > 10) {
// do something
}
}, 2000);
}
if (message.embeds[0].description.includes("tes2")) {
clearInterval(interval)
}
}
})
Im not going send my script because I feel this could just be resolved with advice
But how do I fix this
It’s not live
If u type a dm it sends u the message
I don’t want it to stack like that
I want it to reset so <60 seconds,minutes
can someone help me to make ship command but in canvas i want to look like this ?
and <hours
Wait would I do like for seconds
seconds = uptime() / 1000 / Math.clamp(uptime() /1000 /60)
that might work ?
hey i need help
i made ban and mute command
but idk how to make tempban and tempmute command, help ms pls
I don't understand the error keeps getting Error: (Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions)
btw can i detect my member who vote the server?
I don't understand the error keeps getting Error: (Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions)
@gentle oxide missing permission, set to administrator for test, thats works or no
is this even possible kekw
how i can do that?
anyFunction({
{ },{ },{ }
})```
result:
```[
{ }, { }, { }
]```
🥺
I don't understand the error keeps getting Error: (Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions)
Help me pls
@gentle oxide you don't have permissions to execute that
Yooo help?
How do I write red text in top.gg bot description
@woven burrow CSS
try doing <p style="color: red;">text</p>
Oki
how i can do that?
anyFunction({
{ },{ },{ }
})```
result:
```[
{ }, { }, { }
]```
help? 
wat do you want?
do u want ur function to return that?
@summer acorn No that's totally illegal
@gentle oxide you don't have permissions to execute that
@earnest phoenix
Why
guild role permissions
how to fix error 429 (too many request) from yt api?
Anyone good with VMWare ESXi?
Getting the following error from CIM module.
sfcb-vmware_raw[74006]: IpmiIfcSelGetInfo: IPMI_CMD_GET_SEL_INFO cc=0xc1
Seems to happen with the daemon restarting for SFCBD-watchdog
how i can do that?
anyFunction({ { },{ },{ } })``` result: ```[ { }, { }, { } ]``` help? 
@earnest phoenix The first one you showed is incorrect syntax
Or you just want to get the properties?
yes
Object.entries(<object>)
@earnest phoenix you can
oops wrong virgil
sorry
@earnest phoenix yes you can
as long as u have all the dependencies i dont see why not
Why tho seems a bit strange running your bot multiple times
Error: (Command raised an exception: TypeError: not all arguments converted during string formatting)
I have idea to allow my code to allow owners can change avatar and name of bot then i need more tokens for each server
@earnest phoenix just let them self host, your computer wont survive much
or is it not open source?
why do i assume every thing is open source
@gentle oxide can you send the code that causes the error, please?
Just to change the avatar
@zealous sable apparently
first of all, that could be considered api abuse
@gentle oxide can you send the code that causes the error, please?
I send it to you private
second of all, dont dream of ur bot ever getting verified
Send it here
Hello, can anyone assist me in creating webhooks? I need to create one and i'm pretty beginner at this. I need it for the top.gg webhook
You are talking about if a user wants to change the avatar they need to add a whole new bot
@gentle oxide it's better if you send it here so multiple people can try to help
does the avatar really matter that much?
I have a bot hosted at Pebblehost, and I have no idea how I can make webhook for my bot there to receive from top.gg
i just made my bot open for anyone to modify and host it instead of running 300 bots at once
Ok
i cant see anything
Vergil you know that you wont be able to list the bot, you wont be able to verify the bot etc
Uh.. I think a screenshot or copy-paste would be better? 😂
Is that the code that causes the error you sent?
How many server are you planning on using this in tho.. say you had 10k servers all wanting a custom avatar
Thats not gonna be possible to manage
hmm should i profit from my bot
i told my self i would enevr do that
its tempting
Personally, I just added a donate command so people who want to help can send a little tip
but how would you manage that vergil
10k servers wanted a custom avatar you would need to create 10k different bots?
Which idk if thats even possible on discord dev website
help me
@gentle oxide what error does it show
If people want to get paid for their work, I guess it's fine. But I wouldn't expect a lot unless it's a really cool and unique bot
One command pog.
i will always keep my bot foss
How are you making, inviting and managing for example 500 bots on one command when each one is a DIFFERENT bot
^^
when I execute the command with the bot with permission 0 on a server I get this error
Error: (Command raised an exception: TypeError: not all arguments converted during string formatting)
@gentle oxide
This was the error that his code raised, supposedly
I don't understand the error keeps getting Error: (Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions)
Or not?
@gentle oxide the bot doesnt have perms
I don't understand the error keeps getting Error: (Command raised an exception: Forbidden: 403 Forbidden (error code: 50013): Missing Permissions)
@gentle oxide that means ur bot doesnt have proper perms
You dont just add tokens tho
One bot can only login once
onm the same host code or whatever you wanna call it
Yeah, that means your bot doesn't have permissions to send messages in the text channel you're trying to use it in
Anyone can help me how I can set up webhook top.gg integration? I can't use Discord webhook on it
its a self hosted webhook or something @tiny bough
@worthy pine yes that's my question, like is there a package that easily creates a self hosted webhook sort of in discord js
Ohh yea, but my problem with that is it asks for discord bot token,
@gentle oxide that means ur bot doesnt have proper perms
@steep socket
And how do I put the permission because with the other commands if it works for me I do not understand why it does not work with this one
but i plan to use the webhook for my server
just add the permiossions in the dev page and re invite the bot
@tiny bough you dont need the token for the webhook
ohh
@tiny bough so you want to make a webhook using a bot to send message through it? or no?
i need a webhook that will receive whether a user has voted within 12hrs
so i can reward sort of
but if the bot when they add it here to this server they put it with permissions 0 they will get the error
Also, it doesn't help when you ask your question you ask it everywhere.
I your question was answered in api aswell.
the bot had administrator permission etc and they have denied me because it did not recognize that command
Noel, bots arent added here anymore
ohh so the DBL is like a password that is optional am i corec?
The dbltoken is for the top.gg rest api
For stuff like getting the last 1000 votes
Or post server count
Noel, bots arent added here anymore
@zealous sable
as they are not added to this server if I am registered in top.gg
Yes no bots are added here anymore, you can still add your bot to the website top.gg but they are not added to this discord
They are still tested tho
ok so i have this code:
const DBL = require('dblapi.js');
const dbl = new DBL('', { webhookPort: 5000, webhookAuth: 'password' });
dbl.webhook.on('ready', hook => {
console.log(Webhook running at http://${hook.hostname}:${hook.port}${hook.path});
});
So you need to check for permissions and send an error message if the user donest have them
is that what i input here?
Input the correct ip
0.0 etc isnt the IP
0.0.0.0 is a placeholder for the proper ip
@tiny bough where is your code hosted?
at pebblehost
Do they give you an ip address?
Pebble host show you the IP you can use for DNS etc
thats the one you can use instead of the placeholder
ohh wait in this code:
const DBL = require('dblapi.js');
const dbl = new DBL('', { webhookPort: 5000, webhookAuth: 'password' });
where do i put the IP
i'm really lost in dbl
And dont forget the authorization password
oh ok ok i'll try that first thanks!
const entry1 = await guild .fetchAuditLogs({ type: "MEMBER_KICK_ADD" })
Why this code is don't work?? In v12
Yes
Discord?
Yes
Which
Discord.js
Lmao
How to color text in html coding
Using css
H
have anyone used oh-my-zsh??
Like this?
how do i check if a json value is null using aiohttp
;-;
nvm
an nsfw subreddits to test my bot filter? nothing too bad pls
the bot filter works
well kinda
it throws an exception when there is nsfw content
but i got the intended result lmao
yes
shh
for some reason it only says key error data when its nsfw
so i am confusion
¯_(ツ)_/¯
is there a way to activate google safe search from the url?
have anyone used
oh-my-zsh??
@rocky hearth ye its great
Ooh, how can I make it to not show the directory path
I only want to show the root folder, I'm working on
oh ok
i thikn this can help
the theme doesnt change anything dw
just add this to ur theme file
prompt_dir() {
prompt_segment blue black '%c'
}```
change blue black to anything
Hey
What is the use of shards?
Discord only allows 2500 guilds per bot connection
hello
Shards are the way to get more processes and connections
I had a question
How can I setup shards?
is it ok to shard at like 250 guilds?
Depends on your bots library
djs
d.js
You can shard at any point. But sharding before you need it is pointless
And uses more ram
oh okay
Djs has a built in sharder you can look at the guide for more info on it
Okay thanks
Each shard is an entire bot process
So at minimum default sharding will increase your ram usage at what your bot uses at idle.
is there a way to activate google safe search from the url?
1 shard = 2500 guild
like can i do for example google.com/search?q=something&filter=strict
idk google
My Bot is only on 200 servers, but since I heard about it I wanted to know what it was
somebody knows an nice api for canvas?
canvacord?
is for discord.js?
Canvas is pretty good on its own.
well thanks!
is for discord.js?
@halcyon linden you can use it with any lib thats js
Ok
@steep socket emojis
wdym? like where
like
for bot and
for admin
yah i will experement with it
alright


