#development

1 messages Β· Page 1285 of 1

slender thistle
#

not for member_count

clever wren
#

bro

#

pls help

earnest phoenix
#
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

clever wren
#

ok

#

mm

#

@earnest phoenix bro can i dm you

earnest phoenix
#

you said u "have" code

#

did you write said code

#

or copy/paste?

clever wren
#

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

earnest phoenix
#

you dont know the bot ur working on?

clever wren
#

i just got it from a rep

#

so im trying to customize it

#

its EvoBot Music Bot

#

You can find it by Googling

earnest phoenix
#

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

ionic dawn
#

copy pasting code and asking for help cause you have no idea of what you copied

#

yoink

clever wren
#

yes

#

youre right

ionic dawn
#

I know im right you know why?

clever wren
#

i dunno coding that much

ionic dawn
#

because I did it too

clever wren
#

mm

#

bro

#

will u help me

ionic dawn
#

yeah, just do what does guys said or mayb read the copied code and try to understand whats happening

earnest phoenix
#

imo copy/paste isnt a way to learn to make a bot

ionic dawn
#

try to find any github repo about that or somethn idk

earnest phoenix
#

you need to write code to learn it imo

clever wren
#

@ionic dawn ok

#

@earnest phoenix ok

earnest phoenix
#

i learn that way anyways

ionic dawn
#

@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

misty sigil
#

you need to write code to learn it imo

earnest phoenix
#

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

ionic dawn
#

by taking parts of code and adding them to their own, changing stuff and so

earnest phoenix
#

i am 10x better for it

ionic dawn
#

and at some point they learn why the code does that stuff

misty sigil
#

191 times dAMN that’s fucking dedication

earnest phoenix
#

yeah man i now know 190 things that dont work

ionic dawn
#

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

earnest phoenix
#

annyone knows why my custom status doesn't work on my phone? like it doesn't show up under my name

digital ibex
#

idk, try another channel

earnest phoenix
#

still not showing up

shrewd compass
#

My bot is still not approved. What should I do?

honest perch
#

Also your bot was denied

clever wren
#

@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

ionic dawn
#

@clever wren Im sure you felt good when solve it

clever wren
#

@ionic dawn Damn yea

#

Bro what are the ways to host a private bot for free 24/7

fluid basin
#

24/7 and free? doesn't exist

clever wren
#

ok

#

remove 24/7

#

i just want to host it

fluid basin
#

hm you can find some here if you can

ionic dawn
#

theres no such thing

#

theres no free hosts 24/7

clever wren
#

I tried repl.it with website monitoring

ionic dawn
#

just buy a Pi or use a 3$VPS

clever wren
#

I tried repl.it with website monitoring
@clever wren it works

#

all other bots are working fine

ionic dawn
unique patio
#

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 πŸ˜›

silver lintel
#

how do you get a channel from a mention djs?

fluid basin
#

MessageMentions#channels

unique patio
#

Got my issue sorted with a nice callback πŸ˜„

silver lintel
#

MessageMentions#channels
@fluid basin im very dumb and do not understand

earnest phoenix
#

#502193464054644737
@rain dew imagine minimodding in the wrong channel in the wrong server at the wrong time

rain dew
#

okey, sorry

unique patio
#

How would I properly check in .net API, if bot has permission to send/read in a channel.

earnest phoenix
#

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

unique patio
#

K

#

Took you two minutes to write that?

#

So after I apply the poodle attack on network what next, SSH right in?

earnest phoenix
#

Took you two minutes to write that?
@unique patio bro I'm eating spicy as fuck food and constantly drinking water

unique patio
#

I guess I'm better than you, prove me wrong.

#

emitting shortly.

#

TY for that!

#

When you see that blue-screen run.

earnest phoenix
#

I guess I'm better than you, prove me wrong.

prove me wrong.
@unique patio wha-

unique patio
#

That was prefect engrolls

#

GL!~ Cheerrio's is runnin

unique patio
#

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

slender thistle
#

Is there anything like channel.permissions_for(guild.me)?

unique patio
#
            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.

unique patio
#

So yeah confirming it to be non null and do a check right now.

#

Is that specific to channel? or overall guild

pale vessel
#

specific channel

unique patio
#

Ooooo

#

Had lots of issues going through the pile, lol

#

new library today for me

slender thistle
unique patio
#

Much appreciated!

