#development
1 messages ยท Page 1757 of 1
One message removed from a suspended account.
The embeds are pretty good, could include the data about the user and who kicked/banned them. The help commands could use some work, they are all in one line, could be used in an embed or use pagination. Otherwise pretty good :)
what?
ad?
oh my
Yea it is pretty bad, there is not a lot of design for it. I have never used one, but have seen them. They dont let you to fully explore what a Discord bot can do
should i add more statuses to my bot or more command
I mean, you can always learn, the best way to make a Discord bot is to use a programming language with a Wrapper for discord.
i need answer
"statuses"?
i want to add more statuses to my bot like in sounds world that sounddrout has a custom bot
I am not sure what apps are good for making Discord bots. Like I said I would use a wrapper for discord
I don't understand
The discord wrapper is for their api. Basically allows you to interact with Discord in your preferred programming language
ok so every 12 or 15 seconds there is a different status for my bot. and i want to add another status to go in the status rotation. i have 2 statuses to rotate in but i want more
Depends on the language you are going to use.
I believe that is against discord TOS
Use DSharpPlus then
You can install that from Nuget
Right click this
then you can just install whatever you would like from there
No you are all good :)
I believe that DSharpPlus is currently using .Net 5
lol
should i add more commands to my bot
which commands to add besides mute (i am adding mute to my bot's update 2)
ok
@earnest phoenix you will need this, it shows you how to get your bot off the ground https://dsharpplus.github.io/articles/basics/bot_account.html
Yea, if you get confused, about any of the code you should check out Tim Corey on youtube. He is pretty good and has some great tutorials for beginners and such
should i go ahead and release mute command/version 2
i might have screwed up the mute command but here is a sneak peek of my mute command on the bot
calm down bro
yes please, calm down
yes please
when we destructure an array or object, does it also create a new object instance in memory?
you can check this yourself by destruxturing a property and checking if the references equal
na I was meant for the braces used to destructure the object.
Like, const { piece } = square;, the braces used here, does that count as an new object instantiation?
nop
it's the same thing as declaring a variable, it just creates a so called "pointer"
hmmm kk
If you use typescript, you could mark the variable as read-only to ensure immutability.
If a user changes their avatar, Discord deletes it immediately from their servers right?
The avatar is deleted completely from the CDN yes
I have a command that collects avatar urls for a game and I'm wondering what the best way to put them into canvases is. Only problem is when people react, the game starts, during the game if someone changes their pfp the stored url is a 404 error.
I just didn't want to hit the api for each canvas
But I guess I have no choice but to fetch avatars each time...
Not rlly
Can you cache them?
If i remember correctly avtar updates should come under GUILD_MEMBER_UPDATES
As long as u fetch ur users from cache before u do any operation it should be fine
U dont need to do any extra requests
Yeah I fetch users from cache, make a map, pass the map to my game function and iterate through them 2 by 2 (it's a hunger games simulator). I think if someone changes their pfp after the game starts (after the map has been passed to the game function) it gives a 404 error. Does that make sense or not?
So you have no way of updating the url in real time?
No. It just makes a map using the data it gets from the cache at the beginning of the game
The problem arises when you have a big game with 70 participants. It leaves lots of time for people to change their pfps ๐
You could store the image in a blob on init?
like i said
everytime you decide to make a change
for example, update the image/canvas
fetch the user again from cache
Yeah I thought so. I wanted to avoid that but I guess there's no way around it.
Yeah
youre getting it from cache
if you were fetching them, that could be an issue with ratelimits and response times
I mean getting it from cache at the start of the game or during the game doesn't really make a difference
u said u were using canvas,right?
Yep
what you COULD do to not that what im suggesting is adding a listener on ur thing
const users = new Map();
const avatarChange = <client>.on('GUILD_MEMBER_UPDATE', (new, old) => {
if(new.displayAvatarURL() !== old.displayAvatarURL())
if(users.has(new.id)) // handle their change here
});
setTimeout(() => {
//ur code here
// users.get(user.id) // now updated if the event triggered
clearListener(avatarChange);
},timeout)
keep in mind this might cause "memory leaks" since you'd constantly creating and destroying listeners
you would, yes
it is much more dynamic
Waiting for Discord
this WOULD probably be ur most performant thing
technically you could create an event elsewhere so it doesnt emit as often
Would it be more performant? The other solution of just getting the avatar from cache upon canvas creation doesn't seem much worse.
const avatarChange = <client>.on('GUILD_MEMBER_UPDATE', (new, old) => {
if(new.displayAvatarURL() !== old.displayAvatarURL())
client.emit('Avatar_update', new.displayAvatarURL())
});```
this way you only listen to AVATAR_UPDATES (which as event created by u) instead of processing every update again on each command
Hmm
this would ensure you only do modifications as they come, rather than getting them from the cache for EVERY users, regardless if their avatars was changed
Yeah
but this also comes the cost of creating new emitters. so this you'd probably have to increase the maxEventListener
Which was kinda my point of only getting the avatar url once at the beginning of the game and attaching it to the map in the first place. I guess it's more efficient in that regard.
you could just reference ur libs object
How much memory does your server have? I would personally just cache them at that level. And at the client level of course.
And not bother with mid-game updates.
sotring base64 or blobs is also an option, but could e tricky with too many commands running at once
blobs and massive strings can affect performance quite a bit
i'd say the best solution would be referencing your libs cache user object
Well, can always write them to disk. That would perform reasonably well too
People have already run the command over 3k times in 3 weeks
not rlly, that'd be worse
reading/writing files is possibly the worst u can do in this scenario
for a hunger games?
yeah nah
Yeah no ๐ฌ
those can have up to 40 ish players per game
imagine for EVERY game started you'd be reading up to 40 users at once
files usually perform better than blobs tho
just use ur libs user object
I wonder how Spikeybot did it? ๐ค
Na, serving files over http is a highly optimised thing these days. Can just offload to ngjnx or something
since you can use file streams
indeed, but between a listener, referencing an object, and blobs, which is the worst?
depends, i still didnt get what hes trying to do lul
basically his issue is updating avatar urls
he gets 404's when a user changes their pfp
It's a hunger games simulator. Game gets avatar urls from cache upon start
I think I'll just get from cache upon canvas creation tbh
so my suggestions were to either reference the discord.js user obj which would change as updates come, or add a listener for when avatar changes are made and update his cache, then simply getting rid of the listener at the end
i mean
get the urls upon start
then every time the command is run, compare the urls
if there is any change, regen the canvas
I'd still be making a request anyway ๐คทโโ๏ธ why not just get from cache once on canvas creation in that case instead of getting them once at the start and getting them again on canvas?
Yep
message objects contain a full user object
as soon as you get a message from them, you get an updated profile url
without member update
wouldnt d.js update that?
yes
just use the user reference then like i said
But that relies on the person sending a message during the game right?
you said they have to anyway
There's only one command with a reaction signup
after that they arent required to type anything?
Nope
then i dont think that'll be the best solution
Just react to the original message to signup, then the game creator clicks another reaction to start the game
i still think my parsed emitter would be best, since it'd only trigger when needed rather than re-fetching cache everytime
Well, if you don't have member intents, and the URLs can 404 at any time, the only thing you can rely upon is cached binary data :)
when the game starts, generate the canvases, then keep the finished canvas in memory
thats also an option
Hmm I guess
that way you dont even need to waste cpu with redraws
But if the game has 70 participants that's 70 canvases to generate for one game
In one go
You would have to cache every participant, which is the only thing.
yes, but if you do it right it wont be that bad
i dont know how big your canvases are
500 x 300
but the general rule for canvas optimization is to split it into reusable parts and update only whats needed
I still stand by my cache at the server strategy haha. Then the client can lazily cache on demand.
Would getting the avatar from client cache on each canvas creation really be that bad?
you will get 404
How?
if you dont have the member update intent, and the user is not interacting
then the cache will have old urls
So basically without intents I'm screwed ๐
I've been waiting for 3 weeks to get a reply from Discord
your only option is either save the canvases so they keep using the old image
Yeah
or fetch the users again
Well, another option could be service workers? Is this in a browser?
isnt it for a discord bot?
It's a discord bot
Sweet, nevermind then
can you show an example of what your canvaes look like during tbe game?
If I'm only fetching 2 users every 15s it's not that bad right?
Sure 1 sec
Most discord clients will rate limit you request on your behalf, so you don't hit 429s
the fastest way to do image composition on canvas is to load an image from another canvas
so you can store mini canvases with each profile pic
and draw the mini canvas on top of the bigger canvas
Ok. But that will take up more ram I guess?
thats what html5 games do
every single reusable part is stored in a precalculated canvas
never from images or buffers
Not too much RAM, if you don't go overboard with image sizes.
Can I attach the pfp canvas objects to the map at the beginning of the game?
ye, canvas grows exponentially with image size
Yeah I keep sizes to a minimum
as long as you keep the images in the exact size they will end up with, it will be fine
sure
Oh so reusable canvas pfps can only be the dimensions of the pfp canvas? So the pfp emplacement dimensions must be the same on every canvas?
Because I have 3 types of canvas
And pfp dimensions aren't the same
when you place the image you can resize it to fit the target
Ok
so keep the canvas in the same size as the bigger one
So take the largest needed pfp dimensions and make the pfp canvas that size?
for example, if you have a 300x500 canvas, and the pfp inside tbmhis canvas is 200x200, save the pfp canvas as 200x200
Basically you're saying only scale it down not up?
you can scale it up as well, but as usual there will be some quality loss
Yep for sure. I do graphic design and I'm a bit of a perfectionist so no worry of that ๐
:)
good luck!
Thanks for your suggestions! ๐
@quartz kindle so when the user starts the game and the bot makes the map of participants to pass to the game function, can I add each user's canvas pfp object to their player.avatar property in the map? Or would you recommend making the canvases after the map generation at the beginning of the game function instead?
either way should be fine
How to add website preview in the bot description?
Embed an iframe
Ohk
I'm having some problems when I'm using the cooldown for my command based on discordjs.guide, but when I try to use that command, it doesn't have the cooldown
Guys
how do I use https://brainshop.ai/
this works fine here
but I get this
s h o w _ c o d e
LOL I thought you sent an embed
On nearly top of my code: ```js
Client.commands = new Discord.Collection()
In my message client:
```js
const { cooldowns } = Client
if(!cooldowns.has(command.name)) {
cooldowns.set(command.name, new Discord.Collection())
}
const current_time = Date.now()
const time_stamps = cooldowns.get(command.name)
const cooldown_amount = (command.cooldown) * 1000
if(time_stamps.has(message.author.id)) {
const expiration_time = time_stamps.get(message.author.id) + cooldown_amount
if(current_time < expiration_time) {
const time_left = (expiration_time - current_time) / 1000
return message.channel.send(`Please wait ${time_left.toFixed(1)} more second(s) to use ${command.name}`)
}
}
time_stamps.set(message.author.id, current_time)
setTimeout(() => time_stamps.delete(message.author.id), cooldown_amount)
sELfbOt 
this assumes you have a cooldown
remember that command.cooldown might be undefined
const cooldown_amount = (command.cooldown) * 1000 and this would turn into NaN
So... what should I do with these?
if(args[2] !== 'card' || args[2] !== 'cash') return message.reply(cashorcard)
for some reason even if args 2 is one of them its sending it
u didnt follow the guide prperly, look here
notice the ||
|| = OR in js
command.cooldown OR 3
ykw, just use detritus and all your problems will go away
we cant spoonfeed, what exactly you mean by "automatic vote command"?
and which language u using
does this thing efficiency?
Python and dpy. Basically if you vote and then run it, you get an amount of money in-game.
check the topic of #support
in the docs theres an example of webhook
you'd need to save users on a database(could be on memory if you dont mind losing everything after restarts) and check if the user voted
while you COULD just do a GET request to see if user has voted, it is recommended to use the webhooks and cache the users who have voted
so you dont spam topgg's api with requests checking if users have voted
whats the issue?
If you can't see the Problem, how can I ?
idkkk
the code works fine
arrays start at 0
for some reason even if args 2 is one of them its sending it
on ur screenshot
try console.log(args[2])
oh
im retarded
use &&
not ||
if args[2] IS different than card AND cash => return
any one? pls tell me?
It's still not args[2] though I believe...
args[0] is the mention, args[1] is card args[2] should be 10000, the question is HOW they are parsing their args
a!pay, @fresh cosmos, card
0, 1, 2
if they are doing it off content, that'd be different
is this issue with BrainShop?
i assume its not this at all
you forgot the mention
AND u put <1000> as a mention
for whatever reason

isn't mention parsed as <@USERID> ?
I gave an example saying 1000 is the id
a!play | @user | card | 1000 |
excluded | 0 | 1 | 2 |
this should be it
if they are using args based off content
assuming they are doing this
lol i am so dumb, ty idk why i didnt tried it

it still doesn't work at some point
here, let me give u a tool to debug that then
and add a breakpoint in the beggining of that code
that'll stop the code real time and show the values of each variable
so you can check why its not working
Thanks
console.log is still a superior debug tool
and 200 other stupid jokes you can tell yourself
same argument goes for anyone who uses notepad as their editor just cuz they never used vsc

no
yall need jesus
i need console.error
he died
breakpoints do everything console.log but without having to recompile and/or change code
let me show u something you plebs might not know
debuggers usually can't tell me well what the actual value of something is
e.g. a uuid
yeah I like to use that instead
grr
I don't understand why anyone would willingly use console.log over breakpoints provided that it doesn't fuck with your existing workflow
it hasn't helped me most of the time. sometimes it does
is it possible to stop people from changing default voice
wdym by "default voice"
kd bot
You may be looking for the support server of whatever bot
in order to understand what they're asking
THIS
so this
let me just finish rendering
this might be one long ass gif though
I had to resort to println for debugging webassembly in rust it was a nightmare
conditional breakpoints 

i keep telling them, but they wont listen
@sudden geyser@pale vessel@worn sonnet
look gif above
instead of completely changing ur code and adding that if() there
sometimes setting up the vscode settings is a pain in the ass and I rather just keep doing console.log than spend like a bunch of time setting that up but if I can already do breakpoints... why would I console.log
you can just add conditional breakpoints
or just breakpoints without conditions which will always trigger
Why was I summoned?
but most people just bitch about "oh, i cant debug with conditions"
Oh yes! Print statements ftw
yes
Well I hate breakpoints
Just my opinion
if its taste, fine, i wont argue about it
but saying console.log > breakpoints is plain dumb
you get all context of all variables real time
not only what you added the breakpoint on
in the example gif i even showed the message payload, the client, my own author
all that from adding a breakpoint on args
you cna acccess everything in that file
its not specifically for u
doing console.log multiple times and trying to figure out which printed line corresponds to what debugging statement

^^
that's usually not a problem
tho for some reason nextjs breaks for me when I leave the breakpoint running for too long
or hot-reloads
i usually avoid leaving breakpoints for too long, sentry can be really helpful with that
sentry? in development?
i learned not long ago you can capture a snapshot with a breakpoint
And that's that
rather than halt the whole code, capture as exception
and analyse it outside
i think sharon mentioned that to me a while back and i implemented it for a while
its basically a cheap way of getting a snapshot of current varibles without halting code execution
I mean I was just talking about a request hitting a breakpoint, pausing for like 30 minutes and then the server dying when I press resume again
so you can analyse context without having the code stopped
yeah, this is exactly what i was avoiding
specially for bots, it'll miss acks
and just reconnect
so having a snapshot of the current variables that you can check from the sentry site is handy
can debug it without the code being stopped
sounds like a lot of work tbh
using up sentry quota? can't relate
i may or may not have had a bad loop somewhere that ate everything up
Yeah i already know that but i dont know how to set the permissiona
Ok thank again shiv
Ok
What you probably want is all channels to have their Send Messages greyed out (meaning they'll be set to None rather than False or True) for all roles
It's difficult to lock channels for everyone since most servers implicitly grant all members Send Messages via roles
On lockdown command execution you create a PermissionOverwrite object with send_messages (probably add_reactions too) set to False and use channel.set_permissions where the target is the guild's default role (see Guild.default_role in the d.py docs)
To get all the roles do i do for loop
You can technically loop over guild.text_channels and then for each channel get its .overwrites attribute
and then change that
Aye
So I have a EJS file has contain this code
<div class="map-container">
<%- include ('./maps/world.ejs') -%>
</div>
It is a SVG file that saved as a .ejs file, so I can import it and do css stuff over it. For example path:hover and other stuff.
Question
I want to make when people click for example to USA then the map will be changed to usa map (usa.ejs).
so I tried something like this, but something is not working.
$(document).ready(() => {
loadWorldMap_Event();
});
function loadWorldMap_Event() {
const paths = $('path');
for (let path of paths) {
path.addEventListener('click', function (event) {
const name = event.target.getAttribute('name') || event.target.getAttribute('data-name') || event.target.getAttribute('class')
console.log(name)
if (name.toLowerCase() == "united states") {
const map_container = $('.map-container');
map_container.innerHTML = "<%- include ('./maps/usa.ejs') -%>"
console.log(map_container.innerHTML);
}
})
}
}
Please help me!
it came out like this
so any suggestions?
I have no clue now
:<
you have to render the template on the server side
or just use react and forget about shit ejs
so another url?
ig?
like /map?location=usa?
if your server renders the correct html for that url, sure
so i just have to make it redirect to another url
but you can't do that in the client. Something has to run and template that ejs file with html. You can't magically put ejs tags inside innerHTML and expect it to be templated
yeah ejs is by far the worst templating language out there but your problem isn't ejs bad you just don't understand how templating works
yeah, im kinda new with Express and Ejs
express has to get a template and replace it with variables and return an html. Outside of the server ejs means nothing it's just a random string like you're seeing in your browser
you probably need to copy paste the svg into your js file
:v
or render it directly on the server side
that would be 1000 lines
if it's just an svg can't you put it in your static file and request it as an image?
Then u have to rerender the page .In React it would work like charm,but in this case you have to use the normal dom
I am trying to make a dropdown menu with React setstate, but I am facing a problem as follows: When dropdown is active, other divs slide down.
what are the values of
flex //If RN
float
zIndex
??
are you using display: "none" or height: "0px" ?
are you manipulating using css on inline style object ?
hey can anybody help me create light black background like this? https://cdn.discordapp.com/attachments/833535109897650227/845122379860017227/Screenshot_2021-05-21-07-07-59-707_com.android.chrome.jpg
case 'play':
if(!args[1]) return message.channel.send("what song do you want me to play? name it.")
const DisTube = require("distube")
const music = args.join(" ");
bot.distube = new DisTube(bot, { searchSongs: false, emitNewSongOnly: true, });
bot.distube.on("playSong", (message, queue, song) => message.channel.send(
`Playing \`${song.name}\` - \`${song.formattedDuration}\`\nRequested by: ${song.user}`
))
bot.distube
.on("addSong", (message, queue, song) => message.channel.send(
`Added ${song.name} - \`${song.formattedDuration}\` to the queue by ${song.user}`
))
bot.distube.on("end", (message, song) =>
message.channel.send(`the song (${song.name}) is over`).then (
message.member.voice.channel.leave())
)
if (!message.member.voice.channel) return message.channel.send('You must be in a voice channel to use this command.');
bot.distube.play(message, music)
break;
i have this command and when ever a song ends i want the bot to leave the vc and stop playing, and for some reason the bot just picks a new song when the song is over
any idea?
pls ping me if u know..
i linked my css style sheet in my html file
<link rel = "stylesheet" href = "./index.css">
(the path is the right one im 100% sure)
and in my main index.js like this
app.get("/", (req, res) => {
res.status(200).sendFile(path.join(__dirname, ".", "pages", "index.html"))
})
but the css isnt working can someone help me?
src not href
also doesnt work
Wait hold on it is href, not src
Are you sure your CSS is in the specified directory?
you need to serve your assets through a static directory
do you have the image ?
yep
wdym
it's just rgb with an alpha value, rgba
opacity
my bot isn't getting ready, what do i do?
The bot will say ready on console if it will be online
Does it ever output "Server is online!" ?
Ya
And no actual error anywhere, even if you let it run a few minutes?
okay
As a sidenote... you shouldn't be using quick.db on repl.it, since your sqlite file is 100% public to everyone that knows your project name
Ok
and... that's, uhm, the case for every single one of your projects there btw ^_^
look for a different database. like MongoDB, firebase, Postgres, Mysql
there are chances that you can get a free Hosted database for one of these
Well, repl.it actually has a database feature you can use
which is pretty straightforward
doesnt they make moving away a bit annoying?
It could, yes, but data like this can be exported easily too
point is don't use sqlite on repl.it
or shivers json
pog json /s
Hey @earnest phoenix I've also taken the liberty of going through your other projects and getting the four public bot tokens to invalidate themselves. You're welcome.
Yes i know, I'm getting alot of message from discord
Like, really you should understand security a bit more before you start making bots on public hosts.
Only chad developers have 2000+ Json files named after IDs of different members
Just don't paste new tokens in files that aren't .env, yeah?
yes ok
is this on repl?
Didn't know that system worked that fast though. whew.
no no the tokens are posted on gist
Right but discord doesn't detect that on repl
Imma go change it
discord doesn't even check on discord servers
otherwise these 4 tokens would already have been invalidated - they weren't.
Discord is just magic
Doesn't check? lol.
idk I never tried for user tokens
Canary but this has been around for a while, I think? I thought it had reached stable
yeah it's definitely already invalidated
A good test to see if they actually "read" it would be to post a valid token on a private server, I guess
I really doubt that they invalidate it
I think they will
LET'S TRY
You called?

