#development
1 messages Β· Page 1285 of 1
x = sum([guild.member_count for guild in self.bot.guilds])
works great thanks
@clever wren Maybe he doesn't do .js... just wait for help man
Id help you but i only know python
i took it from a site
but it works in most of the bots
i dont know the bot im now working on
so i dunno where to paste
you dont know the bot ur working on?
i just got it from a rep
so im trying to customize it
its EvoBot Music Bot
You can find it by Googling
my honest opinion.. start a new bot.. write some basic commands and learn what your doing.. rather then barking at people for help on something like this
no one is going to want to help you
copy pasting code and asking for help cause you have no idea of what you copied
yoink
I know im right you know why?
i dunno coding that much
yeah, just do what does guys said or mayb read the copied code and try to understand whats happening
imo copy/paste isnt a way to learn to make a bot
try to find any github repo about that or somethn idk
you need to write code to learn it imo
i learn that way anyways
@earnest phoenix you can copypaste code, edit it, read it and try to understand it, and then write your own
some people learn that way
you need to write code to learn it imo
I kicked and invited my bot 191 times to get a peice of code i wrote to work.. but i figured it out and got it working on my own
by taking parts of code and adding them to their own, changing stuff and so
i am 10x better for it
and at some point they learn why the code does that stuff
191 times dAMN thatβs fucking dedication
yeah man i now know 190 things that dont work
When I started with a bot I had an issue about that innorganically growth stuff
and manage to build a lil shit to kick my bot from servers with same owner, or a command b!gk userID to kick my bot from there
stuff like that
and there is no tutorials for such things so... you have to read stuff and try to figure out how to make it work

annyone knows why my custom status doesn't work on my phone? like it doesn't show up under my name
idk, try another channel
still not showing up
My bot is still not approved. What should I do?
@ionic dawn Thanks bro for saying this
@earnest phoenix you can copypaste code, edit it, read it and try to understand it, and then write your own
some people learn that way
@ionic dawn I solved the problem on my own
@clever wren Im sure you felt good when solve it
24/7 and free? doesn't exist
hm you can find some here if you can
just buy a Pi or use a 3$VPS
I tried repl.it with website monitoring
@clever wren it works
only problem is that somehow it wont run this https://tunezilla.bullzillagaming.repl.run
all other bots are working fine
I'm having some issues with C# tackling it on a deeper note but comfortable with other languages:
var bot = new RandomBot(config);
var disc1 = new DiscordBot(bot);
Globals.Self = disc1;
Globals.Bot = bot;
Looking at another source, and vaguely understand how it links with C# but was wondering, how I'd pass the replyasync off to bot to use if it needs to send message back.
All works just not sure how to scope it correctly with C# so I can pass a call-back or something.
I'll take dummy links/etc to read not sure the name of what it is I'm trying to do/reference π
how do you get a channel from a mention djs?
MessageMentions#channels
Got my issue sorted with a nice callback π
MessageMentions#channels
@fluid basin im very dumb and do not understand
#502193464054644737
@rain dew imagine minimodding in the wrong channel in the wrong server at the wrong time
okey, sorry
How would I properly check in .net API, if bot has permission to send/read in a channel.
How would I properly check in .net API, if bot has permission to send/read in a channel.
@unique patio you first press the power button on your computer then in the blue big box that prompts click force shutdown and then yes
K
Took you two minutes to write that?
So after I apply the poodle attack on network what next, SSH right in?
Took you two minutes to write that?
@unique patio bro I'm eating spicy as fuck food and constantly drinking water
I guess I'm better than you, prove me wrong.
emitting shortly.
TY for that!
When you see that blue-screen run.
I guess I'm better than you, prove me wrong.
prove me wrong.
@unique patio wha-
you mean this? https://discord.foxbot.me/docs/api/Discord.IGuildChannel.html#Discord_IGuildChannel_PermissionOverwrites
Represents a generic guild channel.
Uhhh not sure it's over-writes?
I just want to verify, bot can send properly, could run a try/catch on it on failure and flag that but wondered if cleaner way
SocketChannel Channel = _client.GetChannel(channelid);
Not sure this library is weird in comparison to JS
I have this to select my channel and it seems to find it with or without perms.
Represents a generic guild user.
So yeah confirming it to be non null and do a check right now.
Is that specific to channel? or overall guild
specific channel