slender thistle
#

We learn new things differently

unique patio
#

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

slender thistle
#

yeah

serene cliff
#

anyone familiar with SQL? need help with a query

earnest phoenix
#

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

wet flower
#

I want bot

earnest phoenix
#

and i want a villa

unique patio
#
            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.

slender thistle
#

It's eh

#

It's one unsaved API request

#

Maybe ping cry?

earnest phoenix
#

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

pale vessel
#

yes

west agate
#

how do i use rich embeds in djs?

pale vessel
#

you can either use the MessageEmbed constructor or provide the embed object directly in the send options

violet mesa
#

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
pale vessel
#

my goodness

west agate
#

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

pale vessel
#

well if that's valid you can try @soft grail(ctx):

#

highly doubt it is though

zenith terrace
#

Mobile embeds are broken

west agate
#

why does dyno's work?

violet mesa
#

@pale vessel i think <> is the thing that is breaking it but ill try any way

zenith terrace
#

Cause some of them decide to be fixed and some dont KEKW

pale vessel
#

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

violet mesa
#

umm i guess ill use no rewright just for that

#

rewrite

delicate shore
#

How to check if number is an integer

violet mesa
#

int(number here)

#

i guess

delicate shore
#

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

earnest phoenix
#

Hello @delicate shore

delicate shore
#

Hello

earnest phoenix
#

Wheree can i invite pokenav bot @delicate shore

delicate shore
#

Pokenav?

earnest phoenix
#

You don't know about pokenav

delicate shore
pale vessel
#

use Number.isInteger(number)

delicate shore
#

Ok

pale vessel
#

it must be a number, not a string

delicate shore
#

And @pale vessel do I need to pass number as an int

#

Using pareseiny

pale vessel
#

you have to use Number.isInteger(number(string)) if you're dealing with strings

delicate shore
#

I can't type

pale vessel
#

you can also use parseInt

delicate shore
#

Yea

pale vessel
#

isNaN(parseInt(number)) would check whether a parsed number is an integer or an invalid number

delicate shore
#

I tried it didn't work tho

earnest phoenix
#

It is not there@delicate shore

delicate shore
#

Then I don't know @earnest phoenix

earnest phoenix
#

πŸ₯Ί

pale vessel
#

wait

#

parseInt truncates floats

delicate shore
#

You can find it on other bot list also

#

Oh

pale vessel
#

do you want to convert floats to integers?

#

if so then use parseInt()

earnest phoenix
#

?

delicate shore
#

What

#

Ok wait

earnest phoenix
#

@pale vessel why \n no work in CanvasRenderingContext2D.fillText();

light island
#

Hi, RichEmbed has been changed to MessageEmbed, right?

earnest phoenix
#

Hi, RichEmbed has been changed to MessageEmbed, right?
@light island And a few other changes too

#

hold up lemme fetch the docs

light island
#

Ah, alright. Thanks.

earnest phoenix
light island
#

Thanks.

earnest phoenix
#

There are WAY MORE changes than just embeds

light island
#

Yup, I've noticed

earnest phoenix
#

Thanks.
@light island nope

#

just chillin'

#

playing rock paper scissors that i coded

light island
#

That's cool.

pale vessel
#

@pale vessel why \n no work in CanvasRenderingContext2D.fillText();
@earnest phoenix because it just doesn't support it

#

you have to split it yourself and make a loop

earnest phoenix
#

is an express.js server with express static files better than repl.it's built-in HTML, CSS, JS servers

viral timber
#

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.'); } } });

slender thistle
#

Sorry what

#

Wdym repl's built-in servers

#

@viral timber any issues you sre facing? (errors, command not working)

earnest phoenix
#

Wdym repl's built-in servers
@slender thistle they have a language called HTML, CSS, JS which 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

viral timber
#

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

slender thistle
#

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

pale vessel
#

only member.id

slender thistle
#

Did they not?

viral timber
#

oh yes

slender thistle
#

member.hasPermission also

#

Or is that not how it works?

earnest phoenix
#

how do you fetch the cookies which the client sent?'

#

req.cookies?

vital lark
#

ye

earnest phoenix
#

ok

#

do i need an extra thing for parsing cookies?

#

express.js docs say cookie-parser middleware

cinder patio
#

yeah you need that

#

You can also parse the cookies yourself from the cookies header

viral timber
#