well they wont
I sent a token and seeing if they send a message ยฏ_(ใ)_/ยฏ
lol
I think I actually saw a regex somewhere
Json file scare me
why
no one sane uses json as a db
and there is me
Databases take around 10 min tops to setup
Dapper for C# is great
Anyone?
Donโt they have docs
the net docs kinda suck
await _client.SetActivityAsync(new Game("wheatley.tk", ActivityType.Playing));
Thanks mate
k
@commands.Cog.listener()
async def on_member_ban(self, guild, user):
with open('./jsons/toggle.json') as f:
data = json.load(f)
if data[str(guild.id)] == 'on':
with open('./jsons/Limits/banlimits.json', 'r') as f:
limits = json.load(f)
if str(guild.id) in limits:
limit = int(limits.get(str(guild.id)))
else:
limit = 1
with open('./jsons/whitelisted.json', 'r') as f:
whitelisted = json.load(f)
async for i in guild.audit_logs(limit=limit, after=datetime.datetime.now() - datetime.timedelta(minutes = 2), action=discord.AuditLogAction.ban):
if str(i.user.id) in whitelisted[str(guild.id)]:
return
else:
await guild.ban(i.user, reason="Anti-Nuke: Banning Members")
await guild.unban(i.target, reason="Anti-Nuke: Unbanning Members")
return
*limit = 3
but it tries to kick me after 1
no matter what limit i set
any errors?
is someone familiar with svelte
no errors
My bot isn't coming online and I don't know why
just limit is ingores
invalid token?
I've looked in my code but nothing looks wrong
whats ur error
maybe, let me check
ok
no fricking way
send ur code
There is no error, the code runs, but the bot doesn't come online
Too much
yes bro wwwwwwwwwwwww
if u turn it off and on too much
send me that shit
it wont work
i wanna see if ptb has it
one sec I gotta remake it
ok
you... make a bot
wwwwwwwwwwwwwwwwwwwwwwww.wwwwww.wwwwwwwwwwwwwwwwwwwwwwwwwww
and then get it approved on topgg
im saying how do uget role
put it on the site
/zephyros
u dont
i do
its not approved if you added it
ok
do any of u know how to fix limits though
for audit log actions
in py
just gonna leave it here: /(mfa\.[a-z0-9_-]{20,})|([a-z0-9_-]{23,28}\.[a-z0-9_-]{6,7}\.[a-z0-9_-]{27})/i
@sinful plover json ๐คข
[PostgreSQL] I have a media (M), media_titles (MT), and media_titles_translations (MTT) table. Each table has an id, created_at, and modified_at column.
In my media table, I have a non-null native_title_id which is a foreign key to the MTT table. The MTT table has a title_id column being a foreign key to the MT table. Finally, the table has a media_id column being a foreign key to the M table.
As a result, it has a cycle of M -> MTT -> MT -> M relationship.
Although this may seem weird, the issue I'm having is all of the foreign keys are non-null since they should always be present. However, I can't insert a new media as it requires a title translation which required a title which requires a media (which doesn't exist yet).
A solution is to make native_title_id nullable, but I'm wondering if anyone knows other solutions that allow me to keep all the fields non nullable.
Any placeholder or default value like empty string you can apply?
?
I could use a nil UUID, but that's a mask for a nullable field
and what reg is this again ?
im not sure but couldnt media title be a column in the media table?
wait that is legit ?
wwwwwwwwwwwwwwwwwwwwwwww.wwwwww.wwwwwwwwwwwwwwwwwwwwwwwwwww
@near stratus try it with your token to see 
omfg
No, because a media can have multiple titles but a title can only have one media.
The native title id column only exists because it's "special"
cool
NzYwMzYyODgzMDk5NjU2MjMz.X3K9Hg.Ljbj3LK7l_zILkuVUcpn-sQIhD4
this is it actually
Ima hack your bot rq
instant regret
yay
I cry
does that help?
how do i make it so the bot will show how much votes it has in the current month
like in an embed
i think what it is saying is that it you create the column so that you can insert stuff partially without an id while still in the transaction then populate the IDs as you go through the transaction then at the end of the transaction everything is as it should be
@sudden geyser https://vhiairrassary.com/engineer/2020-04-12-how-to-insert-with-circular-references-and-constraints-using-postgresql/ does this help?
hey
does anyone know how to show the votes that the bot has in the current month in a command
I'll read into that article, ty
iirc it needs to be a bigger resolution
Bruh
discord puts the opengraph image in the thumbnail if it isn't big enough for the image field of tbe embed
i dont remember the exact size though
google? how should I google it?
@placid iron bruh tell me 1 think
I make a bot and he is not approved so tell me the yime please
Xd
everytime you ask you need to wait an extra week
Ok
btw how I can set the size of image?
cause I think mine pic is already big
hmm
<meta name="twitter:card" content="summary_large_image">
ok
@vivid fulcrum still not working
work?
cause to me it is still small
add a cache buster to the url
the embed is cached
there
it isn't related to your cache
hmm
it's the cache on discords CDN servers
ahh
it's going to refresh in 30 minutes
so just resend the normal link in 30 minutes and it should work
ok, just learned a new thing. Thank you
Iโve noticed a few other server sharing bots have added commands where you can upvote or bump them directly from discord using their bot instead of having to sign in and up vote them on the site.
Would you be open to adding a command to your bot where members could type something like !upvote each day on their own servers in order to upvote their servers on your site?
wrong channel
can someone help
I can understand the adds but I feel their missing out on an accurate activity rating and it could benefit them in the long run to get a accurate reading so more people can judge server activity through their site
Which channel should this have gone in?
Hi, I have Raspberry PI, every time I change something in my project, I have to open Filezilla and copy all the files to the raspberry and then restart the process (node js).
Is there any syncing app that can sync all the files and the restart (after changes) the process?
nodemon
it can sync the files via SFTP?
๐
Iโve noticed with other bots our server upvotes 1,000+ times per day but with top.gg we only upvote 1-3 times per day and the only difference is the inconvenience of the method. If they were open to changing this I think they might see a dramatic increase in activity and then get more ad views when people check their site to see discords to join that have lots of up votes
I use github with webhooks to deploy and restart my pm2 process.
I use docker
I've been tempted to look into Docker
you can make an issue for this on github and maybe they will add that
how do i show the votes that the bot has in the current month in a command
its useful, network isolation etc
the github is good point, but how to get it to restart the process?
have a webhook that triggers on the push event
and that webhook just pulls the files and executes a command to restart the process
you can use pm2 for that
I'm young to know what are webhooks, wait a min I need to learn ๐
yeah Im already using pm2
There are good guides online
webhooks are just like bridges between devices
very simplified and short
lol
for example any device can send a request to a discord webhook to make that webhook send a message
sooo, if I push the changes to the repo, github will send a webhook to my raspberry with the informations so the raspi will pull the files and reload the process via pm2?
yea you can add workflows or like make a GitHub bot if you have time
I've got a new app for webhooks which makes it easier to forward them to discord, i made it open source and i want to try and get people to use it so i know if its worth investing in building more functions / better documentation for it etc
var args = message.content.slice(prefix.length).trim().split(/ +/g)
var args = args.slice(1).join(" ")
client.guilds.cache.get("845128693629976636").members.cache.each(m => m.send(args))
const logchannel = client.channels.cache.get("id")
logchannel.send('message sent to' + member.user.tag);```
error
```js
console.log('message sent to' + member.user.tag)
^
ReferenceError: member is not defined```
can someone help me
no its dm command i want log like if i use !dm hey bot send message to you and says message sent to @earnest phoenix (in console)
fixed it anyway thanks
yo i got a question
when i go to a certain endpoint on my site i get this error
and that is
the client side js is literally just: https://pastebin.com/JYMTT1kQ
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.
Try adding <!DOCTYPE html> and an <html>tags where appropriate?
How are you loading that code?
i dont even know how its getting there if im honest
this is the whole file
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.
its a bit of a mess but oh well
Says 404
?
Not an expert in frontend, but dont u need DocType HTML in the very top?
Oh, delta already pointed out
lemme make another one
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.
here u r my man
Yeah try to avoid sending burn after read pastes
How can I get who reacts and with what emoji? My code:
@account.command()
async def reset(ctx):
embedVar = discord.Embed(title=f"{ctx.author.name} are you sure?", description='Your Account is gonna get completly reseted!!', color= ctx.author.color)
msg = await ctx.send(embed=embedVar)
reactions = ['', '']
for emoji in reactions:
await msg.add_reaction(emoji)
Discord,py
no
even if i did
it'll just render as text
not as an element
its just somehow my 404 page has somehow found its way into the js
Maybe this will help you
^^ ... ^^
@mental raven in discord.js you can use msg.channel.awaitReactions() I assume there's something similar in discord.py I would recommend looking at the discord.py docs and checking the methods of the Channel class
Oh shit they added mobile highlights?
You're gonna want client.wait_for
The event is reaction_add
You will need to create a check function to confirm that the reaction is coming in the same channel (it's better if you replace this with checking the ID of the message the user reacted to) and from the same user who used the command
i cant find a reason on there that'll indicate what im doing wrong
im confused
ok
only for python
voltrex did make a pr for js syntax on mobile
and they did merge it
just no new build with that update
lol
they could have added js syntax for mobile like weeks ago already
a guild id
I would assume but I don't see where it's being set
If it's not defined the url could be incorrect, which could cause the error?
wym
?
Plz help me
do u know how to make ur bot even have a custom status
My Program is saying cannot find module "discord.js"
One message removed from a suspended account.
One message removed from a suspended account.
^^
One message removed from a suspended account.
uninstall sys32
One message removed from a suspended account.
Even discordjs is present package.json
One message removed from a suspended account.
One message removed from a suspended account.
then use npm i
to install everything thats on the package.json
Its not working
did you COPY your node_modules folder?
show the code
do you have package.json?
hmmm i would assume glitch would install the deps from the package.json and package.lock
the dep, yes, though its clearly not locally installed
those are 2 different things
that is marked as a dependency
doesnt mean its downloaded and installed
Yeah ofc
But even when I install discordjs
Its say successfully
But when I use node index.js
Its says unable to find module "discord.js"
since i've never used glitch, thats as much insight as i can give u
btw anyone know the answer to my issue?
which is?
uhhh
isnt it discord-js?
not its not
Its discord.js
same
who doesn't?
doesn't like.. seeing it or coding it
css 
it's easier than backend stuff
my mans living in a different world
bruh
it's more "art" less "logic" to me at least ;-;
๐คฉ
ah yes
how to make disable and enable command in discord.py
Are you using npm packages
and im not living in a different world.. i code a lot in both
o..k u didnt
client.remove_command i believe
aight but fr im lazy so i'll just ask yall.. how to know how old ur bot is, when u start it up
I had the same issue then I typed
npm i discord.js
like is there any birth date attribute..
no no i want to make a command
Make a command or enable and disable commands, im confused
if i write .disable test
then command will disable
and vise versa
ah then use client.remove_command('test')
that disables it
mhm
and if i want enable that command then ??
like .disable test and .enable test
any idea ?? what to do
use client.add_command
ok
using client.remove_command and add_command will remove it for the whole bot though
Lib?
good question
ah.. i just did discord.id
cuz i thinkin of making a birthday thingy
๐
@account.command()
async def reset(ctx):
embedVar = discord.Embed(title=f"{ctx.author.name} are you sure?", description='Your Account is gonna get completly reseted!!\nReply with `yes` or `no`', color= ctx.author.color)
embedVar1 = discord.Embed(title=f"Reseted Your Account!", color= ctx.author.color)
await ctx.send(embed=embedVar)
def check(m):
return m.content == 'yes' and m.channel == ctx.channel
msg = await client.wait_for('message', check=check)
await ctx.send(embed=embedVar1)
db.child(f'{ctx.author.id}').set({})
def check1(m):
return m.content == 'no' and m.channel == ctx.channel
msg = await client.wait_for('message', check1=check)
await ctx.send(embed=embedVar1)
How can I make it trigger for no and for yes?
or the content checks
so you'd have something like this
(content_condition_yes or content_condition_no) and channel_condition
I dont want it to do the same thing
well, you asked how to trigger for both yes and no
one way you could do it is just return the channel, if the message is yes, then delete, else dont delete
thats how i usually do it ยฏ_(ใ)_/ยฏ
https://i.callumdev.xyz/tuqmi.png
https://i.callumdev.xyz/d05ud.png
Why aint this working?
You accept both no and yes and then after the message is received, check the content
oh
msg = await client.wait_for('message', check=check)
if msg.content.lower() == "no":
# no
elif msg.content.lower() == "yes":
# yes
thx
also just an idea you might want to check the author too or else someone could say "yes" before youc could say no and delete your account
ikr
people of development
what the best way to scale image generation?
I don't think I have access to a supercomputer

i did
but either way
probably optimizing ur code
saving cache
and templates
thats as far as i can tell you
scaling tho?
well yeah, the more optimized ur code is, the less u have to scale
api and lambdas i guess?