Much appreciated!
We learn new things differently
Well the fact it has like SocketChannel/Guild/etc etc
and they all do different things, ouuf got me reading more than coding
you know? lol
I hate these moments cause when it's done it's a head-slapper
yeah
anyone familiar with SQL? need help with a query
anyone familiar with SQL? need help with a query
@serene cliff just ask the question instead of waiting for someone experienced with SQL to bother you
fg
I want bot
and i want a villa
if (_client.GetChannel(Config.QueueReportChannel) is IMessageChannel Channel)
{
try
{
// Send channel
await Bot.ChannelReady(Channel);
} catch
{
Console.WriteLine("Channel perms missing!");
}
}
Ended up with this, figured it was more work the other way. Not sure, passes fine if issues occur.
what shiv said
check for perms beforehand executing the action
can you prevent express static stuff from caching on the user's web browser? I'm making a game where people can compete with each other and if stuff gets cached then there is no reason for the user's browser to re check for updates from the server.
@pale vessel does setInterval() work on browser JS
yes
how do i use rich embeds in djs?
you can either use the MessageEmbed constructor or provide the embed object directly in the send options
discord.py
how do i check if the bot is being pinged (if even possible)
i have this
@bot.command()
async def @soft grail(ctx):
await ctx.send("my prefix is d!\n do d!help to see all the commands")
```but it seems to not work
my goodness
u see i made a corona command and when i use the command everything works until i go onto mobile. everything becomes thin and when i see dyno's corona command it looks cleaner
Mobile embeds are broken
why does dyno's work?
@pale vessel i think <> is the thing that is breaking it but ill try any way
Cause some of them decide to be fixed and some dont 
yeah that's what i'm wondering
i don't know python so i'm not sure what kind of characters it accepts for functions
can't you just use the on_message event?
check the message content
instead of making it a command
How to check if number is an integer
For slowmode command
int(number here)
@violet mesa I tried
It works in eval
But it doesn't work in bot itself as you can see
Hello @delicate shore
Hello
Wheree can i invite pokenav bot @delicate shore
Pokenav?
You don't know about pokenav
https://top.gg/ you can search it here
use Number.isInteger(number)
Ok
it must be a number, not a string
you have to use Number.isInteger(number(string)) if you're dealing with strings
I can't type
you can also use parseInt
Yea
isNaN(parseInt(number)) would check whether a parsed number is an integer or an invalid number
I tried it didn't work tho
It is not there@delicate shore
Then I don't know @earnest phoenix
π₯Ί
?
@pale vessel why \n no work in CanvasRenderingContext2D.fillText();
Hi, RichEmbed has been changed to MessageEmbed, right?
Hi, RichEmbed has been changed to MessageEmbed, right?
@light island And a few other changes too
hold up lemme fetch the docs
Ah, alright. Thanks.
Thanks.
There are WAY MORE changes than just embeds
Yup, I've noticed
Thanks.
@light island nope
just chillin'
playing rock paper scissors that i coded
That's cool.
@pale vessel why
\nno work inCanvasRenderingContext2D.fillText();
@earnest phoenix because it just doesn't support it
you have to split it yourself and make a loop

is an express.js server with express static files better than repl.it's built-in HTML, CSS, JS servers
Hey, can you help me with this code, i want to create a ban command using Discord.js v 12.2.0, client.on('message', async message => { if (message.content === "u!ban") { const { member, mentions } = message if(member.hasPermission("ADMINISTRATOR") || member.hasPermission("BAN_MEMBERS")){ const user = message.mentions.users.first(); if(!user){ message.channel.send('<@${member.id}> Please specify someone to ban.'); }else{ message.guild.members.ban(user); message.channel.send('Banned.'); } }else{ message.channel.send('<@${member.id}> You do not have permissions to use this command.'); } } });
Sorry what
Wdym repl's built-in servers
@viral timber any issues you sre facing? (errors, command not working)
Wdym repl's built-in servers
@slender thistle they have a language calledHTML, CSS, JSwhich requires no extra stuff to setup just put your files done they'll serve it for you
but i want to do some other back-end stuff too
the command is not working but the console does not show up anything @slender thistle
it's like it cannot find the mentioned user to ban
Static files? I'd say it's up to you
repl just gives you the choice but if you wanna do whatever in the backend
@viral timber try putting a few console.logs where you think the command stops
Did they not?
oh yes
ye
ok
do i need an extra thing for parsing cookies?
express.js docs say cookie-parser middleware
i used member when i check if the message author has permissions
why ain't my express server listening for requests
i added a listener using app.listen(8080); yet repl.it is showing Run the repl to see the output when i goto the website
Have you tried plugging your internet in?
after a quick reload it works
repl.it is fucking weird
the app literally wasn't running
even though it showed that it was
Sets cookie name to value. The value parameter may be a string or object converted to JSON.
ahhh now i see why the cookies weren't there because i passed a normal JS number instead of JSON
Numbers are supported in JSON, no?
yes
smh
wait is the options parameter required
if (!req.cookies.score) res.cookie("score", JSON.stringify(0), { httpOnly: true })
is this correct? The cookie ain't showing up when I click the padlock thing in chrome and press cookies
no
it has to be like
res.cookie('score', '0', { httpOnly: true });
or res.cookie('score', { score: 0 }, { httpOnly: true });
bruh
isn't that what JSON.stringify(0) does
i added that just to be safe
that bruh moment when you think you have a listener listening for GET requests to / but then you see this line:
app.use(express.static(__dirname + "/public");
which makes your listener pointless
JSON.stringify(0) would return "0"
am i missing out if im not using commando?
not necessarily
i see it here in there but ive never tried it
now i am confused if it's like a big advantage if i use it or just noob-friendly thing
am i missing out if im not using commando?
@ionic shard no, i don't even use any frameworks
hum ok
okay thanks
Has anyone ever seen a discord bot on mobile
yeah
discord is weird
@pale vessel can you set custom headers in HTTP requests?
yes why not
large_threshold: 50,
compress: false,
properties: {
$os: browser ? 'browser' : process.platform,
$browser: 'Discord iOS',
$device: 'discord.js',
},
version: 6,
},```
node_modules/discord.js/src/util/Constants.js
@frank lava
how could you do stuff to cookies in browser-js?
what is that
oh
what is that
@pale vessel i want to fetch the value of thescorecookie and change it's value around and stuff
*get
no promises for cookies 
is browser-js a package
no
it's stuff that runs outside of node.js on normal browsers
basically client side javascript
yes
you want to set a cookie?
you can deal with cookies from js, but is not recommended because it has security implications
its fine for stuff like language selection, shopping carts, and user configuration
but its not fine for auth tokens and account remembering, those should be done with server side cookies
Aand you should make all cookies regarding auth HTTP only so they cannot be accessed by client-side JS
true
session tokens should never be accessed by the page itself.
they should be secure, and httpOnly
document.cookie is returning nothing even though there are cookies set on the page???
are those cookies httponly? π
hmmm
i think its finally time to tidy up my lazy command handler code
i mean seriously... it works but ew... its like a chain of if, then, else if... of command names π