i used member when i check if the message author has permissions

earnest phoenix
#

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

unique patio
#

Have you tried plugging your internet in?

earnest phoenix
#

after a quick reload it works

#

the app literally wasn't running

#

even though it showed that it was

unique patio
#

Sounds like a driver issue

#

have you defragged recently?

earnest phoenix
#
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

slender thistle
#

Numbers are supported in JSON, no?

pale vessel
#

yes

earnest phoenix
#

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

vital lark
#

no

#

it has to be like

#

res.cookie('score', '0', { httpOnly: true });

#

or res.cookie('score', { score: 0 }, { httpOnly: true });

earnest phoenix
#

bruh

pale vessel
#

isn't that what JSON.stringify(0) does

earnest phoenix
#

i added that just to be safe

pale vessel
#

never mind

#

wait

#

they said "or"

#

so shouldn't yours work?

earnest phoenix
#

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

pale vessel
#

JSON.stringify(0) would return "0"

earnest phoenix
#

also 0 is a falsy value

ionic shard
#

am i missing out if im not using commando?

earnest phoenix
#

not necessarily

ionic shard
#

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

pale vessel
#

am i missing out if im not using commando?
@ionic shard no, i don't even use any frameworks

ionic shard
#

hum ok

pale vessel
#

i'd say noob-friendly i guess

#

but it's expandable

ionic shard
#

okay thanks

frank lava
earnest phoenix
#

me

#

there is a way to set that

#

pretty simple

frank lava
#

How

#

Lol

earnest phoenix
#

yeah

#

discord is weird

#

@pale vessel can you set custom headers in HTTP requests?

pale vessel
#

yes why not

earnest phoenix
#

wtf

#
res.set("My-Custom-Header", "fuck");
ionic shard
#
    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

earnest phoenix
#

how could you do stuff to cookies in browser-js?

pale vessel
#

what is that

ionic shard
ionic shard
#

oh

earnest phoenix
#

what is that
@pale vessel i want to fetch the value of the score cookie and change it's value around and stuff

#

*get

#

no promises for cookies mmLol

pale vessel
#

is browser-js a package

earnest phoenix
#

no

#

it's stuff that runs outside of node.js on normal browsers

#

basically client side javascript

pale vessel
#

oh so just js

#

jeez

earnest phoenix
#

yes

pale vessel
#

you want to set a cookie?

earnest phoenix
#

yes

#

imma just read MDN before i explode your mind

pale vessel
quartz kindle
#

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

earnest phoenix
#

f

#

aeon say f

#

bruh

cinder patio
#

Aand you should make all cookies regarding auth HTTP only so they cannot be accessed by client-side JS

umbral zealot
#

true

#

session tokens should never be accessed by the page itself.

#

they should be secure, and httpOnly

earnest phoenix
#

document.cookie is returning nothing even though there are cookies set on the page???

umbral zealot
#

are those cookies httponly? πŸ˜›

earnest phoenix
#

i have such a big brain

#

ok

#

i got it to work

green kestrel
#

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
green kestrel
#

@pale vessel whats with the nick change lol

earnest phoenix
#

is it pointless to use cookies to store rockum paperum scissorsum score for the user for a whole freaking month

green kestrel
#

depends on your use case code913

tight plinth
#

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

earnest phoenix
#

just for storing the score for later

green kestrel
#

lol

#

whats yandere

tight plinth
#

yandere simulator

earnest phoenix
#

even though nobody store rock paper scissors scores for a whole month

green kestrel
#

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 😦

tight plinth
#

do like everyone here and use js

green kestrel
#

so instead of 630mb of ram and 2% cpu for 10k servers, i'd need several vps with 8gb ram? lulw

#

great idea! πŸ˜„

#

tbh the performance benefits outweight a bit of waiting

earnest phoenix
#

Does Discord delete images uploaded to their platform once in a while?

green kestrel
#

@earnest phoenix dont think so, unless you delete the message theyre attached to

solemn leaf
#

@green kestrel computer says yes?

earnest phoenix
#

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

faint prism
#

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

thick gull
#

i believe @earnest phoenix's bot is done on mobile

faint prism
#

I hosted a bot on mobile

#

It'll show "online" as expected, unless you do some coding

thick gull
#

which is pretty torturous on mobile

#

but somehow

#

people do it

#

respect

faint prism
#

