#development
1 messages Β· Page 1690 of 1
still tho, whats that related to this channel?
system reqs are just a formality, they are not necessarily true nor accurate
you have to actually test the game in a specific gpu model to see how it actually runs
im not saying you should pirate it before you buy it to test it, but yeah
theres a lot of videos on youtube of people testing games in various gpus

oh shit
i mean, in the end he'll buy it, probably

maybe
wait i thought xet was commenting about my recommendation to use pirated stuff
yes, haskell
if haskell haves a GC it's nono for me
regardless the best way to know if a game will run on your pc is to check videos of other people running the same game in the same specs as your pc
haskell good
how did you call the informations from the database?
also did you cache stuff?
and is the Web interface directly integrated into the bot?
looks like caching
did you cache the config somewhere?
bcs it looks like a caching issue
idk how its cached, mongodb should only have the keys in cache, and it doesnt looks like you have some other caching within your db call
unless your function for creating Guilds contains some caching
Hi. I have an sql file that is running since 30 minutes and 50 mbytes big. Is this normal?
messageobject.edit(newembed)
more context?
Depends, what are you storing?
i'm migrating my bot (500k rows) to another database
wdym by messageobject
you want to edit the embed that is already send right?
yes
How big was the old db?
then you have to use the message object not the embed builder
but i cant put messageobject
how did you get it?
wdym how did i get it
you have to define it somehow
and where does it reference to the message you want to edit?
150 mbytes
i made an setInterval
I mean... I guess it's normal, it's size hasn't reached the old db's
if its in the same command you could do```js
const embedmsg = message.channel.send(embed)
embedmsg.edit(newembed)
30min does sound slow tho
oo okay
if its seperate you have to fetch the message
It's still running. I thought amd epyc would be faster on 50MB sql code.
highly doubt the problem is cpu
automated database backups to a cloud storage are sexy https://i.s8s.app/EQoVFEW2
either your disks are slow or your query is inefficient
query is from mysqldump the old db
@lusty quest it says:
goalembed2.edit(goalembed3)
^
TypeError: goalembed2.edit is not a function
where did you get the goalembed2 from?
o
wtf cpu at 0.1
message.channel.send() returns a promise
Did the update change something about how classes are declared or used?
you gotta await that promise to get the actual message object
await the send
what is the update
The version update to v12.
no, a library cannot change language syntax
or you can do message.channel.send(embed).then(msg => msg.edit(embed2))
the class names have changed in v12 though
Then uh, is there a way to get it to spew out an error instead of silently crashing in js?
fixed. I was dumb. Changed > with < solved the problem, rerun took 2 seconds 
silently crashing?
if there's a syntax error, the code won't run in the first place
Indeed.
lmao
One of my classes that worked fine pre-update now causes the bot to just stop completely.
worked but now its spamming the embed
well you probably have it in a loop with no break condition
you put it in an interval lol
for some reason, after I run this code, the shard crashes https://pastebin.com/83SfpeEY and sentry isn't being very helpful, it isn't showing any errors
when I run it locally, it doesn't output any errors either, it just simply crashes the shard
Wait, it's suddenly working better. 
you are eating the errors
.catch(err => err)
thats why they are not showing
but those are only on the webhook sends
I don't have access to the logs
wat
π€
random_number = random.randint(int(amount) - (int(amount)*0.2), int(amount)*2)``` `non-integer arg 1 for randrange()`
so sentry is my only way to see the errors on the dedi
wait that shows up in sentry?
I see, I'll try it then
which is the standard way to get error logs
yes i did because i want that if the bot goes offline and then back online i wont need to do a command again
that it will just auto update the message every 3s
it shows the guilds number
if the bot goes offline and back online that 3 second interval will also stop lol
not if i will put it in not in a case?
wat
and what if i'll put it in the ready event then?
you can do that yes
yes okay but idk what to do
im lost
const goalembed = new Discord.MessageEmbed()
.setColor(bsc)
.setDescription(`Servers count:\`${bot.guilds.cache.size}\`\n Goal: 75`)
.setAuthor("last time updated:")
.setTimestamp()
const goalembed3 = new Discord.MessageEmbed()
.setColor(bsc)
.setDescription(`Servers count:\`${bot.guilds.cache.size}\`\n Goal: 75`)
.setAuthor("last time updated:")
.setTimestamp()
setInterval(() => {
const goalembed2 = await message.channel.send(goalembed)
goalembed2.edit(goalembed3)
}, 3000);
this is what i got @quartz kindle
and its non stop sending the embed
because you made it send every 3 seconds
and there is a cache
i want it to update it every x seconds, not resend it
then stop sending
just write back into the cache if you update stuff
so like
const goalembed2 = await message.channel.send(goalembed)
setInterval(() => {
goalembed2.edit(goalembed3)
}, 3000);
?
yes
but
message is not a thing in ready event
so i cant put const goalembed2 = await message.channel.send(goalembed)
@quartz kindle
no you cant
if you want to always update the same message
you need to save the id of the message somewhere
like a file or database
then fetch the message and continue editing it
I tried it locally since sentry didn't catch the console.errors
apparently it crashes here
console.error(8)
if (res.premium.enabled === true) {
while (res.time <= Date.now()) {
res.time+=res.timer;
collectionGuild[1]+=res.timer;
}
} else {
while (res.time <= Date.now()) {
res.time+=1000*60*60*24;
collectionGuild[1]+=1000*60*60*24;
}
}
console.error(9)
but that's weird, because it handled that just fine earlier
the 9 is never logged?
so you have an infinite loop
but like, it didn't loop infinitely in the past
I was wrong about where the code was stopping. >_>
I'm having trouble fetching a member from a guild.
.catching it isn't working either. (I'm not getting any errors, it just crashes)
I double checked that the guild is being properly fetched and the member id is correct (and a string). My syntax is the same as the example in the documentation so I have no clue.
Wait.
Maybe I'm just wrong about where it's stopping again somehow..?
If I try to log the member while fetching them it crashes earlier so I don't think I'm somehow making that mistake again.
definitely faster
why is hour *16
that some deep code there holy crap π
you want to get the timestamp for exactly 16 hours before now?
and I found out that equation didn't work
so like,
it happens a lot that for example the date stored may be like 20 days behind
because they kicked the bot then readded it
I then want to set the date back to after the current date, but still keeping the same time of the day
so like, if the date stored in the database is 22:34:33 for example
I want it to stay that way
so change 4pm 20 days ago to 4pm today
i see
yes its gonna be much faster with math
your code is not too far off, just needs a few tweaks
alright, now I'll need an equation that'll work since when I tested mine further, it didn't work very well
1 day = 86400000ms
timestamp % 86400000 = time of the day
then timestamp - (timestamp % 86400000) = 0 hours of current day
then do 0 hours of current day + time of the day
I see, I'ma test it out real quick
and finally add the check if the result is bigger or smaller than Date.now()
if its smaller, add plus 86400000
do it before the rendering step
let member = await guild.members.fetch(memberid);
ejs.render(ejs_file, {data: member})
or something similar
Is there anyway i could make an if statement that the chance for it to be true is 50/50
if(Math.random() > 0.5)
how does that work?
No, im using py
then look into the random number function in py
example:
random.random()
Return the next random floating point number in the range [0.0, 1.0).
it returns a random number between 0 and 1
so check if the number is bigger or smaller than 0.5
the chances of it being bigger or smaller than 0.5 are 50/50
i want to add nfsw command to my bot are there any nfsw command packages that are accepteble with top.gg
no, top.gg does not accept nsfw
you can add it in your bot, but you cannot say anything about it in your bot description
it has to be hidden
isnt it
zerotwo bot has nsfw commands right
Oook
dank memer has it in its description since it was there before the rule was enforced
according to a mod
Oooooo ic
Tim can you please not big numbers?