@pale vessel whats with the nick change lol
is it pointless to use cookies to store rockum paperum scissorsum score for the user for a whole freaking month
depends on your use case code913
i mean seriously... it works but ew... its like a chain of if, then, else if... of command names π
@green kestrel oh hi yandere dev's dad
just for storing the score for later
yandere simulator
even though nobody store rock paper scissors scores for a whole month
ive been holding off on splitting commands into separate C++ source files, because if i do that, each one adds ~4 minutes to the build time on my dev box
because aegis π¦
do like everyone here and use js
so instead of 630mb of ram and 2% cpu for 10k servers, i'd need several vps with 8gb ram? 
great idea! π
tbh the performance benefits outweight a bit of waiting
Does Discord delete images uploaded to their platform once in a while?
@earnest phoenix dont think so, unless you delete the message theyre attached to
@green kestrel computer says yes?
do like everyone here and use js
@tight plinth because it's standardized in browsers so it's fucking easy to link a dashboard to your database instead of having the database in a different language and the browser stuck to one language requiring conversion between them
aight thx it looks like discord just experienced a problem of loading embed images just now also im 12 minutes away
Has anyone ever seen a discord bot on mobile
@frank lava Yeah, I think NotErwin said you'd have to modify the lib you're using, or alternatively I'd think it should be achievable via an api call
i believe @earnest phoenix's bot is done on mobile
I don't code on it, I SSH into my phone
just have a cron job pull latest github every now and then and pm2 watching for changes
eh
It's just hard for no reason
aight thx it looks like discord just experienced a problem of loading embed images just now
@earnest phoenix as expected they LIED that they fixed embeds on mobile
btw how do you make it so when someone sends a link to your website it sends the title, description and all that jazz in the embed? I tried doing meta data stuff but it ain't working.
nvm figured it out
A pretty terrible game of rock paper scissors
hamburger.eat() returns cannot get .eat() of undefined
hamburger is undefined.
I have it defined tho let hamburger = Earth.food.fast.McDonalds.menu.quarterPounder;
Ill double check mcdonalds api
Ohhh i had to do menu.burgers
hamburger.eat()returns cannot get .eat() of undefined
@thin turret technically it should throwhamburger.eat() is not a functionfor methods
not if hamburger was undefined 
if it's undefined, how the hell would it know eat() is not a function?
not if
hamburgerwas undefined :thumbs:
@umbral zealot it still throws the error
It would throw the error he got. cannot get "eat" of undefined
nvm
All I know was that hamburger was undefined 
Well incorrectly defined
Do you guys know if .eat() returns a promise?
All I know was that hamburger was undefined
@thin turret Star Wars: Attack of the chicken burgers demise of the hamburgers