I don't code on it, I SSH into my phone

thick gull
#

yeah

#

im pretty sure voltrex made his bot on mobile

#

like

#

entirely

faint prism
#

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

earnest phoenix
#

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

thin turret
#

hamburger.eat() returns cannot get .eat() of undefined

umbral zealot
#

hamburger is undefined.

thin turret
#

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

earnest phoenix
#

hamburger.eat() returns cannot get .eat() of undefined
@thin turret technically it should throw hamburger.eat() is not a function for methods

umbral zealot
#

not if hamburger was undefined thumbs

#

if it's undefined, how the hell would it know eat() is not a function?

earnest phoenix
#

not if hamburger was undefined :thumbs:
@umbral zealot it still throws the error

compact oriole
#

no?

#

if it's undefined, how the hell would it know eat() is not a function?
this

umbral zealot
#

It would throw the error he got. cannot get "eat" of undefined

earnest phoenix
#

nvm

thin turret
#

All I know was that hamburger was undefined KEKW

#

Well incorrectly defined

#

Do you guys know if .eat() returns a promise?

earnest phoenix
#

All I know was that hamburger was undefined KEKW
@thin turret Star Wars: Attack of the chicken burgers demise of the hamburgers

thin turret
vale garden
#

hi

#

lol

cobalt spruce
earnest phoenix
#

does SQLGate have their own service for hosting SQL servers
or do i have to fuck google cloud platform again for a free host

vale garden
#

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

earnest phoenix
vale garden
#

lol ik

#

this is a joke

#

but its a true problem im facing

earnest phoenix
opaque seal
#

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

vale garden
#

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
quartz kindle
#

is smessage defined?

#

also, what the fuck is that code

pale vessel
#

there's definitely a better way to do this, just saying lul

coral stirrup
#

how in the earth

quartz kindle
#

not to mention its skipping numbers because its doing i++ twice on every iteration

coral stirrup
#

yeah and fuck braces too right i mean who needs them anyways

quartz kindle
#

actually

#

its doing all of them at once

#

beause there is no else

#

lmao

coral stirrup
#

this is some weird piece of code my friend

quartz kindle
#

@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

earnest phoenix
#

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

coral stirrup
#

your site would need some graphical improvements

earnest phoenix
#

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

coral stirrup
#

and still, it would need some frontend improvements :^)

earnest phoenix
#

ok

coral stirrup
#

is this the "insane amount" you were talking about

earnest phoenix
#

nope

#

that's not the one

pale vessel
#

snake case \😳

earnest phoenix
#

the actual website is in a private repl

#

on my friends profile

pale vessel
#

no miner πŸ˜”

earnest phoenix
#

Leave Server

coral stirrup
earnest phoenix
#

this is not the one

coral stirrup
#

thats the source of the site we talked about

#

the online one

earnest phoenix
coral stirrup
#

??

pale vessel
earnest phoenix
#

why

#

???

coral stirrup
#

unnecessary

earnest phoenix
#

smh

#

<link> has no closing tag

#

so putting a slash in the same tag tells the browser hey this tag has no closing tag

coral stirrup
#

smh

#

its unnecessary because the browser knows that <link> has no closing tag

earnest phoenix
#

There’s also a number of other popular databases including MySQL, NoSQL and PostgreSQL.
what kind of article puts MySQL and NoSQL on 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

coral stirrup
#

yes

earnest phoenix
#

wut

#

imma head out

#

i'm getting confused every second

pale vessel
#

bro this ain't xml

earnest phoenix
#

bro this ain't xml
@pale vessel this is discord duh

pale vessel
#

you probably do <img src=""></img> too

coral stirrup
#

lmao

sturdy ridge
#

lol

earnest phoenix
#

you probably do <img src=""></img> too
@pale vessel nope i just do <img src="" />

swift radish
#

brah

pale vessel
#

that's-

earnest phoenix
#

not cool

pale vessel
swift radish
#

<h1> BOTS</h1>

#

<p>Bots are cool</p>

sturdy ridge
#

lol

pale vessel
#

nice

swift radish
#

<img src="the img you want"alt="the stuff u wanna type"

#

and a pooopoo

pale vessel
#

poggers

swift radish
pale vessel
#

i see potential

swift radish
#

discord no provide coding

#

need to do it on a browser or smthin

pale vessel
#

<a> and alt attribute 😳

restive furnace
#

