#development
1 messages · Page 1760 of 1
still not working 
i know a few people here who use it to have it serving 5000 Guilds with no issues
yeah i dont think i need to switch because my bot doesnt depend on a database
A detailed explanation can be found on https://www.sqlite.org/whentouse.html
i just want it for warnings time mute custom prefix and thats about it
if you want to run the Bot on Mutiple machines then you want a other database, but for having it running its just fine
multiple machines as in?
having shards split across mutiple servers
ohhhhhh
but this is something that will not happen this fast
yeah i wouldnt know anything about shards i only have 17 servers
25k+ servers is no joke
Sqlite is very much fine even for large scale projects, but the major drawback (or not) is its IO scalability
Like, for reading it's unbeatable
also for the temp mute stuff, i can recommend using redis for it. Redis offers some nice fatures for this, you can set a TTL for keys in the database, and when a TTL for a key runs out you can listen to a event -> unmuting since the event can also contain the userid
But it can only have one write operation on it at a time
redis is a database
oh so anyone can use it?
usually it requires that you host a server, but there are free servers for it
i only see javascript with it so im not really sure lmao
Just go postgres
its just a recomendation, nothing you need to do
Since you're used to sqlite
So much love you for your pp
postgres is nice
for your pp 😳
tf

used MongoDB for a while before this ive used mysql, now its the turn for Postgres
what am i supposed to do if the await ctx.send isnot working but no errors are shown
mongo i refuse to use as this might be my db for a while and mongo has a limit to how much you can use before you have to pay a good bit for it
make sure it executes
lol just self host it
not saying my bot is going to be used a lot thats prob just not true LMAO but just in case
Are you logging errors?
man this is my first db id rather just use sqlite3 and then work from there
no
i tried mongo and just decided not to use it
Then I recommend you start there.
whatever floats your boat
MongoDB is nice for easy and fast scaling, its really easy to shard
If you're using the command framework, you can override on_command_error from your bot instance to handle errors.
i dont plan on using sqlite3 forever but for now to gain an understanding
ill use it since only 17 servers
What theme are you using
when ive started i where also using sqlite
oh its synthwave '84
i like that theme
then switched to Mysql bcs i knew about it already
SynthWave looks nice except for the glow feature
it is pretty nice
i like the glow feature
i like it tbh
anyways
I find it distracting
thanks it looks nice and the popping out is better for me cause im color blind : )
there are no errors
showing up
at all
everythin else is working perfectly fine
but once it gets to await ctx.send
it stops
oh
i see
add a breakpoint to it and inspect. also try to run your stuff inside the debugger
helps a lot with debugging
i am
with sqlite3 do i need a build path or is that optional?
@thorny arch did you try out the solution I proposed?
logging errors?
yes
i dk how to do that
are you using the command framework
try to send the stuff with the values commented out
sounds weird i know, but happened to me more than once
u mean this?
hmm ayt
You're using it in that case.
uhuh
yo that shit worked
seems its a formatting issue
Doesn't %s expect a string and .hours() return a number
It converts to string
ah
then why isnt it working
Do you have on_command_error event somewhere
And if we ignore your command?
nothing
Do you have an on_command_error event?
bot runs as normal
Can you show your code?
ayt
@client.command()
async def mine(ctx):
print('yeet')
cnx, cursor = make_connection()
query1 = "SELECT botcoins , cpu_level , gpu_level , cooldown_timer_end FROM economy_data WHERE user_id = %s"
cursor.execute(query1,(ctx.author.id,))
results = cursor.fetchone()
available_botcoins = results[0]
cpu_level = results[1]
gpu_level = results[2]
timer_end = datetime.datetime.strptime(results[3], '%Y-%m-%d %H:%M:%S')
print('yeet1')
if datetime.datetime.now() >= timer_end:
print('yeet2')
earned_botcoins = randint(1,3)
stat_boost = 1 + (0.2 * cpu_level) + (0.2 * gpu_level)
total_earned_botcoins = earned_botcoins * stat_boost
total_botcoins = total_earned_botcoins + available_botcoins
new_time = datetime.datetime.now() + datetime.timedelta(hours = 12)
query2 = "UPDATE economy_data SET botcoins = %s , cooldown_timer_end = %s WHERE user_id = %s"
cursor.execute(query2,(total_botcoins,new_time.strftime('%Y-%m-%d %H:%M:%S'),ctx.author.id))
cnx.commit()
cnx.close()
print('yeet2.5')
await ctx.send('%d botcoins™ have been added to your account' % total_earned_botcoins)
print('yeet3')
else:
print('yeet4')
timeleft = timer_end - datetime.datetime.now()
print('yeet4.5')
await ctx.send('wait for %s hours and %s minutes, kiddo ' % (timeleft.hours(),timeleft.minutes()))
print('yeet5')
@slender thistle
Could you show your full code?
The error is being suppressed from somewhere
Right
Correct guess
You don't have an else handling any other error than CommandOnCooldown
no
What do you mean "no"
You overwrite the default error handler with yours, which only does something meaningful for CommandOnCooldown
https://github.com/shivaco/Mari-bot/blob/master/main.py#L76 ideally, this is what you would want
still no error
ayt
Check for permissions before doing whatever you're doing
Try to put an else branch in your on_command_error that prints the exception
ayt
Check permission, if they don't have it, then post message. Thats just a simple if(){ } ** and ** else { } statement
Here is one based on roles, which should only be used if you're going for a role based permission setup.
embed: {
"color": 0xff4248,
"author": {
"name": "You do not have the correct permissions",
"icon_url": "https://whatever.com/erroricon.png"
}
}
})```
^^ Javascript (Discord.JS V12)
And I believe, if you want to do it from role permissions (Set via discord role manager), you'd do if(!message.member.hasPermission(["BAN_MEMBERS"])){ send message }.
Make sure to have the ! tho, otherwise, if they have the permission, it'd be posting the error message, and if they don't have the permission, they be able to use the command. ! with the if statement basically means, "if they don't have", so you're looking for "if they don't have ban members permission"
about my little thing, i, somehow, managed to create a flexbox..wasn't that hard tbh .-.
show your code
client.on('guildMemberAdd', async member => {
const channel = await client.channels.cache.get(x => x.id == "798293306278281277")
channel.send(new discord.MessageEmbed()
.setColor("#33FF86")
there is a title and other things ofc but its kinda more than 2k 
Flexboxes are love
The channel wasn't found.
And you don't need to await that
and in fact
.get doesn't take a function
Just a value (the ID)
true (you are too 😳 )
i tried find to and without await and async
didn't work
same problem
your current implementation will always fail
Anyone know why I'm getting this error in VSC after I did npm init -y? String does not match the pattern of "^(?:@[a-z0-9-*~][a-z0-9-*._~]*/)?[a-z0-9-~][a-z0-9-._~]*$".. Here is my package.json file:
So instead of
await client.channels.cache.get(x => x.id == "798293306278281277")
You write:
client.channels.cache.get(...)
Where ... is the ID as a string.
The notable differences is the lack of await and not passing in a function.
You can't have capitals in the package name
tried that to
Oh
same problem
Interesting. If you log client.channels.cache, do you see a large collection of channels?
Hi, I would have a little question, there is no error in the infrastructure where I connect my discord bot, but my bot is not active, how can I fix this error, I will be glad if you help.
It may be visible to your client.
Do you happen to know why the bot is offline? Is the project for your bot failing to start?
@hearty palm just because it's logically visible doesn't mean it's actually visible. Like I said, please log the collection
No I don't know why you're offline, and yes my bot isn't starting

If I had to guess Naru, you may be missing intents
Yeah, there are usually 3 reasons for a bot not starting
1 - wrong/missing token
2 - wrong/missing intents
3 - failing to compile
1 code error
2 ratelimit
3 some weird shit
There can be numerous reasons for a bot not starting, but given the current information, it's difficult to diagnose the source of it.
I understood thank you
did anyone else here read that as BotCompressionProject
c o m p r e s s
dose any one know how to make multi server / command
use webhooks to send the stuff around. its not that easy to do tbh
1 other thing
the idea -> store the channels where you want to relay/recive from, if a message is send create a webhook in the stored channels that contain the message you want to relay
my bot says it needs perms but i gave it perms but it dont work
did you have it the correct perms?
also make sure there are no channel overwrites conflicting
yes
did you check that the bot got the permission before executing something needing the permission?
uh apparently vsc is unsupported? no idea what that means
unsupported?
helo
discord.js: Does guildMemberUpdate get emitted when a user finishes member screening?
Could someone help me with this error? Im not sure why its not working. The same line is also couple line under it but that one is working
.channel is null.
.channel is non-nullable, so you should check what the value of message is
Find where you're calling .run and what input you're giving
how do i import a db again? wasnt it from ..db import db?
oh wait nvm i can just do from lib import db
so i imported my db from the lib folder however apparently lib.db has no execute even though i set it up
maybe i imported wrong though
How the absolute fuck does one specify current class as return type via typing annotations
That's actually a very cool library
Very declarative as well
It really is. Found it by random Google searching
also how does pypi not have syntax highlighting for code blocks
I'm not sure honestly
Well, actually, it seems that it just doesn't support Python REPL
Unfortunately :(
hi guys
how could i console.log value from:
[ { value: '429334867923173377', type: 6, name: 'user' } ]
?
arr[0].value
GRANT ALL PRIVILEGES ON 'typing_gamedb'.* TO 'typing_game' @'%';
It says im doing something wrong? anything obvious?
Does anyone know of a semi-accurate formula to estimate image file size? I'm currently using width*height*bit depth to find the size, but my formula comes out to about 47 MB for a 1080p 24-bit image, which I feel is inaccurate.
I'll use canvas to generate an image of that resolution and bit depth to test if it's accurate
Have you found anything helpful on Google, Waffle?
Yeah, I got that formula from google but it just doesn't seem right
i've checked for the attach files permissions and all of these log as true even though it does not have the attach_files permission. i've also tried sending a file and it throws a permission error
show how you're sending the file
it works with the attach files permission
but i need those to log as false
cause its actually disabled
Is it possibly disabled per role instead of per-channel?
I got 1 MB
Oh no, have I managed to mess up basic math again...
1920*1080*24 = 8294400 bit
8294400 / 8 = 1036800 byte
1036800 / 1024 = 1012.5 KB
1012.5 / 1000 / 1.0125 MB
1920 * 1080 *24 is 49.7 million bits
I forgot to divide by 8, which explains my absurd file size estimation though
It should come out to about 6MB for a 1080p 24-bit image it looks like
Which seems about right
Good luck 
does anyone have any familiarity with the error "Command raised an exception: AttributeError: module 'lib.db' has no attribute 'execute'"
It means you tried doing .execute on a module.
lib.db in this case.
You probably want an instance of your database or whatever
well i am using a db.execute for my change prefix command but maybe
what if i didnt import the database properly
i done from lib import db and it showed no errors and popped up just fine
i tried doing from ..db import db but i could probably get away with from . import db like in my other files
unless thats wrong too...
"discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.changeprefix' raised an error: ImportError: cannot import name 'db' from 'cogs' (unknown location)"
hmmm...
sounds like you're having state issues across files
ah
well maybe im doing it wrong then but every other file is from . import db and it doesnt raise any issues
Hi, i was coming here in the hopes anyone knows how to use steam's api for looking at game stats.....docs havent been to helpful
Why would you need to see if a message contains an embed?
Users cant post them (not without modifications to client)
hey why it says i pushed in my terminal
try and get an embed (from a bot for example) and then console.log it and see what you get
but when i go to the repo
it says i didnt push
does anyone know why?
it doesnt show my latest commit
give it some time
message.embeds is an array
Does anyone know how to get the /commands to wait for your bot to return? I have some code that runs, and it seems like Discord just gives up before it's finished pulling information.
message.embeds?.length > 0
Does djs have audio recieve functionality?
with dpy im using sqlite3 for my database I have a BUILD_PATH and a DB_PATH
with the DB_PATH does it need to be my database file?
i have it as database.db but i think i need it to be my file name
check if they are a bot first 
im like 10% sure that users can send links that get embeded and are included there
with a dpy database if i reference a database.db folder in my DB_PATH do i need the folder made?
One message removed from a suspended account.
One message removed from a suspended account.
I’d recommend if you’re doing link filtering to do some domains
As users who are smart will just take out http or https
How do I change the djs client to use my extended class instead of the default?
Example: channel class?
Check embed types...
hi
@bitter lantern
Can I make a limit for what a user can put in a number input in HTML, or would I need some sort of js logic for that?
<label for="bitDepth">Bit Depth</label>
<input type="number" id="bitDepth" min="1" oninput="calcSize()" max="32"><br><br>
``` I have this but it doesn't prevent the user from typing in higher or lower numbers than the range.
Hi
Doesn't seem to prevent submission on PC for me
Not sure why
I could probably use some sort of regex but... 🤮
Test this
Filter it on the backend side or use js then
Alright
Hi, i was coming here in the hopes anyone knows how to use steam's api for looking at game stats.....docs havent been to helpful
can anyone help me with this.
I tried installing sqlite on vscode
but I got this
I wouldn't recommend npm installing through vscode since it does some whacky stuff with file permissions
remove the node_modules directory then npm install through the standard terminal
i mean im using sqlite3 and i was wondering if i use a DB_PATH to database.db does the file need to exist and be filled?
yes. It won't create the file for you
a basic schema also needs to be loaded
There are some good tools to help you create a database file and/or modify a database schema or manage rows
well I'm not sure where to fill it up and I don't know any tools that could help with that
How am I able to get into bot development? I have no previous experience/knowledge and want to learn.
learn the basics of your chosen language
then you can make a simple bot
then learn the standards and smarter ways to do things
and go on from there
Just try building something. If you get stuck, Google it before asking here.
Once you are done, try building it again after learning better ways of doing things ;)
Thank you
Check if https:// is in the message
Um how can I dm dylan who reviewed my bot? I had some stuffs to tell him
just by dming him?
not really you can corrupt files with it.
it doesn't lock the file, just writing to the file asynchronously
just use sqlite lol
Is anyone here familiar with BscScan?
just use a keyv, I've already said this before
when ive started making bots ive used enmap, but then switched to mysql then to MongoDB and now i try Postgres
whatever floats your boat
who can make invite tracker bot? 
im bad at coding 
there is no good or bad, just a different level of knowledge
just a different level of Googling skill
I have made one here https://github.com/ARISEChurch/discord-invite-roles
But it probably isn't what you want.
hi i keep getting this error
discord.errors.HTTPException: 429 Too Many Requests (error code: 0): You are being blocked from accessing our API temporarily due to exceeding our rate limits frequently. Please read our docs at https://discord.com/developers/docs/topics/rate-limits to prevent this moving forward.
all i do is use a few commands
and this shows up
this is my bot
@prime mist Dms
does anything look like it would instantly trigger that
You're being rate limited
i just used the search and help command like 4-6 times each
yeah but i didnt use that many commands
and my code is also fine i think
does anyone know why its happening so much
are you using repl to host your bot?
anyone answer my q in #topgg-api?
sowwy i don't do python
yea
thats the answer
use a proper host
if one bot gets ratelimited all do
oh wut
like?
they use shared ips
well
AWS, VULTR, DIG.OC, GCP, AZURE,
kk tks
google cloud has a free tier btw
btw one bot on all of repl, or on my profile?
no VPS in free tier (except 300$)
all bots that uses the same ip
google cloud offers an always free vps
its pretty limited tho
which one ?
never saw that
help me please
(node:15216) UnhandledPromiseRejectionWarning: AkairoError [NOT_IMPLEMENTED]: HelpCommand#exec has not been implemented```
no one?
if no one answers probably
hi
how long does it take generally for bots to get verified
ive heard it takes between 2-3 weeks
but it has been 25 days for me
lol
Hello
can i use this in the description bot page or no ?
<style>
.entity-header__image {
border-radius: 50% !important;
border: 3px solid gold;
animation: float 5s ease-in-out infinite;
}
@keyframes float {
0% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
50% {
box-shadow: 0 25px 15px 0px rgba(0, 0, 0, 0.2);
-webkit-transform: translatey(-30px);
transform: translatey(-30px);
}
100% {
box-shadow: 0 5px 15px 0px rgba(0, 0, 0, 0.6);
-webkit-transform: translatey(0px);
transform: translatey(0px);
}
}
.entity-wrapper {
width: 100%;
height: 100vh;
overflow: scroll;
overflow-x: hidden;
background: url('https://cdn.discordapp.com/attachments/776345413132877854/782660450205958174/753060-black-wallpaper.jpg');
background-repeat: no-repeat;
background-size: cover;
scrollbar-width: none;
}
.entity-wrapper::-webkit-scrollbar {
display: none;
}
body{
scrollbar-width: none;
}
body::-webkit-scrollbar {
display: none;
}
#menu {
background: transparent;
}
.entity-content__description {
background: transparent !important;
border: none;
}
.entity-content__divider {
display: none;
}
.entity-hint {
display: none;
}
blockquote {
background: linear-gradient(90deg, #363636 30%, #fff0 100%) !important;
}
</style>```
is here anyone, who knows firebase queries well. 🙂
I've a player field map in a document hving 2 keys, white and black which is an id
I want to get all documents which has an id equals to either of the keys.
players: { white: 'id1', black: 'id2' }
id == players.white || id == players.black
anyone have idea how I can find this with mongoose?
//database
{
a: {
b: 10
}
}
//Code
const data = await Datas.find({b: 10})
?????
is this possible?
or I have to do something else
ah nvm
Datas.find({'a.b': 10})
the last bot you added got approved, unless it happened during the time #logs where gone and the history wont show up
hey
i want my bot to change a users nickname when they types ~nickname
if message.content.startswith('~nickname'): nickname = 'name' await message.author.edit(nick=nickname)
its giving me errors :(
the error
it has
hmm i can't change the owners name but its not changing the members name either
ok
hmm any idea
@every1
lol
weird but you can enforce types and it makes your editor (with internal debugger) feels like an IDE
also how tf did you attach something to a class to make it aviable everywhere where you call the class in ts
i know i started to use ts a few days ago
i know
like import instead of require
and type annotations
and export something instead of modules.export()
oh wait no
i didnt mean on topgg
i was asking for discord verification
yea lol
no 3 weeks on discord
discord can be easy 6 weeks
+1
i sent the bot for verification 3 weeks ago
nope
ikr
long forsomeone who is impatient like me
lol
destroyed? you mean session invalidated?
client.on('invalidated', () => {
// you handle it
})
Client.destroy()
oh
the destroy method
can I check or something if the websocket connection is still there
but like I wanna do that without an event
I want to check if the client is destroyed without an event
client.destroy().then()
try that
wait nvm
there's no listener for that
destroy have callback
doesn't it
yeah
that's sad
client.destroy() = disconnect right
why dont you want to check the client without using events
because I want to check if its destroyed inside an if statement
and without events
/* index.ts */
export var disconnected;
client.on('disconnect', () => {
disconnected = true;
});
/* listener.ts */
import { disconnected } from 'index.ts'
if(disconnected) {
// what you wanna do
} else {
// what to do if not disconnected
}
how about that
ig
that's my way lol idk
Been a month here dude
oof
2 people i know got theirs verified exactly 3.5 weeks after applying
let db = JSON.parse(fs.readFileSync(`./server/${message.guild.id}.json`, "utf8"))
db["role"].push({ invitesNeeded: 1 ,
roleID: "12345689" }).write()
message.channel.send(`invites req: ${args[0]}\n Roleid ${args[1]}`)```
the error is already telling you, write is not a function
There's a lot of wrong stuff here
1 - A Json datavase
2 - You're creating a json file for each server, that's the worst possible thing you could do aside from using a json database
3 - If you're trying to write to the file, fs has a writeFileSync function which u can use
you use json database? what even is that
it’s a very small bot for 2 servers
i know h2 database, mysql, sqlite, mariadb, etc. but JSON database?
that... that's worse, I know it's a jole but damn
mh maybe
Are you just guessing
.push returns a number
to write to a file you use fs.writeFile or writeFileSync
guessing is fine, but try to read the docs, why would push return a file ref that u could use to call write on it
yes
if it's pushing to an array
mh
and also writefile has a callback
while writefilesync does not and is synchronous
it's just breaking down things by their name and what they're doing
you wouldn't expect new Cat(); to return a reference to a Car o object
you would expect push() to return the array that got pushed to but it returns a number instead 
OMG
i thought i got verified/rejected
it's just you pinging me...
sad
lol
How does one make a post request in golang
that... that's fair I guess
use the http package, it's under net/http
you can directly call http.Post
although it's pretty bare bones, I recommend reading the official examples in godoc
there are more advanced ways of doing it, but just using http.Post should be enough
replit moment: i used absolute imports and repl tried to install @components/buttons
how the absolute fuck do i stop the shitty packager
well
no idea
Ctrl-C?
my bot have a whois command that show all user info
can i add a feature in that command that also show badges of user??
let locatedString = S(stringResponse).between("<a href=\"", "</a>").s
what is this S().between().s thingy
just read the docs and added this to my .replit and it still tries to install it
language="nodejs"
run="npm run dev"
+ [packager]
+ ignoredPaths="src"
+ ignoredPackages=["@components/TabButton"]
SO THAT WAS A FUCKING LIE
how to deploy bot without PI writing like you have to code 3billion letters
for one comand
The amount of code you have to write usually has no relevance to where you're hosting the bot
What code are you talking about?
then hire somebody to make the bot for you
unless scratch ;-;
no but can you make bot without code writing
Yes
rly?
I have no idea if im allowed to say it, so I will put it in tags, ||discord bot maker on steam||
Hi
show code
in python?
then i know da wae
i made this:
here you have not only the instruments to detect links, but also see if they are rickrolls
hey
so i am checking for channel names:
const D = message.channel.name.toLowerCase() === 'miniboss-match1'
However, i am generatin a random string after the match1: miniboss-match1-f2fj28
How can i now check if the channel starts with miniboss-match1?
Is it gonna be: message.channel.name.toLowerCase().includes( 'miniboss-match1')?
love you evie

/^(http|https)\:\/\/[a-zA-Z0-9-]{2,63}.[a-zA-Z]{2,10}/ This should detect a normal url
but not
https://google.coooooooooooooooom.in
^°^
wdym ?
If someone add any bot then he/she will be kicked
No
you can't do that
if i make database tables in my main file with sqlite3 can those be used anywhere or should i declare the table within my command folder?
There's no way of knowing who added the bot.
Unless you own the bot which was added and you are using oauth2 in the Invite link
the most you can really do is a backdoor command but that requires like a guild id and some other stuff
its for getting a server invite link iirc
It can be accessed everywhere in the system if you have proper
Not my bot
I mean if someone added any bot in the guild
thanks akio ill give it a shot appreciate it bro
then you can't
thats a confusing question
Yes I guess
but there's a huge problem with that
which parser does github use for parsing gfm
gfm?
Error:
Failed to create a new invite. Please try again or contact website administrators.
their own? lol
what's the name
thank god it doesn't
How would I align these boxes?
Using HTML/CSS
<label for="widthRes">Width</label>
<input type="number" id="widthRes" min="1" oninput="calcSize()"><br><br>
<label for="heightRes">Height</label>
<input type="number" id="heightRes" min="1" oninput="calcSize()"><br><br>
<label for="bitDepth">Bit Depth</label>
<input type="number" id="bitDepth" oninput="calcSize()" min="1" max="32"><br><br>
use two divs
one for the text and one for the boxes
align text div to right and box div to left
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
.setDescription(`Hey ${message.author.username}, Sorry but for now bot has only 3 commands(`avatar`,`ping`,`invite`) ```
pls help me its not working i am learning pls help me **:(**
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
.setDescription(`Hey ${message.author.username}, Sorry but for now bot has only 3 commands(`avatar`,`ping`,`invite`) :sad_cry:
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
SyntaxError: missing ) after argument list
Hint: hit control+c anytime to enter REPL.
```
pls help me i'm learning i don't understand this
this is error
One message removed from a suspended account.
Oh great
This is what your string is interpreted as:
`Hey ${message.author.username}, Sorry but for now bot has only 3 commands(`
If you want to use the backtick in your template literal, you must escape them with a backslash (\`)
ohh thank you sir its work 🙂
http://google.com and https://google.com both are links, both send u to google.com
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
Search the world's information, including webpages, images, videos and more. Google has many special features to help you find exactly what you're looking for.
client.on("message", async bot => {
const user = await bot.guild.fetchAuditLogs({
type: 'BOT_ADD'
}).then(audit => audit.entries.first())
const entry = user.executor
const c = client.channels.cache.get("843784909235683371")
c.send("bot added! :- ")
})
Why its spamming
you're sending a message every time your bot sends a message
So what can I do?
...not send a message if it's from your bot?
I'll try
this possible with Djs?
pretty sure not
you cant fetch guilds your bot is not in
if it is in 🤔
then maybe you can do smth
i had invite and i need details like above is this possible with djs
and bot is in the server ^
oh
i thought it's not there and it's smh gettin details out of thin air
no no
pretty sure you need to loop through every single Invite in every single server
or scrape data from discord.gg
HUGE BRAIN
Doesn't seem like d.js supports it
However
Integrate your service with Discord — whether it's a bot or a game or whatever your wildest imagination can come up with.
client.on("message", async message => {
if(message.author.bot) return
const user = await message.guild.fetchAuditLogs({
type: 'BOT_ADD'
}).then(audit => audit.entries.first())
const entry = user.executor
const c = client.channels.cache.get("843784909235683371")
c.send("bot added! :- ")
})
Now its not sending any message
v9 when 😛
shivaco found the correct api endpoint
do it in onmemberjoin
i need the process 
Send a GET request with an Authorization header containing your bot's token
no
Process the received JSON
you dont need that
const resp = await fetch(`https://discord.com/api/v8/invites/${invite_code}`)
const data = await resp.json();
// process data
axios.get("https://discord.com/api/v8/invites/ygzpHhn92d").then(res => {console.log(res.data)});
axios cooler
axios cooler
fetch better
^
cooler >> better
wtf
I thought you were talking about read-writstream
in cpp
didn't knew it was a thing in js
client.on("guildMemberAdd", async message => {
const c = client.channels.cache.get("843784909235683371")
if(message.author.bot) return
const user = await message.guild.fetchAuditLogs({
type: 'BOT_ADD'
}).then(audit => audit.entries.first()).then(() => {
const entry = user.executor
c.send("bot added! :- ")
})
})
Error :- bot is not defined
I've got my own question
I want to align my divs like this using CSS:
/---------\ /-------------------\ /---------\
| 25% | | 50% | | 25% |
\---------/ \-------------------/ \---------/
I'm trying to use flexbox to do that but I never used it before so I'm stuck
||and yes i am using inline styles||
guildMemberAdd should trigger a member not message
float: left;
width: 25%;
like this ?
There's the option of doing justify-content: center and then increasing the width of the middle element
Have the center div with flex: 50% and the other divs with flex: 25%?
@earnest phoenix use
flex-basis:25%;
wots that
ok
that's enough coding for today, time to go play FRHD
ill leave yall to find what the heck that means
client.on("guildMemberAdd", async member => {
if(member.bot)return
const c = client.channels.cache.get("843784909235683371")
const user = await member.guild.fetchAuditLogs({
type: 'BOT_ADD'
}).then(audit => audit.entries.first())
const entry = user.executor
c.send("bot added! :- ", + entry.tag)
})
Its not sending me the bot inviter name
what does it send / show ?
Just
Bot added :-
...
- audit logs are slow
- aren't you returning if the member is a bot?
if(!member.bot){ return false }
so you would want it to work if the member is a bot
How?
Anyone has an example for a callable as argument? For the cooldown decorater?
if(!member.bot){ return false }
any capable linting program would scream about redundant !s
List item values of ModelType are required``` ayo anyone know why dis happening?
List item values of ModelType are required, meaning whatever that requires a list of ModelType values requires a list that consists of ModelType objects
what is ModelType anyways?
hmm?
What do you use 
i searched all my files
discord.js and im helping with an npm handler
for / commands
That doesn't look like a default js error or a discord.js error
most likely another lib
What are some features of a discord bot which won't require use of databases?
Replying to messages i suppose
everything
you don't need a database for anything
but at the same time
you need a database for everything
the design is entirely up to you
databases are like pants
you don't need them at all, it's just that...9 out of 10 times it'd be better to have one
i have no pants then
amog us
<?php
class ඩ
{
public bool $👌;
public bool $😡;
public int $💀;
public function __construct(bool $😈, int $💀 = 0, int $👨)
{
if($😈) $this->👌 = true;
$this->💀 = $💀;
$this->😊 = $👨;
if($this->👌) $this->🔪();
}
public function 🔪()
{
while($this->😊)
{
$this->💀++; $this->😊--;
echo "ඩ 🔪 😊 [{$this->💀}] 😇\n";
}
}
}
new ඩ(1, 0, 6);
?>
So my bot is d.js v 12 I always get these cache guides when the bot or the shard connects. How can I get this spam fixed
please rate @drifting shell
is that valid?
also isn't the ?> optional and recommended to omit if it's all php code
it's optional but still a good coding habit
same reason why JS wants you to use ; even though it can run without it
@slim heart you hear me
semicolons are love
semicolons are life
you're dead to me

How do you detect who deleted a message in D.js?
Ah I see.
you can still fetch it on message delete event
Wonder if it's worth.
imo i think you should check everything from the audit log and not every endpoint
but discord smooth brain
i believe luca does that and it fails sometimes (hence the "Moderator: ???")
there's shit audit logs actually log that the endpoints don't tell you
example is server changes
Discord really b like
plus having to define specific things for each endpoint to check to me
is a horribly inefficient method
it's good for accessibility and i like that but there's also a lot of endpoints to check LMAO
although i guess this is more of an API wrapper-related issue than the API itself
hey who can help me with this
pymongo.errors.ServerSelectionTimeoutError: kanjali-db-shard-00-01.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),kanjali-db-shard-00-00.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108),kanjali-db-shard-00-02.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108), Timeout: 30s, Topology Description: <TopologyDescription id: 60abef45383a0b0bfd1ee972, topology_type: ReplicaSetNoPrimary, servers: [<ServerDescription ('kanjali-db-shard-00-00.nl5eg.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('kanjali-db-shard-00-00.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('kanjali-db-shard-00-01.nl5eg.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('kanjali-db-shard-00-01.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>, <ServerDescription ('kanjali-db-shard-00-02.nl5eg.mongodb.net', 27017) server_type: Unknown, rtt: None, error=AutoReconnect('kanjali-db-shard-00-02.nl5eg.mongodb.net:27017: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:1108)')>]>
ehh whats happening?
did you just wtf?
your Ceritifcate for Authentification expired
or is wrong installed
one easy and quick fix would be disable SSL auth and use passwords. then make sure that only your Server can access the MongoDB server
Someone familiar with require
My Folder structure
->Functions
--->parser.js
->Commands
--->Owner
------>update.js //file where parser.js should get required
../../Functions/parser.js
../ -> One Folder Up
../../ -> 2 Folder Up
./ -> Same folder
thx
Hi guys, I would like to do a 'in command' cooldown cause a lot of people write the wrong syntax of the command, and with the cooldown in message.js it messes up.
How can I do a cooldown only for the command works?
you need to store the timestamp of previous executions
like, use executed the command at X time
he'll only be able to execute again after 10 seconds
so just check if current time is higher than X + 10000
i'm making my testing/making useless commands bot send a message every x amount of mins. how frequently should i make my bot send a message so that it doesn't abuse the discord api and ban me
You should not be doing things on a loop at all.
Well, I just host it locally for 5 mins every once in a while to annoy my friend or is that also considered under abuse of API
@smoky mica Discord does not have a well-defined duration for the time span between API requests. The current consensus is it should be "reasonable".
That isn't relevant at all, we're talking of the API itself.
My bad, i'm tired. I've edited the message, can you re-read it?
Evie says you shouldn't be sending API requests in a loop in general
Yeah basically there is no true safe zone. It's a sliding scale of possibility of being banned. So don't do it.
Oh, okay. Thanks 👍 😄
I think discord will eventually get more strict on the subject tbh.
Maybe one day they'll figure out how to do these things heuristically
with a map?
yep
and i also have this in the script tag: js function remove(id) { document.getElementById(id); } but i get an error saying document.getElementById is null, but if i log id it logs the role id
any ideas why?
remember to remove the entry after the time expires
there're also self-expiring map libs out there
document.getElementById() is html-related
You'd need to verify the command ahead of time. If the logic for parsing the command's input is stored in the command's run (not recommended), then you'll need to handle it there (e.g. calling a function to add it to the map)
so...what exactly are you trying to do with it?
i am trying to remove an element, a button by clicking on them
the id of the button is the role id btw
that sounds like a very bad way of doing that
well
i just double checked and apparently they arent, so im assuming u cant have a class and id on the same element?
you can
oh
you just can't have two buttons with the same id
you can create something like this:
set id to this "role-(roleid)"
lemme show u the html and whats actually being rendered
yes ik
<button class="modroles" id="<%- role.id %>" value="<%- role.id %>" onclick="remove("<%- role.id %>")">
``` and whats being rendered:
ok so, i got mixed up between 2 things but the id is being rendered btw, mb
wait wrong ss
mb for cluttering the channel
yeah, the ids are the issue
also, you don't need the value if it's the same as the id
so how would i fix it?
ah alr kk
ctx.globalCompositeOperation = "destination-in"; it merges with the square shape i drew before.
const logo = await loadImage(`${__dirname}/../assets/images/kart/spotify.png`);
ctx.fillStyle = colors;
ctx.fillRect(53, 48, 48, 48);
ctx.globalCompositeOperation = "destination-in";
ctx.drawImage(logo, 53, 48, 48, 48);
what should i do?
i just want to recolor the logo.
read that
has some helpful info regarding comp ops
what you want is basically hue
I'm trying to re-tool my bot so I can manage it via a GUI (for example, start/stop, logging, data and config editing). Is there a way I can set up my bot as a class that can be run in a mainloop on another script instead of dealing with bot.run()?
discord.py by the way
typically, youd run those on separate processes
as uwu said, you'd run 2 processes
one is the bot, and one being the dashboard
then estabilish a connection between the two (like REST requests or websocket)
the dashboard wouldn't manipulate the bot directly but make requests to it
i already know.
it merges with the section named ... top code.. i am asking how to avoid this problem
// ... top code
const logo = await loadImage(`${__dirname}/../assets/images/kart/spotify.png`);
ctx.fillStyle = colors;
ctx.fillRect(53, 48, 48, 48);
ctx.globalCompositeOperation = "destination-in";
ctx.drawImage(logo, 53, 48, 48, 48);
// ... bottom code
but what is the top code?
i want to recolor the spotify logo.
i can but the rectangle is deleted.
Do you know that she has the limit of chanel per guild?
she who?
you want the second image?
don't use destination-in, use hue btw
how
wait.
I don't really see the issue in your code, sorry
i am trying
oop
the child elements must have flex: 1
so each will have 1/3 of the space available
code: .partner-container { display: flex; justify-content: space-between; flex-direction: row; justify-content: center; -webkit-display: flex; width: 100%; overflow: hidden; } .partner-title-center, .partner-title-right { margin-left: 5%; } .partner-title-left, .partner-title-center, .partner-title-right { text-align: center; font-weight: bold; font-size: 22.5px; font-family: 'Inter'; color: white; background: #060A13; border-radius: 20px 20px 0px 0px; border: 3px solid #7289da; width: 75%; height: 100%; } .partner-desc-left { margin-left: 0%; } .partner-desc-center, .partner-desc-right { margin-left: 5%; } .partner-desc-left, .partner-desc-center, .partner-desc-right { text-align: center; font-weight: bold; font-size: 17.5px; font-family: 'Inter'; color: white; background: #060A13; border-radius: 0px 0px 10px 10px; border: 3px solid #072176; width: 1110px; padding: 10px; height: 100%; }
just send as a file bruh
sorry forgot some unrelated code
discord parses into a smaller embed
me dum sory
but anyway
what does that mean
^
Just set a max-width for the boxes = width your header boxes
I tried that, even with exact px values
didn't work
if there are 3 elements, each with flex: 1 they'll each get 33% of the space available
but how do I like add that to code
what is a child element lol
#development message - Any help here :
What do you mean by stop the spam?
If you don’t wanna send the messages then don’t do it. 
an element that's inside another
you do know basic html right?
i do, i just didn't know what children were
tiny drunk people. /s
"how to remove child from parent with fork"
@lyric mountain flex: 1; worked for the description things
but not for the titles
like this worked
you need to put both inside a div
then use align-items: stretch
do i need to apply flex: 1; to the container
yes
oh
wait, what container are you saying?
btw, that image looks quite fine for me
what's the issue with it?
this is the issue
.partner-container
<div class="partner-title-left">Test Server Title 1</div>
<div class="partner-title-center">Test Server Title 2</div>
<div class="partner-title-right">Test Server Title 3</div>
</div>
<div class="partner-container">
<div class="partner-desc-left">Test Server Desc 1</div>
<div class="partner-desc-center">Test Server Desc 2</div>
<div class="partner-desc-right">Test Server Desc 3</div>
</div>```
yeah, that's the one supposed to be flexed
pro tip: use F12
keep experimenting with element inspect
instead of doing it blindfolded
so i applied both flex: 1; and align-items: stretch; on the container and it still looks like htat
and this happened to the description
Hello, I was wondering if anyone could help me with a quite simple task,
var characters = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-=';
let result1 = characters[Math.floor(Math.random() * characters.length)]
```
That is the current code I have to display 1 letter out of **CHARECTERS**, but I would like it to display 6 letters making a "Code".
do a simple for loop that iterates 6 times
each time adding a character to a string
🤨 ......