does SQLGate have their own service for hosting SQL servers
or do i have to fuck google cloud platform again for a free host
i have a serious question
serious
so basically
i have been listening to shit songs on spotify for like half a year now
and finally im getting the best songs ever
but i dont know which playlist this is
lmaoo
this is #development
does SQLGate have their own service for hosting SQL servers
or do i have to fuck google cloud platform again for a free host
I hate GCloud
seriously
it's fucking awful
hi
ok real question this ime
time
if (args[2]){
for (var i = 1; i < args.length; i++) {
if (i === 1)
smessage.concat(`${args[2]} `)
i++
if (i === 2)
smessage.concat(`${args[3]} `)
i++
if (i === 3)
smessage.concat(`${args[4]} `)
i++
if (i === 4)
smessage.concat(`${args[5]} `)
i++
if (i === 5)
smessage.concat(`${args[6]} `)
i++
}
i have this loop
and it says
TypeError: Cannot read property 'concat' of undefined
there's definitely a better way to do this, just saying lul
how in the earth
not to mention its skipping numbers because its doing i++ twice on every iteration
yeah and fuck braces too right i mean who needs them anyways
this is some weird piece of code my friend
@vale garden tell us what exctly are you trying to do, there is likely several ways of doing what you want that are 1000x better, faster, cleaner, easier, smaller, and more readable
should i put arc.io on my pointless website
because right now it takes a fucking second to load
a CDN will probably make it better
your site would need some graphical improvements
nope
it's the insane amount of javascript files that are loading
because it's an online game
whose code i split into multiple files
and still, it would need some frontend improvements :^)
ok
snake case \π³
no miner π
Leave Server
on the online site are no other files linked tho
this is not the one

??
remove /
unnecessary
smh
<link> has no closing tag
so putting a slash in the same tag tells the browser hey this tag has no closing tag
Thereβs also a number of other popular databases including MySQL, NoSQL and PostgreSQL.
what kind of article putsMySQLandNoSQLon the same line
its unnecessary because the browser knows that <link> has no closing tag
@coral stirrup do you actually think i use updated browsers
yes
bro this ain't xml
bro this ain't xml
@pale vessel this is discord duh
you probably do <img src=""></img> too
lmao
lol
you probably do
<img src=""></img>too
@pale vessel nope i just do<img src="" />
brah
that's-
not cool

lol
nice
poggers
<a href="https://top.gg/bot/760895142785450024" alt="MY BOT"</a>
<a> and alt attribute π³
</thing>
hi can i ask here?
what u wanna learn what to do?
lul
In React every element has a closing tag so maybe that's where you got confused from
in html almost every have it too
closing tags are fine for compatibility but it's not needed in html5
iframe is <iframe></iframe>
never mind
never mind times two https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
i've started a giant conversation about closing tags
what have i done
only some tags can be self enclosed
If i type Hello in channel id 41561561516545 or type anything bot will reply GOOD
but how bot will don't revice message GOOD? How bot will don't get message he self
@vale garden tell us what exctly are you trying to do, there is likely several ways of doing what you want that are 1000x better, faster, cleaner, easier, smaller, and more readable
@quartz kindle well i ended up doing all that
lol
Β―_(γ)_/Β―
@earnest phoenix ignore bots
in discord.js you can do if(message.author.bot) return
i think its the same in python if u dont use from discord.ext import commands
context has author too, if that's what you mean
if message.author == client: return i think this would work
wouldn't that only ignore the bot itself?
how come
it doesnt act like python
like
idk
how to explain
u dont realy use python stuff unless u use list and import random
stuf
f
like if u would give a python god a tut for a discord bot he wouldnt know its python unless he see's import discord
its like unity c#
and normal c#
they are the same thing
but they arnt
what