<thing /> is valid

#

yes

swift radish
#

</thing>

restive furnace
#

so no need to edit to <thing </thing>

#

but <thing> </thing> wrosk

swift radish
#

batch file

fierce bane
#

hi can i ask here?

swift radish
#

what u wanna learn what to do?

eager nest
swift radish
#

lul

cinder patio
#

In React every element has a closing tag so maybe that's where you got confused from

restive furnace
#

in html almost every have it too

pale vessel
#

closing tags are fine for compatibility but it's not needed in html5

restive furnace
#

what

#

you don't need closing tags

#

?

compact oriole
#

or in react (I think?)

#

React might compile it to have them

pale vessel
#

for self closing tags

#

not something like </p>

compact oriole
#

<iframe />

#

for example

pale vessel
#

iframe is <iframe></iframe>

#

never mind

earnest phoenix
#

i've started a giant conversation about closing tags
what have i done

quartz kindle
#

only some tags can be self enclosed

earnest phoenix
#

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
#

@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

quartz kindle
#

Β―_(ツ)_/Β―

#

@earnest phoenix ignore bots

#

in discord.js you can do if(message.author.bot) return

violet mesa
#

i think its the same in python if u dont use from discord.ext import commands

pale vessel
#

context has author too, if that's what you mean

violet mesa
#

if message.author == client: return i think this would work

pale vessel
#

wouldn't that only ignore the bot itself?

violet mesa
#

idk

#

im not smart

pale vessel
#

same

#

idk python nor dpy

violet mesa
#

lol

#

like

pale vessel
#

how come

violet mesa
#

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

slender thistle
#

what

violet mesa
#

yes

#

lmao

compact oriole
violet mesa
#

comfuse and run

pale vessel
#

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

slender thistle
#

Can I integrate it?

autumn aspen
#

guys Im about to do a serverlockdown command

earnest phoenix
#

ignore only bot my self don't other bot

faint prism
#

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

slender thistle
#

Is it a request for help with coding one or request for someone to make one?

earnest phoenix
#

Help with coding lol

faint prism
#

Just ask your questions here

slender thistle
#

Yeah I'd suggest just asking here

#

that message can be misinterpreted as if you were asking someone to code a bot for you

earnest phoenix
#

I'll delete then :>

slender thistle
#

and we generally do/want to encourage users to ask questions in public channels unless it's too occupied

faint prism
#

Also, in case anyone else has a similar question

slender thistle
#

so Β―_(ツ)_/Β―

earnest phoenix
#

I have another question but idk where to ask it

slender thistle
#

is it related to top.gg or coding?

earnest phoenix
slender thistle
earnest phoenix
#

Thank you

slender thistle
#

I'd suggest skimming through channel topics while you're here

earnest phoenix
#

How can I see the time spent on an activity
https://discord.js.org/#/docs/main/stable/class/Activity

pale vessel
#

you already knew the activity docs, try looking through it lul

misty sigil
#

fuck sake

#

Flaz beat me

faint prism
#

@sage bobcat I see you're directly calling a MongoDB in your command

sage bobcat
#

One message removed from a suspended account.

faint prism
#

May want to consider something more abstract

sage bobcat
#

One message removed from a suspended account.

faint prism
tired panther
#

when I want to search a bot is it? const dis = await client.guilds.cache.get(message.guild.id).users.cache.get(bot);

misty sigil
#

no?

tired panther
#

?

#

then what?

#

const dis = await client.guilds.cache.get(message.guild.id).members.cache.get(bot);

#

??

#

@misty sigil

misty sigil
#

I don’t know?

fickle sapphire
#

client.users.cache.get()

#

or client.channels.cache.get()

#

depends what you’re searching for

digital ibex
#

whats ur issue, @tired panther ?

earnest phoenix
#
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

tired panther
#

@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);

digital ibex
#

whats the error?

tired panther
#

if(!dis){return message.channel.send("bla bka");}

earnest phoenix
#

Nvm

#

I got it

tired panther
#

no error

#

it is sending the message even if the bot is in the server

#

@digital ibex

digital ibex
#

what does dis log?

tired panther
#

if the bot is in the server || true / false

thick gull
#

isn't that going to be true regardless ??

gentle lynx
#

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?

digital ibex
#

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

tired panther
#

no its a command

#

i have found the bug forget the " " bei the number xD