what language is that ?
looks like javascript
ejs?
but what are those <% i wonder
Embedded JavaScript
how do i make a status go after the other
forEach doesn't support async well, you might want to use a for loop instead and members.fetch() returns a promise so await that too
i tried to make a text scroller for the gameText ,
kinda works
but u cant overkill it with too many updates, API will reject it
@quartz kindle for some reason this gives 3235324864416 which is July 9th 2072, but then when I do it in Chrome console, it works as expected
this is it in the chrome console where it works as expected
scans images for known objects
guild is undefined
it might not be cached
side note, you're awaiting guilds.cache.get() which is redundant
sure the time settings are right on your system?
seems right π
alongside that, js doesn't use system time
@summer acorn whats that ?
Date.now() is milliseconds after epoch and it's in UTC
clock ?
where does the res object get the time attribute?
most operating systems use a rtp protocol to sync time, nowadays
if you've run this multiple times it seems like you would just keep adding to it
which could explain why it's now 2072
Lamb, I am not a new developer. I would've known it when I am looping my code.
so res.time is empty?
don't use forEach, use a for loop
alongside that
i'm just stepping through the code
forEach = bad in every possible scenario
actually, is there any reason to use it over normal loop?
why is that ?
concurrency
yes
i used a for loop to handle stuff with presence update and it slowed down my bot
forEach works fine in that situation
the difference between for and forEach is that forEach is basically a for that creates functions
like ```js
for(...) {
f = function() {
do something
}
f();
}
thats basically what forEach does
so you cannot affect the loop itself from inside a forEach
you can only affect the function
so you cannot break it, you cannot skip it, you cannot await it
@quartz kindle #development message
res.time = time
not += time
too lazy to search more sources tho
thx bud
you are using a for loop now, not a forEach
which means
a return will kill the entire loop
to skip a particular iteration in a for loop use continue instead
also since you're getting the guild from your bot, why not use guild.iconURL() and other methods for convenience
Do you guys know a good bot for reaction roles? Iβve been looking for one and I canβt seem to find a good one?
zyra maybe?
i havent tested many so i cant say, but im using yag
Alright cool! Thank you!
hi
i have discord bot
run with linux
Sound cutting
why?
I am using pm2 to run
cpu usage 17%
you're back using forEach, why?
#handle() {
^
SyntaxError: Unexpected token '('
at wrapSafe (internal/modules/cjs/loader.js:915:16)
at Module._compile (internal/modules/cjs/loader.js:963:27)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)
at Module.load (internal/modules/cjs/loader.js:863:32)
at Function.Module._load (internal/modules/cjs/loader.js:708:14)
at Module.require (internal/modules/cjs/loader.js:887:19)
at require (internal/modules/cjs/helpers.js:74:18)
at Object.<anonymous> (/home/runner/Flusic/node_modules/wio.db/index.js:1:18)
at Module._compile (internal/modules/cjs/loader.js:999:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10)```
help m eou
gt
need help
var printNumTwo;
for (var i = 0; i < 3; i++) {
if (i === 2) {
printNumTwo = function() {
return i;
};
}
}
console.log(printNumTwo());
How does this return 3, I don't understand.
cuz you made it say 3
What?
var printNumTwo;
for (var i = 0; i < 3; i++) {
if (i === 3) {
printNumTwo = function() {
return i;
};
}
}
console.log(printNumTwo());```
@feral aspen try that
Don't change, I'm just asking why it returns 3.
because you're using var i
I know let makes it return 2, but why when I use var, it returns 3?
it'll return the last value since var hoists
Ohhh
It's like 3, but doesn't do the loop since the condition is false?
.. and if I use let, it won't work either way since it's only for the main {}, right?
The var statement declares a function-scoped or
globally-scoped variable, optionally initializing it to a value.
π π π
The === 2 part works but the loop still keeps on going so it will still increment i since it's var
by the time the loop ends, i will be 3
use a for loop
forEach won't block and wait for your promises to resolve
forEach is also worse in performance by a margin
compared to for
help i need someone help
you're not understanding what i'm saying
i'm mid workout trying to explain this lmfao
forEach should be used only for side effects
things where you're not supposed to return anything
and even then
a for loop is preferred
migrate to a for loop
@vivid fulcrum can you help me
@vague yacht what node version are you on
jesus fucking christ that package is garbage
it's just a glorified json/yaml database
without any concurrency locks
use a proper database like sqlite
(quickdb if you're lazy)
ew
Just use postgres smh
and probably won't have in the future
yea not if they're using a json/yaml database
,
Can I Get help π
client.on('message', message => {
if (message.conetent === prefix + "deletet"){
if (!message.member.hasPermission('MANAGE_GUILD')) {
message.channel.send(`**βYou Dont Have Permission MANAGE_GUILDβ**`);
if(!message.channel.name.includes("ticket-")) return message.channel.send("**:x: | This is Not Ticket Channel**").then(msg => { msg.channel.delete()
}
})```
Why This Shit isnt Work ?
debug the shit
content*
message.conetent
ok π
Error: Could not locate the bindings file. Tried:
I am getting error I tried many solutions I could not do what can I do
You trying to install better-sqlite3?
its my node version
...you have your own node fork?
client.on('message', message => {
if (message.content === prefix + "deletet"){
if (!message.member.hasPermission('MANAGE_GUILD')) {
message.channel.send(`**βYou Dont Have Permission MANAGE_GUILDβ**`);
if(!message.channel.name.includes("ticket-")) return message.channel.send("**:x: | This is Not Ticket Channel**").then(msg => { msg.channel.delete()
}
})```
This Shit Still Not Working
bro
Waht ?
who did that
no just make a command handler
Not having a command handler is stinky
fr though
i sometimes just think of nice patterns in my head for js command handling... even though i've never written a js bot
and then you see if else
yandev would be proud

lMFAO
i Fix It Thx ._.
yes
but there I can't use await
sure you can
your framework should definitely support async rendering
i'm guessing you're using ejs
a google search yields this
you didn't even click on the link π
Does anyone know why sometimes I get the same command twice?
Please provide more details.
Is the command sending twice? Is it coming up twice?
when I send the command in discord sometimes it repeats
Like this
?avatar
AVATAR DE TOUMAsenpai
AVATAR DE TOUMAsenpai
Two times
Do you have two instances of your application running?
No
Ok
Wait a min
const Discord = require("discord.js");
module.exports = {
name: "avatar",
description: "Mostrar avatar de un usuario.",
aliases: ['a'],
category: 'Entretenimiento',
async execute(client, message, args) {
let member = message.mentions.users.first() || message.author;
let avatar = member.displayAvatarURL({ dynamic: true, size: 4096 });
const embed = new Discord.MessageEmbed()
.setTitle(`Avatar de **${member.username}**.`)
.setImage(avatar)
.setColor("RANDOM")
.setFooter(`Pedido por ${message.author.username}.`);
message.reply(embed);
}
};
does any other command repeat twice
Node .
is it via your code editor?
Yes
ok right here, click it and if it shows two node instances, then delete one terminal
I have the project in glitch
i.e. the bin icon
bruh
well if it's a node instance issue, I wouldn't know how to help
what file do you start
send the code for that
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]);
const reason = args.slice(1).join(" ")
punishments.findOne({ GuildID: message.guild.id, UserID: user.user.id}, async(err, data) => {
if(err) throw err;
if(data) {
let array = data.Punishments.map(
(v, i) =>
'**__Case ID:__** `' + `${v.CaseID}\n` + '`**Moderator**: ' + `<@${(v.Moderator)}>` + '\n**Date**: `' + v.Date + " EST`" + '\n**Reason**: `' + v.Reason + '`\n**Type:** `' + v.PunishType + '`'
)
let on = 0;
let content = "";
for (let v of array) {
on++;
if (on == 6) {
on = 0;
let abc = new Discord.MessageEmbed()
.setTitle(`${user.user.tag}'s Moderation History`)
.setDescription(
content
)
.setColor("BLUE")
.setFooter("Moderation Logs")
message.channel.send(abc)
} else {
content = content + v + "\n";
}
}
if(content !== "") {
let abc = new Discord.MessageEmbed()
.setTitle(`${user.user.tag}'s Moderation History`)
.setDescription(
content
)
.setColor("BLUE")
.setFooter("Moderation Logs")
message.channel.send(abc)
}
} else {
let noData = new Discord.MessageEmbed()
.setTitle(`${user.user.tag}'s Moderation History`)
.setColor("GREEN")
.setDescription(`This user has no moderation history so far!`)
.setFooter("Moderation Logs")
message.channel.send(noData)
}
})
}
}```
so basically this just makes it so it displays 6 cases at a time.
if a user has 12 cases, it'll split into two embeds, but it doesn't do that here, instead,
it sends it weirdly
one sec
it sends duplicates
it works fine for users who have like 6 cases only
yeah i presume so
(node:101) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body
embed.description: Must be 2048 or fewer in length.```
i get this error
but
i want it to split by 6 cases per embed
but it sends like 10
which causes the error
they aren't using any fields
flush your content
aka reset it to an empty string
Oh wait
when you hit 6 cases
yeah thats if certain conditions are met
first condition - if user has 6+ cases, split
that code is a mess
2nd condition less that 6 cases, send as one
Just redo the code
3rd condition - no cases, send embed
Or try to indent it properly
so looking at the issue, it sends one embed with 6 cases
and then sends the rest without a limit
i think its an issue with the first condition
Make a pagenation system show 6 in each page
//FIRST check if there aren't any cases, don't waste processing power
if(data.Punishments.length == 0)
{
//no cases embed here
return;
}
//this should be a const! this data does not mutate and doesn't have any reason to
const array = map(...);
let content = "";
for(let i = 0; i < array.length; i++) {
const _case = array[i];
if(i % 6 === 0) {
//we've hit 6 cases here, send the embed
//fliuh the content
content = "";
continue;
}
content += `\n${conjoin the case here idk format it however youd like}`;
}
follow this pseudo
what does fliuh mean
it isn't entirely correct though
you also need a condition to check if i + 1 is equal to the length of the array, if so, we've hit the end of the array, send the content
This will work, but if there is more then 6 cases it will show nothing
also this
i didn't want to provide all of the logic in the snippet
uh are you trying to break the embed into in 6?
I%6==0
7 cases i%6 is equal to 1 also 12%6 is 0 this wont work well as i said make a page system
Much better
i'm aware
6 cases per embed, yeah
lodash has a function for doing this
const pages = _.chunk(array, 6)
there's no point in not using lodash lol
especially when the js standard library is basically non existent
One message removed from a suspended account.
Just
(array, length) => Array.from({
length: Math.ceil(array.length / length)
}, (_, i) => array.slice(i * length, i * length + length))```

i wonder how much slower that is
what the hell
Please help me
did you read the error
yes but i dont know how i can write it into json file
which package are you trying to install
./constants
what's the url of it
are you trying to install something from your pc...?
I don't know π
./constants wouldnt even work-
i-
that isnt a package error
that means it cant find the file named constants
well not file, module
did you do
const something = require(./constants)
o
which means they either messed with node_modules or stopped/killed npm while it was installing something
guys guys guys
spaces or tabs
spaces
Spaces
One message removed from a suspended account.
One message removed from a suspended account.
Lmao
@sterile lantern @vivid fulcrum Thanks for help ! I repaired it
Spain
without the s
yes/yep lol
is there a way? yes
is it stupid? yes

If i was away from home id like the other devs from my bot to see what was wrong or how the bot is
there is a way but the idea you've proposed is entirely fucking stupid
@earnest phoenix right?
Yes
discord is not a place to log
No like if i away from home
I use it myself just because staff wanted to see it
the same staff wants to see on his bot
id like to see the issue and give a reason on why
ratelimits
β¨ sentry β¨
and pure stupidity
sentry was literally built for this
any good bot doesn't have an error every 0.6 seconds
buddy im not asking that im asking how to do it
WHY WOULD YOU DO IT
augh i had caps on
i mean if you're trying to use discord to log console its probably not a good bot 
no just error
I'm not trying to I have coded it
Staff wanted to see it he's asking for .js I use .py
use sentry
yea
dude im 14 i dont have but 500 bucks on my card
you can self host it
i dont want to pay for this
or use it for free
sentry has a free plan too lol
We use sentry would recommend
We didnβt until recently n we have almost 10k servers
we are not sane devs
are any devs sane
Facts
good point
there are two paths of developer insanity
incapable of social interaction
or
programming socks
Why not both
also a good point
If youβre not insane are you even a dev
One message removed from a suspended account.
sounds pretty similar
One message removed from a suspended account.
One message removed from a suspended account.
or are you
i love that moment of realization within the second of posting it
uh so i'm kinda desperate
hope someone can fix this issue
if(command == 'oxford'){
var definition = "default"
//get use requested word and null check
let userword = args.find(arg => arg.name.toLowerCase() == 'word').value;
if(!userword)return;
//use oxford dictionary to find JSON
let lookup = dict.find(userword);
lookup.then(function(res){
//stringify and parse data
let data=(JSON.stringify(res,null,4));
let object = JSON.parse(data);
//get definition from JSON object
definition = defenitionGET(object); // !!!!!defenition after the GET is defined!!!!!
//use function to call discord api and send reply (i'm assuming this is where it goes badly)
return sendreply4(client,interactie,definition);
},function(error) {
return console.error(error);
});
}
function
function sendreply4(client,interactie,data) {
client.api.interactions(interactie.id,interactie.token).callback.post(
{
data:{
type:4,
data: `${data}`
}
});
}
error
error DiscordAPIError: Invalid Form Body
data: Only dictionaries may be used in a ModelType
//
//some internals
//
method: 'post',
path: '/interactions/828774663244...,
code: 50035,
httpStatus: 400
and i have no idea
Hey sorry if this is the wrong place to ask, but, does anyone know of a good api / any good way to do an ascii command? I'm using Discord.js and I haven't really been able to find one 
what is an ascii command
oh
yeah
look for a figlet library for your language
yup
Hello
Took me a little bit but i got the ascii command to work, thanks 
Anyone available for a quick python question?
One message removed from a suspended account.
hello, I have a problem I would like to set a Thumbnail with an image retrieved with an url but the url does not work because it does not end in jpeg, png
...so give it a url that returns an image
the urls don't care about the extension
but whether the url returns a valid image or not
it only returns an image, I can send you a private example link if you want
can you send it here
works here
ah it must be an error in my code so, excuse me
how do i call a command function in dpy from a different file while using the ctx param?
to explain it, i have a webserver running in a cog
and i need to basically run commands
via the webserver api
and on some commands i need to pass ctx
Get the command using <Bot>.get_command. Since Command object implements __call__ method, you can call it directly. You can also run it using ctx.invoke
why not just abstract the logic from the command
Uhh, ctx is made up of a discord.Message, I don't think you can get one if it was from the webserver
i need the ctx
bc its for a music command
specifially stop
...so?
so it stops the ctx
player.queue.empty()
await player.teardown()```
how it works
it uses the ctx to get the player
I mean, you can make another method that does that without the need of ctx, and then make a command that calls that method
ye good idea
yeah I just re-word what cry said
You can also make a proxy object, see what get_player needs from the Context object, most likely just guild_id, then you can make an object that has that attribute and pass it there Β―_(γ)_/Β―
yeah the issue is dat it identifies the music player
via ctx
but ill try an alternative id method
thanks guys
2 low severity vulnerabilities
To address all issues, run:
npm audit fix
i've typed npm audit fix still there
fix available via `npm audit fix`
node_modules/minimist
optimist >=0.6.0
Depends on vulnerable versions of minimist
node_modules/optimist
npm audit fix does nothing
you can't upgrade because another dependency requires a vulnerable version of the dependency you're trying to upgrade
is there a way to know dependent packages?
it shows you right there
yes but i think i don't even use optimist
probable another dependency
looks like optimist isn't maintained anymore and isn't getting any updates https://github.com/substack/node-optimist/issues/152
https://www.npmjs.com/advisories/1179 Overview Versions of minimist prior to 1.2.3 are vulnerable to prototype pollution. Arguments are not properly sanitized, allowing an attacker to modify the pr...
that is a very old version of jsbeautify :)
wth
use rust asnd ur problems will go away 
i didn't even noice i have 2 of them installed
jsbeautify and js-beautify
i guess jsbeautify is vulnerable one because i still have the other one installed but the issues are gone
i was wondering why my editor didn't throw error after i uninstalled it until i realize this
oh just use prettier
Can anyone guide me how to leave my bot server's at once
You want to mass leave all servers your bot is in?
It'll likely be API abuse since you'd be sending a lot of requests in a short period of time, but it's quite easy to do.
You'd just need to iterate over all guilds your bot has and send an API request to leave the guild
is the url properly setup ?
inline variables correct and all that
400 is a bad request code
so i rekon something is missing
@snow urchin
sometimes (myself at least) i setup a console.log to see if the urls are properly done
before i send them down the pipes
just to be sure
might have missed something, ya know how it goes
im not a js/nodejs coder, but i assume the mechanics are the same if i would do it in my lang
Ok, I logged url, it is 100% correct
cleaned code so maybe we could see the issue more clearer
https://i.callumdev.pw/v285s.png
ok
is there a way to test this on a browser?
to verify this url works
so u can isolate the problem, is it the server or is it my header body
thats the question
i assume the data:data1 is the payload ?
also, isnt it usually send with json format ?
or am i wrong on that
i dont know the docs on this
btw can bot know the person who invite our bot to the guild?
what?
it could, if you hook the "Join" event
guildCreate event?
i believe so ye
I'm having trouble with the highlighted section. I thought "earnings" was my variable but it dosent seem to be
raw event maybe?
u can also track and store guilds in a db like file so you have a reference
im not a nodejs coder, but i assume these events are basically universal
i see, will check that later π
you should know best your own code right?
me too π
if you have no purpose, you can just disable // that line code
No i have a list.of work_messages that I'm trying to pull from.
But I cant figure out how to.make.that earnings part
{
"828766292777500683": [
{
"ChannelID": "828812416023396392",
"lastvideoID": "nothing",
"channelReturn": "828766292777500686",
"authorReturn": "363402633752477696",
"user": {
"ID": "6845716429242434565",
"username": "tonykun7"
}
}
]
}```
hello, I would like to change "lastVideoID" how can I do that?
people were wanting to save my database logs in a txt file ex:
Database Log - [date] | [value] of [username] database [id] was removed)
Ob = {
"828766292777500683": [
{
"ChannelID": "828812416023396392",
"lastvideoID": "nothing",
"channelReturn": "828766292777500686",
"authorReturn": "363402633752477696",
"user": {
"ID": "6845716429242434565",
"username": "tonykun7"
}
}
]
}
Ob["8287....83"][0].lastvideoID = "56"
I guess
would i break any rules of discord?
Depends what you save in Database
@near stratus
the problem is that in the array there may be other information like this
If you're saving all their chat and don't actually tell em you're saving it, that's a violation of privacy
I just save the user id and the money value and things like that
Then It's not illegal I guess
for......each ??
was there any way I could be sure of that?
The TOS dosen't say you can't store user IDs
When you're saving currency data all you're collecting is their IDs
I found thank you even if I did not have time to explain x)
Get[`${GUILD[UserGet.indexOf(UserGet2nd)]}`][UserGet.indexOf(UserGet2nd)].lastvideoID = lastvideo.id```
wtf
so I will continue with this log
thank you, have a good night
it's okay
Remember, if the bot isn't verified, you gotta tell em you're storing the data in a safe place while verification
(It's 3PM here)
my bot is checked, different time zones sorry k
I will try to inform this when they create an account on the bot
Well anything available with the API is public information so it's not sensitive information. But I would totally draw the line at storing or logging message history etc for privacy reasons (unless perhaps a log of someone's last messages in case of a ban command for example so mods can have logs of why the person was banned). Messages are private in my opinion. As long as you're not being invasive in what you store then it's ethically ok. Write a privacy policy for your users explaining what info you store and why, for how long, and what someone has to do in order to have their info deleted from your database. That way everything is transparent for everyone and your users will know what data is stored and why.
message.client.channels is only used if you want to find One specific channel by id
I like me some errors
Cannot read channels
Are you running it in DMs?
Yea
why
That's why
just why
Shloud be message.guild.channels.cache.find
Its suppose to be for dm's
cache before channels
but... why
No
@frigid mountain is your bot meant only for one guild or public for anyone to add?
you dont even have a dev role
Modmail Luke if a members has a problem they can type +mail I want to report someone
Then I can type +dm @user who do you want to report
let channel = client.channels.cache.get(βchannel-idβ)
or get. that works too
Yea ?
try get as mac said.
and why do you fo channel => channel.id? just do βchannel-idβ
that will work fine
no need for the arrow function there
okay. im just gonna leave. everything about that code makes me want to quit coding
Ok
Hi umm I've been looking in discord.py documentation about bot can read your bio and detect the message in your bio, if you know this and it's on discord.py documentation can you tell me what it's called or give me the link of it thank you
What do you mean by bio? Status?
which is the best framework on top of Eris
My bot is in 10 servers so that's why I don't use the ID
this makes no sense, if you want to use a certain channel you have to get or fetch the channel anyways otherwise you dont get the channel object.
The problem is you're trying to look for all the channels in the bot's cache called mod-mail as if you want to send the message to all of them regardless of the guild.
So you need to think about how the bot will associate a user with the specific guild they want to use mod-mail in.
https://discordpy.readthedocs.io/en/stable/api.html#discord.Member.activities returns list of presences, you can then filter the one that is custom. This requires presence intent.
Not presence I mean your custom status that you written on like yours a emoji
@frigid mountain i think a ticket system is probably easier to set up both for you and for your users. A permanent reaction message where members can react to open a private channel with the server's mods.
Pretty sure Member.status is just online, away etc.
Made it tuple to prevent it from getting stringified.
Ok
alright thnx
Mod mail DMs work if the bot is only designed for one server. Otherwise it starts to get complicated for the users.
Oh
ok question, what does this actually mean?
makes sense, I did connect a lot when trying to fix it yesterday
wait, does that include webhooks or only the bot account?
HI FOO
Anything that uses your client token. You have to wait 9h.
Stop trying to connect until then otherwise it'll increase the time
well yes, but let's say the bot connects to almost 4000 different webhooks over the course of 24 hours, would that trigger it?
When you say "connect" do you mean sending a message?
It's triggered by identifying more than 1000 times in 24 hour.
Yeah it's to do with your client hitting the identify limit not webhooks. My bot got timed out for 24h last month over a glitch with an unavailable guild that created an error loop while I was asleep π so easy to fix and so annoying π
Pro tip: if you have a sharded bot and you see this error in your logs one day, DON'T restart all the shards π it'll put all the shards offline. Better to leave one offline than to send all of them down.
Because each shard = client identification obvs
yeah, my bot has 4 shards x)
and it has gotten timed out for 24 hours multiple times due to unavailable guilds, but the thing is I don't even know if it's repeatedly trying to restart the shard
Mine was in 7 or 8 at the time doing about 300k command calls a month. Really sucked to have to wait for 24h.
Check your code where the error arises from and before getting a guild's info, put it in a conditional statement that checks if the guild is available first.
For example in js:
if(guild.available) {
//code
}```
also, since it's triggered by identifying more than 1000 times in 24 hours, what about bots with more than 1000 shards
e.g. Groovy
They have a special gateway and have their limits raised to 2,000
I see
https://discord.com/developers/docs/topics/gateway @summer acorn
Integrate your service with Discord β whether it's a bot or a game or whatever your wildest imagination can come up with.
thats a high amount ngl
last month i got around 100k commands used
how do you find this?
with queries
some guide?
not really, just grouping with dateTrunc
hm, ok, let me try
@river panther https://www.postgresql.org/docs/9.1/functions-datetime.html
thamk
np
@opal plank can you also tell this?
You should see the growth... π
what website are you using for it?
Built my own dash
ah
@river panther you should really start focusing on building your own stuff rather than pre-made stuff
just fyi
a developer, well, develops
create new things
imagine something, than make it happen
instead of copying something that already exists
what bothers me isnt that you want to get your own graps
is that your first intuition was where can i use this
instead of how do i make this?
@umbral zealot apparently i can't install enmap on replit and they have their own database. so i had to do this
that was a website thingy and idk css or html
learn it, thats what programming is
nobody starts coding without knowing
we gotta learn it first
:P
thamk erwin for motivating me again to do this, big fan, thank
no problomo
what
Html and css are easy. There are lots of guides online to learn it quickly.
oh, ok ok
why you gotta care
there is also boostrap
makes it a bit more easier to design pages
if you ask me
and yes ik its still html and css
Yes bootstrap is a good starting point. I've only ever used it on one project though. I usually write my own for each project. Especially good when you're starting out though.
nevermind im just dumb
Is this correct?
client.on("guildMemberAdd", member => {
if(member.user.bot) {
.addRole("Role ID")
}
})```
member.addRole
ok
is there any way to stream a video stream instead of just an audio stream using djs ?
No
ok :/
hello
i need some help with regex
im using a golang filter
im quite new to regex's and coding
Ν[\xe1\x9e\xb5\x80\x8c\xe3\xa4\xef\xbe\x2e\xba\xb9\xb8\xb7\xb6\x9d\xb3\xaf\xae\xac\xab\xaa\xa3\xa2\xa1\xa0\x9f\x8f\x8d\x8b\x8a\x89\x88\x81\x87\x86\x84\x83\x82\x8e\xb4\xd8\x9c\xc2\xad\xe2\x85\xf0]
nothing matches
can someone help
ok
const Discord = require('discord.js')
module.exports = {
name: 'send',
run: async (message, args) => {
const sayMessage = args.join(" ")
const channel = message.mentions.channels.first()
channel.send(`${sayMessage}`)
}
}
Why does it mention the channel?
i've shorterend it
message.mentions.channel.first gets the first mentioned channel
Because it's getting the whole message contents (which includes the channel mention)
What do I do so it doesn't mention the channel
Try joining args[1] and higher. Exclude args[0]
oh. i read the code wrong. lol. im on phone
type .slice(1) before join(" ");
const sayMessage = args[1].join(" ")
Oh
Yeah no lol what bano said
I just wanted you to Google how to remove elements from an array π
var maps = { 'I': 'd.', 'C': 'd', 'M': 'd', 'D': 'd', 'T': 'd', 'O': 'd', 'C': 'd' }; var keyToDelete = 'C'; delete maps[keyToDelete]; console.log(maps
const sayMessage = slice().join(" ")
?
It's js const sayMessage = args.slice(1).join(" ")
Because args is an array containing each word of your message that comes after the command.
array.slice() will remove elements from the beginning of the array.
array.join() converts the array into a string with whatever characters you want in between each element. For example if you want to make a comma-separated list you'd do array.join(", ")
what hell on earth is that thing ?
what are these <% ?
probably aspx thing idk not really sure
was php not enough ?
now there's more cursed things on earth
haha okay bit it's similar though
php is a billion times better than ejs
*screenshot sound
i don't use <?php ?> that way. I write HTML inside PHP script
echo "<!DOCTYPE html>\n" ;
echo "<html><body><p>asd</p></body></html>" ;
Fun fact: I never learned PHP but kept calling it ugly
becasue I want to load dynamic pages. i mean it's already dynamic but ..idk how to explain
Anyway
Why don't they just use React instead.
If there's "TOO MUCH" js in webpage
it's actually interesting
remember when i told you do do it before rendering?
you cant use async inside the renderer
server sided rendering
you can? await renderFile and set async to true in the options object iirc
render also takes in async true
y e a h s u r e
var ReactDOMServer = require('react-dom/server');
huh so if I write this
<% for(let num=0;num<9;num++) {%>
<p>count <%= num%></p>
<% }%>
the p tag gets written 9 times? is that how it works?
then hes not doing it
idk
this is the first time I'm seeing this.
Imma stick with react
i dont use ejs but all examples i found in SO say to use async stuff outside the renderer
I forgot to say thanks
No worries! π
i found this handy cheatsheet for embed colours https://gist.github.com/thomasbnt/b6f455e2c7d743b796917fa3c205f812
why if i use this code (https://srcb.in/mK3iGK3WWa) and i run >trigger without mentioning somebody it says "cannot read property "user" of undefined" while it should take the user that runs the command their avatar?
someone?
i think line 12
mentions.members could be empty if there's no mentioned member in the message
and it tried to get the first entry which probably didn't exist
so how can i fix it?
??