comfuse and run
like if u would give a python god a tut for a discord bot he wouldnt know its python unless he see's
import discord
@violet mesa but you can really differentiate python code though
it's quite unique
Can I integrate it?
guys Im about to do a serverlockdown command
ignore only bot my self don't other bot
did I hear C#?
they are the same thing
@violet mesa They are the same language...?
From what I can tell, it just implements a few classes, has a few using statements, and maybe a few attributes
Is it a request for help with coding one or request for someone to make one?
Help with coding lol
Just ask your questions here
Yeah I'd suggest just asking here
that message can be misinterpreted as if you were asking someone to code a bot for you
I'll delete then :>
and we generally do/want to encourage users to ask questions in public channels unless it's too occupied
Also, in case anyone else has a similar question
so Β―_(γ)_/Β―
I have another question but idk where to ask it
Thank you
I'd suggest skimming through channel topics while you're here
How can I see the time spent on an activity
https://discord.js.org/#/docs/main/stable/class/Activity
ex: 12:20
you already knew the activity docs, try looking through it lul
@sage bobcat I see you're directly calling a MongoDB in your command
One message removed from a suspended account.
May want to consider something more abstract
One message removed from a suspended account.
I posted an example a while ago of a maintainable database context
https://media.discordapp.net/attachments/272764566411149314/748188946843959407/SPOILER_unknown.png?width=960&height=347
when I want to search a bot is it? const dis = await client.guilds.cache.get(message.guild.id).users.cache.get(bot);
no?
?
then what?
const dis = await client.guilds.cache.get(message.guild.id).members.cache.get(bot);
??
@misty sigil
I donβt know?
client.users.cache.get()
or client.channels.cache.get()
depends what youβre searching for
whats ur issue, @tired panther ?
from discord.ext import commands
client = commands.Bot(command_prefix = '?')
@client.event()
async def on_ready():
print('Bot is ready for use')
print('------------------------')
@client.command()
async def social(ctx):
embed = discord.Embed(title = "Shit" , description = 'Nothing special' , colour = discord.Colour.green())
await ctx.send(embed=embed)
client.run(Token)```
What's wrong in this command?
It's showing Missing one positional arguement
@digital ibex I am searching for a bot in a server , but it gives the message dispite that bot is already in the server
const dis = await client.guilds.cache.get(message.guild.id).members.cache.get(bot);
whats the error?
if(!dis){return message.channel.send("bla bka");}
no error
it is sending the message even if the bot is in the server
@digital ibex
what does dis log?
if the bot is in the server || true / false
isn't that going to be true regardless ??
i know this isnt really about bot dev but how can i check if a column with an ID already exists in MySQL node.js?
every time a message gets sent, it will trigger the if(!dis)
in any server, you're not looking for a particular server, @tired panther
(sorry for ping) @split hazel my bot has been muted for a while now, for having multiple instances running plus a few other issues. Those have since been fixed. Is there any way it could get unmuted? It's name is ParksBot
@jagged oyster all set
thanks!
I have a habit to program for 10 minutes and slack off on Discord for 1 hour}
But I'm making a Discord bot, so I cannot disable Discord
Solution?
wut
have less friends and servers
or give yourself a cookie for every X minutes worth of coding
discord eats your soul
Less friends and servers is hard
I can go buy some cookies I guess
or give yourself a cookie for every X minutes worth of coding
@sudden geyser cookies as motivation
nice idea
Guys, anyone ever tried sending embeds manually? Like constructing a json and sending a post request to the webhook?
Im having a trouble with that atm although im following their guide
What library are you using
guys if u want ur bot to mention a channel how would it be?
<#channel-id>
thx
Lemme guess
Mu is not using a library
Writing their own
<#channel-id>
@sudden geyser is it message or just that
Take [#development](/guild/264445053596991498/channel/272764566411149314/) for example. That becomes #development
yeah ik
Im using requests with python, a very basic webhook just to try embeds
thx
Take
[#development](/guild/264445053596991498/channel/272764566411149314/)for example. That becomes #development
@sudden geyser ${<#channel-id>} its not that
I want it to be like "channel" locked down.
-bots
oops
The inside of ${} should have the expression on getting the channel ID.
<#> is just part of the content of the message.
if anyone is decent with sql, could someone guide me on querying 2 tables, lets say i have table 1 name (string), age (int) and table 2 name (string), premium (bool) how would i make select return only rows from table 1 where the row meets the condition in table 2 (premium is true)
<#>is just part of the content of the message.
@sudden geyser${message.channel.id}no bro I want it to tell the channels name not the id
Speedy
if you are using js, try this out
pb?
problem
I am helping Speedy 
not really helpful, i want to do it via a query not 3rd party service
I recommend using Prisma as it uses native queries under the hood
(and it also has a dope api)
it converts your js like query to native sql
look ${message.channel.id} I want it to say the channels name not the id of it @compact oriole
no
stop pinging me also
π

${message.channel.id} is only message the id of the channel but I want it to say the channels name not the id of it. Anyone help?
lmfao pog middlefinger
how to make a message in slowmode so anyone cant spam it?
i found in to work best
WITH (SELECT NAME FROM public.TABLE WHERE user = 'user') AS USER
SELECT * FROM public.TABLE where USER = USER AND premium = true
this is why I hate sql...
@sick pelican you want a cooldown, if i got your question correctly
yeah
you uysing d.js?
yes
ok thx

Is Visual Code Studio the best for programming app?
is it the best programming app?
I'm new
The only best app os tje one you like
@spring lance there isnt a best tool for job, it boils down to preference, some people like atom, some people like vim, i presonelly prefer VSC
@opal plank actually there is given of the code of a separate js file which will be executed and read on the bot via main file but my code is on the main file so what would i do?
it depends on your tastes tbh
Is Visual studio good?
I've never done programming before
But I need to download an app to start
So should I do visual studio
@sick pelican in the same guide i sent you, look for command handling
ok
Which programming language do you want to write in?
good? no, its fantastic
Python
VSC has everything and more that you'll need
Well, ig VSC and you could try out JetBrains IDEs like PyCharm
Do you guys have any videos on a VSC tutorial
heres a tip
when you starting as a dev, get a good habit of READINg
not watching
most of the stuff you'll be doing wont have tutorials on it
but theres ALWAYS documentation
and videos are likely outdated, docs are always up to date
so, tl;dr, read the docs rather than videos
Ok how old do you recommend beginners be
there isnt an age for coding
its commitment
you can be 10 for all we care, age isnt a requirement for coding
just the effort you put on it
the more you pour into it, the more experienced you'll get
yea for sure
We learn differently
hey guys i am really in need for some help. ```js
let channel1 = message.mentions.channels.first();
let rawdata = fs.readFile("./data.json");
let channel= JSON.parse(rawdata)[0];
if(message.channel.id == channel){
const args6 =
' ' +
message.content
T.post("statuses/update", { status: args6 }, function (
err,
data,
response
) {
console.log(data);
})
}
if (message.content.startsWith(prefix + "setchannel")){
fs.writeFile("./data.json", [channel.id])
}
}``` when i use the !setchannel command, it gives me this error: (node:8224) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_CALLBACK]: Callback must be a function. Received undefined
function() isn't how you write a function.
oh wait, no, I was not seeing the correct syntax here, sorry
thats callback lol
yeah no I was wrong there, 100%, sorry
I always use () => {}
define T
because arrow function gang
In fact, the error isn't on that line at all
let rawdata = fs.readFile("./data.json"); is the line where it's complaining about the missing callback
readFile is async and requires a callback
i finshied my bot
You can either use readFileSync , or you can use the promise-based, or you can just use require() instead, or, and this is the critical point that you really, REALLY need to understand: YOU COULD NOT USE A JSON FILE AS A DATABASE.
@eternal osprey https://discordapp.com/channels/264445053596991498/272764566411149314/756493131842584687 please read this.
its funny that they havent even replied yet
Β―_(γ)_/Β―
bro chill.
i was feeding my cat.
i have read everything above.
i know json databases are one of the worst things on earth..... but i just want to store 1 message.
that;s all.

Alright, well, go ahead and use readFileSync then
Though I hope this won't ever be used on multiple guilds.
it's just for one guild

Alright, readFileSync it is
should it be readFile
no
instead of readFileSync.
No, jesus christ, dude
How do I get the early supporter badge
You have readFile. it requires a callback. I'm telling you to use INSTEAD readFileSync
@spring lance you don't, you can't, it's not obtainable.
π
So I can't ever get the badge?
Like is there a badge still?
Like a newer version obtainable
No, there is no more badge, and there will not be one to replace the early dev badge.
hmm so it worked.
however, i am getting cannot read property id of undefined?
It's early because those of us that have it already had a bot and we actually went through the approval process early. That's why we have the early dev badge. There is no replacement.
Are you daft
There is no new version, you stale muffin.
You can't get a badge. You don't get a badge.
evie.Codes, what gender are you?
LOL
gender fluid
I don't see how that's relevant to anything.
Exactly Evie stop talking
@opal plank don't speak for me, honey.
Your being rude for no reason
right mr apache helicopter @umbral zealot
Def a girl.
Can we get back to development
@spring lance explain me how's she/he rude? Evie is trying to explain you.
just []
i think that the error is coming from this part:
fs.writeFile("./data.json", [channel.id])
you're getting the first element from that array
fs.writeFile("./data.json", [channel.id]) <--- this line would be the error, right? if channel is undefined, it would get that error.
you're not overwriting the channel variable so it's undefined.
okay.
so i should have the setchannel command above my other code?
so it first writes, then checks.
What would it be writing?
why are you writing it at all, in fact, if you're not actually updating that value?
the channel id of the channel where you use !setchannel.
because writeFileSync too π
is there a way to check if a user nitro boosted a guild with discord.js v 12?
Check the message type
Wait, like, you want to detect when a user boosts, or just to see if a user has boosted a certain guild?
how can i check if result is empty
(it doesnt work like this)
when its not empty it sends [object Object]
is result an array
If it was an array it wouldn't be shown as [Object Object]
Don't put the object directly in the string, either stringify it or add every value to the string individually
or console.log it first to see what it looks like
[
RowDataPacket { ID: 659633074400788500, Premium: 0, BlackListed: 0 }
]
ah ok
i did result.toString() == ""
now it works
thanks
By the way, you may want to store the user ID as a string
Man, I need to update all my bots
for what though
hi annie
Idk what is happening there's an error and idk it its js
Hi ;-;
console.log('uwu')
client.user.setActivity(`servers`, { type: "WATCHING" });
})
client.login(config.token);```
help me
no spoonfeeding remember
lmao they still can help
ik
What should I fix
okay
since we dsont have access to whole code
} expected.
Then add a }
You either put an unnecessary { somewhere or ^
Okay
thanks
It's still not working .__.
If i put a { somewhere there's error on client
It's like 5 bots, I need a list of all intents and what they do ngl
@slender thistle ah, I only have one bot sitting without the intents but I haven't maintained it so gonna let it rot
π
you shouldn't import anything other than dbl
oh okay
but oh look you decided to name your file that
so everything is breaking because you used a module's name
π
is this referring to a specific bot?
So I just tried out address sanitizer (Google asan) on g++ with my program and it found a memory corruption heap overflow. So in that regard it's great. But I noticed whenever it's compiled against my program it has 20 terabytes virtual. Removing asan removes the virt. I don't even have 20tb storage never mind 20tb swap lol.
Numbers that big are huge OOF
20tb swap
@misty sigil whats softban
does anyone know if you can code a bot to post in an announcement channel and then have it share it? I know you can have it post but the share part is what Iβm curious about. Ping me with answers
fsr its still not working :(
Remove the last character π€¦ββοΈ
learn how to indent
Show more code
In a sourcebin
Look you have a syntax error, you're missing a } or a ) somewhere for sure
All of it
Take the entire file and throw it on https://hasteb.in/
after pasting, do CTRL+S and send us the URL you get
Do you really think you've done something that a thousand people haven't already
oh ok
fine
:C
why do you feel that someone would like to steal your non working code
its over 2000 characters
bin it
Man, it's so hard to follow instructions.
The lib I linked finds illegal writes to memory by claiming all memory and intercepting the writes
Like, ALLL memory. Can you imagine having 20tb ram lol
finally
Is this time to bring out the learnjs thing