autumn aspen
#

is it nice?

jagged oyster
#

(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

digital ibex
#

wrong channel mate

split hazel
#

@jagged oyster all set

jagged oyster
#

thanks!

slate oyster
#

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?

digital ibex
#

wut

sudden geyser
#

have less friends and servers

#

or give yourself a cookie for every X minutes worth of coding

quartz kindle
#

discord eats your soul

slate oyster
#

Less friends and servers is hard
I can go buy some cookies I guess

misty sigil
#

or give yourself a cookie for every X minutes worth of coding
@sudden geyser cookies as motivation

#

nice idea

sudden geyser
#

yeah but one problem

#

I don't have any

misty sigil
#

just exercise every once in a while

hearty wren
#

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

sudden geyser
#

What library are you using

autumn aspen
#

guys if u want ur bot to mention a channel how would it be?

sudden geyser
#

<#channel-id>

autumn aspen
#

thx

slate oyster
#

Lemme guess
Mu is not using a library
Writing their own

autumn aspen
#

<#channel-id>
@sudden geyser is it message or just that

sudden geyser
#

Take [#development](/guild/264445053596991498/channel/272764566411149314/) for example. That becomes #development

autumn aspen
#

yeah ik

hearty wren
#

Im using requests with python, a very basic webhook just to try embeds

autumn aspen
#

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

gilded plankBOT
autumn aspen
#

oops

sudden geyser
#

The inside of ${} should have the expression on getting the channel ID.

#

<#> is just part of the content of the message.

split hazel
#

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)

autumn aspen
#

<#> 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

compact oriole
#

Speedy

#

if you are using js, try this out

autumn aspen
#

@compact oriole can I get some help

#

with my pb

compact oriole
#

pb?

autumn aspen
#

problem

compact oriole
#

I am helping Speedy LUL

split hazel
#

not really helpful, i want to do it via a query not 3rd party service

compact oriole
#

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

autumn aspen
#

look ${message.channel.id} I want it to say the channels name not the id of it @compact oriole

compact oriole
autumn aspen
#

bc this tells the id only

#

@compact oriole man can u help me pls lmao

compact oriole
#

no

autumn aspen
#

ok

#

no
@compact oriole thx

compact oriole
#

stop pinging me also

autumn aspen
#

πŸ–•

compact oriole
autumn aspen
#

${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?

opal plank
#

@split hazel best i can tell you is use WITH

#

for function

misty sigil
#

lmfao pog middlefinger

compact oriole
#

poggers

sick pelican
#

how to make a message in slowmode so anyone cant spam it?

split hazel
#

i found in to work best

opal plank
#

WITH (SELECT NAME FROM public.TABLE WHERE user = 'user') AS USER
SELECT * FROM public.TABLE where USER = USER AND premium = true

split hazel
compact oriole
#

this is why I hate sql...

opal plank
#

i dont use many IN's tbh

sick pelican
#

can anyone help me?

#

?

opal plank
#

@sick pelican you want a cooldown, if i got your question correctly

sick pelican
#

yeah

opal plank
#

you uysing d.js?

sick pelican
#

yes

opal plank
sick pelican
#

ok thx

opal plank
spring lance
#

Is Visual Code Studio the best for programming app?
is it the best programming app?
I'm new

slender thistle
#

The only best app os tje one you like

opal plank
#

@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

sick pelican
#

@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?

opal plank
#

it depends on your tastes tbh

spring lance
#

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

opal plank
#

@sick pelican in the same guide i sent you, look for command handling

sick pelican
#

ok

slender thistle
#

Which programming language do you want to write in?

opal plank
#

good? no, its fantastic

spring lance
#

Python

opal plank
#

VSC has everything and more that you'll need

spring lance
#

Javascript

#

Ok πŸ™‚ πŸ™‚

slender thistle
#

Well, ig VSC and you could try out JetBrains IDEs like PyCharm

spring lance
#

Do you guys have any videos on a VSC tutorial

opal plank
#

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

spring lance
#

Ok how old do you recommend beginners be

opal plank
#

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

spring lance
#

So it might be difficult

#

tbh

opal plank
#

not quite

#

like i said, commitment

slender thistle
#

It's all about commitment and time

#

and being patient

opal plank
#

the more you pour into it, the more experienced you'll get

spring lance
#

yea for sure

slender thistle
#

We learn differently

eternal osprey
#

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

umbral zealot
#

function() isn't how you write a function.

#

oh wait, no, I was not seeing the correct syntax here, sorry

compact oriole
#

I think it is?

#

yea

opal plank
#

thats callback lol

umbral zealot
#

yeah no I was wrong there, 100%, sorry

compact oriole
#

I always use () => {}

opal plank
#

define T

compact oriole
#

because arrow function gang

umbral zealot
#

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

opal plank
#

that too

#

what is T btw?

somber lynx
#

i finshied my bot

umbral zealot
#

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.

compact oriole
#

anything else is better

#

well almost

opal plank
#

its funny that they havent even replied yet

umbral zealot
#

Β―_(ツ)_/Β―

opal plank
#

also this triggers me

#

let;
let;
let;

eternal osprey
#

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.

opal plank
umbral zealot
#

Alright, well, go ahead and use readFileSync then

#

Though I hope this won't ever be used on multiple guilds.

eternal osprey
#

it's just for one guild

umbral zealot
eternal osprey
#

one command only.

#

hwoever, i am still facing that command.

umbral zealot
#

Alright, readFileSync it is

eternal osprey
#

should it be readFile

umbral zealot
#

no

eternal osprey
#

instead of readFileSync.

umbral zealot
#

No, jesus christ, dude

spring lance
#

How do I get the early supporter badge

umbral zealot
#

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.

spring lance
#

😭

umbral zealot
spring lance
#

So I can't ever get the badge?

#

Like is there a badge still?

#

Like a newer version obtainable

umbral zealot
#

No, there is no more badge, and there will not be one to replace the early dev badge.

eternal osprey
#

hmm so it worked.

spring lance
#

Early Verified Bot Developer?

#

😦

eternal osprey
#

however, i am getting cannot read property id of undefined?

spring lance
#

Verified bot developer

#

im so confused

umbral zealot
#

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.

spring lance
#

So the new version is Verified bot developer?

#

πŸ™‚

umbral zealot
#

Are you daft

#

There is no new version, you stale muffin.

#

You can't get a badge. You don't get a badge.

eternal osprey
#

evie.Codes, what gender are you?

spring lance
#

LOL

opal plank
#

gender fluid

umbral zealot
#

I don't see how that's relevant to anything.

opal plank
spring lance
#

Exactly Evie stop talking

umbral zealot
#

@opal plank don't speak for me, honey.

spring lance
#

Your being rude for no reason

opal plank
#

right mr apache helicopter @umbral zealot

eternal osprey
#

Def a girl.

umbral zealot
#

Can we get back to development

restive furnace
#

@spring lance explain me how's she/he rude? Evie is trying to explain you.

umbral zealot
#

Repeatedly πŸ˜‚

#

@eternal osprey what's in your json file right now?

eternal osprey
#

just []

#

i think that the error is coming from this part:

#

fs.writeFile("./data.json", [channel.id])

sonic lodge
#

you're getting the first element from that array

umbral zealot
#

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.

sonic lodge
#

let channel= JSON.parse(rawdata)[0];

#

there is nothing to get

eternal osprey
#

okay.

#

so i should have the setchannel command above my other code?

#

so it first writes, then checks.

umbral zealot
#

What would it be writing?

#

why are you writing it at all, in fact, if you're not actually updating that value?

eternal osprey
#

the channel id of the channel where you use !setchannel.

umbral zealot
#

That's message.channel

#

not just channel

eternal osprey
#

i know i tried that

#

it gave me that callback shit error again

umbral zealot
#

because writeFileSync too πŸ˜‰

lime jewel
#

is there a way to check if a user nitro boosted a guild with discord.js v 12?

cinder patio
#

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?

gentle lynx
#

how can i check if result is empty

#

(it doesnt work like this)

#

when its not empty it sends [object Object]

earnest phoenix
#

look at how result looks when it's empty

#

then check for that

misty sigil
#

i wonder what this place is gonna look like on the 8th oct

#

or was it 7th

gentle lynx
#

the first one is when its empty

sudden geyser
#

is result an array

gentle lynx
#

i honestly dont know

#

ill check wait

#

its an object

cinder patio
#

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

quartz kindle
#

or console.log it first to see what it looks like

gentle lynx
#
[
  RowDataPacket { ID: 659633074400788500, Premium: 0, BlackListed: 0 }
]
#

ah ok

#

i did result.toString() == ""

#

now it works

#

thanks

sudden geyser
#

By the way, you may want to store the user ID as a string

gentle lynx
#

ill change it

#

varchar

#

anyways thanks for the help πŸ‘

slender thistle
#

Man, I need to update all my bots

sudden geyser
#

for what though

slender thistle
#

intents

#

It's like 5 bots, I need a list of all intents and what they do ngl

zenith knoll
#

hi annie

earnest phoenix
#

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

zenith knoll
#

no spoonfeeding remember

earnest phoenix
#

pls

#

:(

#

ok

#

sorry

zenith knoll
#

lmao they still can help

earnest phoenix
#

ik

slender thistle
#

Well

#

What's the error

earnest phoenix
#

idk

#

the ; at the end is supposedly an error

slender thistle
#

See the error VSC is giving you

#

; in JS isn't an error

earnest phoenix
#

What should I fix

zenith knoll
#

hover over the red lne

#

what does it say

earnest phoenix
#

okay

zenith knoll
#

since we dsont have access to whole code

earnest phoenix
#

} expected.

zenith knoll
#

lmao u missed a } somewhere then

#

prob in a function ending

earnest phoenix
#

Then add a }

slender thistle
#

You either put an unnecessary { somewhere or ^

earnest phoenix
#

Okay

#

thanks

#

It's still not working .__.

#

If i put a { somewhere there's error on client

sudden geyser
#

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

slender thistle
#

πŸ˜„

earnest phoenix
#

πŸ˜„

#

@slender thistle yeah?

#

what should I import

slender thistle
#

you shouldn't import anything other than dbl

earnest phoenix
#

oh okay

slender thistle
#

but oh look you decided to name your file that

#

so everything is breaking because you used a module's name

earnest phoenix
#

it is now working

#

thanks!

slender thistle
#

πŸ‘

autumn aspen
#

Guys I forgot what softban was lol

#

?

#

Can someone explain for me?

#

-help

sinful belfry
#

is this referring to a specific bot?

earnest phoenix
#

-help

#

I added a bracket but it says im wrong

green kestrel
#

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

misty sigil
#

20tb swap

#

BRUH

restive furnace
#

yeah cool

#

20tb swap

#

and you are using raw new/delete or malloc/free, right?

autumn aspen
#

20tb swap
@misty sigil whats softban

fast trench
#

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

earnest phoenix
fast trench
#

Remove the last character πŸ€¦β€β™‚οΈ

earnest phoenix
#

it still doesnt work

restive furnace
#

learn how to indent

earnest phoenix
#

wha

#

do

fast trench
#

Show more code

earnest phoenix
#

you

#

ok

fast trench
#

In a sourcebin

umbral zealot
#

Look you have a syntax error, you're missing a } or a ) somewhere for sure

earnest phoenix
fast trench
#

All of it

umbral zealot
#

after pasting, do CTRL+S and send us the URL you get

earnest phoenix
#

um

#

are u gonna steal my code :(

#

lol

umbral zealot
#

Do you really think you've done something that a thousand people haven't already

earnest phoenix
#

oh ok

#

fine

#

:C

#

why do you feel that someone would like to steal your non working code

#

its over 2000 characters

#

bin it

umbral zealot
earnest phoenix
#

or that

#

okok

#

i did what u said

green kestrel
#

Yeah lol

#

It's not really there

umbral zealot
#

Man, it's so hard to follow instructions.

earnest phoenix
#

oml

#

Man, it's so hard to follow instructions.
whitenames

green kestrel
#

The lib I linked finds illegal writes to memory by claiming all memory and intercepting the writes

earnest phoenix
#

ree

#

humh?

green kestrel
#

Like, ALLL memory. Can you imagine having 20tb ram lol

earnest phoenix
#

omL im so confused

#

this

#

"

#

?

umbral zealot
#

finally

earnest phoenix
#

o

#

you never close your message listener

#

what?

#

yikes

umbral zealot
#

Line 7 opens a function to receive messages

#

you're never closing that function

earnest phoenix
#

whereee

#

help vampire

umbral zealot
#

Is this time to bring out the learnjs thing

earnest phoenix
#

ik

#

;-;

#

=> {}

#

?

#

do you understand the code that you wrote

#

or did you copypaste

#

that part was spoon fead :>

#

well