#development

1 messages · Page 1350 of 1

midnight brook
#

lol\

#

@dark grove you forgot theres more than one opt

message.react('735903870609391657')
                    .then(reaction => reaction.message.react('735903836727935098'))
                    .then(reaction => reaction.message.react('750759552542310410'))
                    .then(reaction => reaction.message.delete({ timeout: 5000 }))
                    .then(msg => console.log('Message Deleted!'))
                    .catch(err => console.error);
dark grove
#

@midnight brook idk why i cannot see those messages but that worked thanks

midnight brook
#

yea

indigo flax
#

so rn, im using .json for database, but my bot always crashes because the size is 57.7 GB

#

i wanna switch to mongodb

#

if(message.attachments.first()){//checks if an attachment is sent
if(!storage[message.guild.id][type]){
storage[message.guild.id][type] = []
fs.writeFile("./storage.json", JSON.stringify(storage), (err) => {
if(err) console.log(err)
});

#

fs.writeFile("./storage.json", JSON.stringify(storage)

earnest phoenix
#

yikes

grizzled raven
#

58gb bruh

#

is that all you store?

#

cause if so switching won't be hard, aside from setting it up

feral kiln
#

Hi, what is the rate limit in creating emojis? I have a command that creates some via requests to a git repository, adds them as reactions to a message (reaction roles), and then deletes them and I want to know if there needs to be a cooldown for this

crimson vapor
#

wait what

#

60gb of json

#

how does it not fuck your cpu every time you read your db

spark wharf
#

Hi, I'm trying to make a system so that whenever someone messages my bot it creates a channel for staff members to message them. Currently I have it so that it opens a channel for every message they send, I just don't know how to make it so it only opens 1 channel per user. Could someone help me with this please? I will attatch the code here:

@client.event
async def on_message(message):
    if message.author.bot:
        return

    if isinstance(message.channel, discord.channel.DMChannel):
        guild = discord.utils.get(client.guilds, name="Snappy Support")
        role = discord.utils.get(guild.roles, name="Support")
        role1 = discord.utils.get(guild.roles, name="Member")
        overwrites = {
            role: discord.PermissionOverwrite(read_messages=True),
            role1: discord.PermissionOverwrite(read_messages=False),
            guild.me: discord.PermissionOverwrite(read_messages=True)
        }
        category = discord.utils.get(guild.categories, name="Support")
        for member in message.guild.members:
            channel1 = await guild.create_text_channel(f"{message.author}", overwrites=overwrites, category=category)
            channel = discord.utils.get(guild.channels, name=f"{channel1}")
            await guild.delete_text_channel(guild.channels, name=f"{channel1}")
            e = discord.Embed(title=f"{message.author} said:", description=f"__`Content:`__ **{message.content}**\n \n __`Their ID:`__ {message.author.id}", color=0x0000ff, timestamp=message.created_at)
            await channel.send(embed=e)
    await client.process_commands(message)
    pass
opaque seal
#

I need to access the commands dir from the commandHandler.js file at line 26
Idk why it's wrong

crimson vapor
#

which file did you give a screenshot of?

opaque seal
#

commandHandler.js

indigo flax
#

cause if so switching won't be hard, aside from setting it up
@grizzled raven well

#

theres

#

storage.json

#

disabled.json

#

prefix.json

#

slowmode.json

grizzled raven
#

oh ok nvm

cunning shell
#

Bot going offline at every 30 seconds Why help me experts

sonic lodge
#

i need way more information than "bot goes offline"

#

are there any errors

indigo flax
#

oh ok nvm
@grizzled raven ?

delicate shore
#

Is there any way that when a person opens my website
It automatically changes to desktop version without person pressing Request desktop site

jagged sun
#

Hey, with which event in discord.js can I easily check if my Discord Bot gets disconnected from a Voice Channel?

trim saddle
#

@delicate shore media query css

indigo flax
#

Is there any way that when a person opens my website
It automatically changes to desktop version without person pressing Request desktop site
@delicate shore yes

#

css

trim saddle
indigo flax
#

Hey, with which event in discord.js can I easily check if my Discord Bot gets disconnected from a Voice Channel?
@jagged sun voiceChannel.leave

jagged sun
#

@indigo flax can you show me an example?

tired panther
#

```client.shard.broadcastEval(this.channels.cache.has(${"${remind.chnnlid}"}) ? this.channels.cache.get(${"${remind.chnnlid}"}).send(${"<@${remind.lastbump}>"}) : null ).then(console.log);
any idea, why it can not ping the user?

with a normal message, it works
trim saddle
#

uhhh

#

${`"<@${remind.lastbump}>"`}
this isn't a valid string

faint prism
#

Egad, what is that

trim saddle
#

what are these strings

faint prism
#

Wouldn't this be the right thing in JS for interpolation?
`<@${someVariableHere}>`

tired panther
#

okay let me try

#

with the `` @faint prism ?

faint prism
#

Well

#

Isn't that what JS uses for string interpolation?

#

That allows the ${} syntax inside a string?

tired panther
#

node js

faint prism
#

JS, nodejs. Roughly same thing

#

Try googling "JS string interpolation"

#

NodeJS is just the independent version of JS for running outside a browser

#

Same syntax. Different API calls

tired panther
#

Wouldn't this be the right thing in JS for interpolation?
`<@${someVariableHere}>`
@faint prism that will not work becuase it is alread in the broadcasteval ein ``

pale vessel
#

then just put <@${someVariableHere}>

#

if that variable is a user/member object, you can just use ${variable}

faint prism
#

Did you look up the syntax for string interpolation?

#

You only need to do those back ticks once to specify a string that will be interpolating a variable

delicate shore
#

For the user

pale vessel
#

no, it changes the style based on the screen size

trim saddle
#

you can add a button with javascript

carmine summit
#

How do I fetch the guild that has no members

faint prism
#

You can overrride mobile media-specific with css, but I personally hate when sites force me to use desktop on a mobile screen

snow urchin
#

Is there anyway to have the prune method list the users, or will it only show the count.

carmine summit
#

And can I get a cleaner code of

guild.channels.forEach(async c => {
let msg = await c.send('Thanks for adding me into your guild')
if (msg) return
})
snow urchin
#

dont be lazy to press tab twice

#

Also... dont sent that to every channel

carmine summit
#

Nvm that didn't work and sent a message to all the channels

#

Its a pain in da ass to delete all the message

#

S

boreal iron
#

just write a command searching for messages by the bot id and removing them

carmine summit
#

if (msg.id) return

#

???

snow urchin
#

....

faint prism
#

lol

#

there isn't a comparison there

#

I guess it would be, if (that's null)

#

idk the d.js properties of their objs though

snow urchin
#

Is there anyway to have the prune method list the users, or will it only show the count.

earnest phoenix
#

if i pass a variable in an if statement will the if statement run the code based on the value of the variable or whether the variable exists or not?

pale vessel
#

why are you using async in forEach

#

that'll never work

snow urchin
#

it goes off
null, undefined, 0, false
string, number > 0, true
@earnest phoenix I think anyways, prob missing some

#

Hi

#

this aint the place for a conversation

faint prism
#

Unless it's about development

#

also, dotpost

snow urchin
#

.

earnest phoenix
#

Hi

#

How to create a covid 19 tracker bot

#

Thing

#

well

#

I could send u mine

#

but eh

prisma oriole
#

you'd need an external api for that

earnest phoenix
#

Ohk

delicate shore
#

if(msg) return

#

My website was facing issues on mobile

#

So I did this

#

If user is on mobile

#

He redirects to old website

#

Does it put a bad impression ?

earnest phoenix
#

Yes

#

Since old website

#

Will impact customers

#

Waiting time

#

Cloudfare

#

will take time

#

@delicate shore btw, how u made website and host it

umbral zealot
#

Step 1) Make a website
Step 2) Upload it to a host.

boreal iron
#

Or host it yourself

lilac dagger
#

lmao

boreal iron
#

Which sense makes a 10s redirect countdown if u can't cancle it? Why waiting 10s if so?

#

Just do an instant redirection if on mobile...

restive furnace
faint prism
#

man, I love that site

hollow sedge
#

@delicate shore lol i just went to your website..those reviews sound so fake

boreal iron
#

lmao

faint prism
#

Simple HTML/CSS to get static information across

boreal iron
#

aye, and a little js to create a "smooth" feeling for the user, if needed, not really complicated

#

even in 2020 I'm still coding in strict html and css2.0 (max) to ensure the website will look identical on each browser no matter the user lives in 1990 and uses IE

#

and they still look good, in my mind

hollow sedge
#

@delicate shore your bot has a howgayme command, doesnt sound homophobic at all

faint prism
#

Totally. I really try to avoid JS for visual elements unless it's really something CSS can't do

#

Which is a actually kind of surprising how much it can do

restive furnace
#

Also that cross-compat is a bit misleading, you can even use es3 in js too so IE7 is able to load it prob

boreal iron
#

how old are u, to feel triggered by a command called howgayme ... 12?

rustic nova
faint prism
#

Tbh, doesn't every bot have that command?

hollow sedge
#

ask yourself why there is never a howstraightme command

#

and then get back to me

boreal iron
#

aye, CSS 2.0 has a lot of possibiliets, some are just a bit more to do instead of using CSS3.x

#

what at the end the result is similar

faint prism
#

I've seen complete animations with CSS, pretty wild stuff

boreal iron
#

aye, I have to say I'm more focused on building a 100% responsive site, even supported by IE, than doing all the fancy bullshit available in CSS3.x supported only by the latest browsers

restive furnace
#

if i needed website i would probably for real only use HTML5 + CSS2.0

faint prism
#

Oh wow... HP LoadRunner Analysis outputs Netscape-compatible HTML reports

restive furnace
#

but the files probably start growing from my 100 lines of react code into 5000 html code with script tags to make requests into my REST api

#

and some random animations

faint prism
#

Quite true

#

I suppose that'd be why people opt for JS over native CSS

boreal iron
#

Well that’s the moment frameworks like bootstrap taking into place

restive furnace
#

wait can u use bootstrap in HTML5?

faint prism
#

I can't see why not

boreal iron
#

Im personally not a fan of overloaded sites with lots of animations etc

faint prism
#

yeah same

boreal iron
#

...anyways

#

It increases the loading time anyways and I’m always try to calculate in mobile device users with slow connections, too

pale vessel
#

wait can u use bootstrap in HTML5?
@restive furnace ...you don't?

boreal iron
#

It’s like to find a balance between loading time, and overall look, “smoothness” and the users stupidness how to do things

restive furnace
#

so basically you should use CSS and HTML only if you don't want complains about your users with slow connections that site is not loading?

boreal iron
#

I think it’s not possible to call it out like that.
Lots of background images or not well optimized code can be an issue, too

delicate shore
#

I made it work out

boreal iron
#

Working with a lot of colors instead of images and maybe some shadows (webkit stuff etc) should be good enough

#

Maybe not what younger people today would prefer but fast and easy to see and understand what u have to do

sudden geyser
#

The alternative (e.g. colors > image) is more native

obtuse jolt
toxic glade
#

hi

#

why

earnest phoenix
#

Any buddy know what is image xray id

umbral zealot
#

"image xray id"? What are you trying to ask?

faint prism
#

Lol

earnest phoenix
#

ctrl +shift+i

umbral zealot
#

That's... the developer tools, what does that have to do with images?

earnest phoenix
#

Yes

#

Then refresh page

#

And

#

Search

#

Xray

umbral zealot
#

uhm...

quartz kindle
#

Are you talking about Ray ID?

earnest phoenix
#

Yes

quartz kindle
#

Thats a cloudflare request identifier

earnest phoenix
#

Different image

#

Different id?

quartz kindle
#

All requests have a unique id

#

Even the same image should have a different id every time you reload

earnest phoenix
#

👍

willow mirage
#

@quartz kindle help me

#

i made a express server

#

in my vps

#

and then i get my vps's ip

#

fetch(the ip)

restive furnace
#

port forward

willow mirage
#

it says couldn't connect

#

i did

#

with port

#

IP:port

restive furnace
#

you connect to wrong port or did not port forward

willow mirage
#

no

#

it is correct port

restive furnace
#

then you did not port forward

willow mirage
#

on localhost run normaly (on my pc)

#

but when i push it to vps

#

i can't

umbral zealot
#

Your VPS either has a firewall, or it's missing a port forward.

willow mirage
#

oh

#

im dumb

restive furnace
#

I said that before lol and you said you did, never lie to helpers or you only get guesses what's wrong.

willow mirage
#

but ur explain way

earnest phoenix
#

c7818399c1a581e3 what is any idea

#

@quartz kindle

umbral zealot
#

What are you even asking

earnest phoenix
#

image code

#

??

umbral zealot
#

Do you mind trying to use more words, because "image code" isn't a question or something anyone can address.

earnest phoenix
willow mirage
#

omg

earnest phoenix
#

see

#

this

#

and say

willow mirage
#

just copy a part of code

#

show the console

umbral zealot
#

What's this code for? Where did you get it?

earnest phoenix
#

github

umbral zealot
#

Ok well, ask whoever Wrote it

#

we have no idea what that is

earnest phoenix
#

lol

umbral zealot
#

Except "it's an object"

earnest phoenix
#

u know imghash

umbral zealot
#

no

pale vessel
#

image hash?

umbral zealot
#

Just realized those are pokemon images.

earnest phoenix
#

npm i imghash

umbral zealot
#

ok what about that?

earnest phoenix
#

imghash

tulip ledge
#

Whats teh issue?

tame kestrel
#

@umbral zealot Hi evie! I really appreciate your enmap project, although some of my projects outgrew it a bit, I think it's really useful for hacking things together

umbral zealot
#

Thank you!

#

I had a lot of fun doing it 😄

tame kestrel
#

^.^

umbral zealot
#

You might appreciate JOSH for growth and scaling though. By the same author 😛

#

(though it's still in pre-release)

tame kestrel
#

oh very interesting!

#

thank you 🙂

earnest phoenix
#

how can i acces the guild object via a reaction collector?

#

I kinda need help, i can't quite figure this out. The array contains this [ '1,-3,4', '2,5,2', '4,-1,-2' ] but whenever i run this line of code to push it to a bigger array
array.forEach(element => array_2.push(element.split(',')));

it turns into this pattern of 0's and 1's: [0,0,1] , [0,1,0] , [1,0,0] where the 1's are the highest number and the 0's are every other number.

i dont know why exactly this is happening, can anyone tell me what im doing wrong

quartz kindle
#

@earnest phoenix you want to know what is imghash for?

tame kestrel
#

how can i acces the guild object via a reaction collector?
@earnest phoenix Can you just use the guild object from the message you create the collector from?

#

@earnest phoenix are you trying to make it like [ [ "1", "-3", "4" ], [ "2", "5", "2" ], [ "4", "-1", "-2" ] ]

or like

[ "1", "-3", "4", "2", "5", "2", "4", "-1", "-2" ]

#

or am I missing something

opal plank
#

i think he wants to sort it

#

1's are the highest number and the 0's are every other number

#

i didnt understand what they are trying to do either tbh

earnest phoenix
#

no its only supposed to look like this[ [ 1, -3, 4 ], [ 2, 5, 2 ], [ 4, -1, 2 ] ] because that is the format i gotta put it into to solve it using a linear equation system library

#

the only problem is that the numbers are turning into 0s and 1s

#

and i dont know why its happening

opal plank
#

we see where you starting, but can you provide an output example?

tulip ledge
#

u might wanna send full code then

opal plank
#

where you even getting 0's and 1's at from that array?

tame kestrel
#

rip I have an exam to start in like 5 mins but

var a = [];
[ '1,-3,4', '2,5,2', '4,-1,-2' ].forEach(element => a.push(element.split(',')));
console.log(a);```
#

works just fine for me, what you had originally

opal plank
#

var AND forEach()

#

you tryna rack up points safe?

#

lol

earnest phoenix
#

var AND forEach()
@opal plank they're using var so they can push elements to the array and you can't change the value of a const

tame kestrel
#

I was just chucking whatever he had into my browser's console pepeCRY

opal plank
#

you can use let on console too

tame kestrel
#

o rlly

#

weh

#

til

opal plank
#

let/const are native js

earnest phoenix
#

You can also use await on a browser console even tho it's not supposed to be an async function

tame kestrel
opal plank
#

still forEach() though, but getting there

earnest phoenix
#

@opal plank

This is what the array looks like[ '1,-3,4', '2,5,2', '4,-1,-2' ]

This is what array_2 looks like before the code: var array = [];

This is what the line of code looks likearray.forEach(element => array_2.push(element.split(',')));

This is what the array_2 that the array is being pushed into looks like after the line of code: [ [ 0, 0, 1 ], [ 0, 1, 0 ], [ 1, 0, 0 ] ]

tame kestrel
#

oh whale

tulip ledge
#

ur overwriting array

opal plank
#

just a reminder, they all in string form

tulip ledge
opal plank
#

here

earnest phoenix
#

oops

#

that was a typo

#

not in the code

#

@tulip ledge i renamed the arrays for the discord messages for easier understanding cause in the code they have other names so that was a typo

#

but im not overwriting the array

opal plank
earnest phoenix
#

@earnest phoenix just send your whole code man

#

I'm p sure you're having false negatives (is that what you call em)

opal plank
#

are you parsing the numbers by any chance?

pale vessel
#

wouldn't map be suffice?

opal plank
#

map would work too

#

like i said, im biased with for loops

#

just preference

pale vessel
#

based

opal plank
#

BIASED

#

bias

pale vessel
#

based af

opal plank
earnest phoenix
#

are you parsing the numbers by any chance?
@opal plank could be, the input syntax looks like this =solvesys 1,-3,4 / 2,5,2 / 4,-1,-2 = -5,27,-19

and the code is this:

var equations = [];
var input = msg.content.toString().substring(9).trim();
var input = input.replace(/\s+/g, '');

var inputsplit = input.split('=');
var inputsplit1 = inputsplit[0].toString().trim();
var inputsplit2 = inputsplit[1].toString().trim();
var inputsplit1_array = inputsplit1.split('/');

inputsplit1_array.forEach(element => equations.push(element.split(',')));
var solutions = inputsplit2.split(',');

var SOLVE = linSystem.solve(equations,solutions);
var style_decimal = {
    style: "decimal"
}
var SOLVE = SOLVE.toLocaleString(style_decimal).toString();
var SOLVE = SOLVE.replace(/,/gi, ' , ');
opal plank
#

for your own sake

#

STOP using vars

earnest phoenix
#

sorry

#

im addicted

opal plank
#

trust me

#

they work funky

pale vessel
#

var go brrrrr

earnest phoenix
#

but could that be part of the problem?

tulip ledge
#

prob not

#

but var is function scoped and let is block scoped

#

what that means don't ask me

tulip ledge
#

I just know it's better to use let

opal plank
#

vars gets declared on initialization too

#

vars are hoisted with the compiler

#

they also, like you said, dont respect scopes very well

#

you can return values even though they dont exist

earnest phoenix
#

the basic concept of the code is that it is using a library which solves linear equation systems and the weird thing is EVEN THOUGH the numbers get turned into those weird 0s and 1s it STILL outputs the right answer

opal plank
#

look in the screenshot i sent

#

returning a even though it hasnt even been declared

#

run my snippet that i sent with an eval or something

#

i doubt it'd be that

#

and switch all vars to const/let

earnest phoenix
#

ighzt

opal plank
#

also the way you doing it is really bad

#

you are declaring SOLVE 3 times

#

also input

earnest phoenix
#

i know my code looks like it survived chernobyl

opal plank
#

lmao

#

try not to redeclare stuff

earnest phoenix
#

basically i fixed the redeclaring stuff and changed the vars to lets so my code looks a bit better now but the error still persists

also in my vscode terminal the numbers in my array are green and in the second array where it gets turned to 0s and 1s it is colored yellow what does that mean?

opal plank
#

are you parsing them?

#

var SOLVE = linSystem.solve(equations,solutions);

#

log what this returns

earnest phoenix
#

-2 , 5 , 3

opal plank
#

im assuming you are parsing an array

#

but check the type

#

also post new code

earnest phoenix
#

nvm, so immediately after the
var SOLVE = linSystem.solve(equations,solutions);
it outputs [ -2, 5, 3 ]

opal plank
#

then they are numbers, not strings anymore

#

otherwise it'd show ['-2','5','3']

earnest phoenix
#

that means the 0s and 1s are also numbers

#

so they get turned from strings to numbers in the line of code that causes this

opal plank
#

theres no reason for the toString() btw

#

toLocaleString() already returns a string type

#

nothing wrong here either

earnest phoenix
#

yea i dont remember why i added that, at some point it refused to accept it as a string but i dont have that problem now

opal plank
#

i'd recommend debugging your code with a debugger tbh

#

you use VSC?

earnest phoenix
#

yup

opal plank
#

read that

#

aight, time to go play now

#

good luck

earnest phoenix
#

im actually a dumbass

#

i just realised that the line of code is not causing the problem

#

my console.logs where way more lines down

#

when i put it directly under the line of code it was a normal string array

#

so now i just gotta find the real line of code that causes this

#

oh my fucking god

#

its the library

#

the fucking library itself is changing my array to 0s and 1s in a command that shouldnt even affect my array directly

waxen tinsel
#

What is the fastest way to get a channels message history? During testing, I found that for every 100 messages added to the limit for the history method, a second was added. That means 5000 messages take about 50 seconds to retrieve w/ that method.

#

I use discord.py, though answers from those using other libs still may be helpful, considering many of the general methods are the same. @ me when answering please.

tardy hornet
#
${message.guild.members.cache.filter(mem => mem.users === true).size}

will it say how many members are in the server? (only members not bots)

opal plank
#

member.bot is usually what you go for

pale vessel
#

you want to filter out bots then (mem => !mem.user.bot)

opal plank
#

user.bot*

tardy hornet
#

k ty guys

#

@opal plank i love you bro

opal plank
#

hahah ty

willow mirage
#

help me

#

my website is not working

boreal iron
#

Well then fix ur dns records

willow mirage
#

i did

#

it still

tardy hornet
#

@opal plank wait...

#

wait what?

pale vessel
#

could be caching

willow mirage
boreal iron
#

Then flush your dns cache if that’s an issue on ur side

tardy hornet
#

could be caching
@pale vessel has to be

pale vessel
#

did you use memberCount for total?

stark abyss
#

where does it say not to use json file as db

pale vessel
#

if so, then your bot didn't cache all members

earnest phoenix
#

where does it say not to use json file as db
@stark abyss json db can get corrupted easily

willow mirage
#
GET /.well-known/acme-challenge/9qk42UCGrBpmB8TZGdG5_3yuyQNCUS_4VyewUM96jLs 404 1.499 ms - 20

And what the fuck is this

stark abyss
#

no no

#

ik that

earnest phoenix
#

onvm

tardy hornet
#

there is 379 people in the server @pale vessel

pale vessel
tardy hornet
#

yes

#

i did

#

why?

pale vessel
#

memberCount is from the api

#

members.cache.size is from the cache

tardy hornet
#

i did

#

message.guild.memberCount

pale vessel
#

well, you used members.cache.filter() which uses the cache

tardy hornet
#

${message.guild.members.cache.filter(mem=> !mem.user.bot === true).size}

#

thats how i did

pale vessel
#

your bot didn't cache all members basically

#

it only cached 57/379 members

#

so the solution would be to cache/fetch all members (assuming you have the guild members intent) and then calculate the members again

#

if you don't have the intent, you have to request for it

tardy hornet
#

wait

#

i think its showing only the onlines

opal plank
#

not even

#

intents

#

to cache all members you'll need priviledged intents

#

@tardy hornet

tardy hornet
#

o

opal plank
#

GUILD_MEMBER intents iirc

#

theres only two, presence is one, the other one is the on you need

#

i forgot the actual name

pale vessel
#

GUILD_MEMBERS and GUILD_PRESENCES iirc

opal plank
#

something along those lines

pale vessel
waxen tinsel
solemn latch
#

discord api has limits on how many messages you can get in one request

#

it would probably be on the developer docs site, which would be your hard limit

waxen tinsel
#

Hmm.. kinda makes grabbing more than 500 messages kinda undoable then. At least in reasonable times.

solemn latch
#

is there a specific reason you want to get so many messages?

waxen tinsel
#

Things such as logging a full channel or even purging it.

#

In case people want to delete old channels but keep records of what was said

hollow sedge
#

Then just save the channel and lock it

solemn latch
#

purging channels should be done by cloning the channel and deleting the original if possible(a channel with 1,000,000 messages would take days to delete with bulk delete)

waxen tinsel
#

Right

solemn latch
#

and i dont remember if message logging is PII

#

🤔

waxen tinsel
#

Logging would be the real main use tbh. But sounds like its not feasible. Also, PII?

solemn latch
#

personally identifiable information

#

means youd need to start complying with a lot of laws

waxen tinsel
#

Ah yeah in the discord.py server they said "just store every message sent" and I was like um yeah no

#

Thats why I wanted to find a way to fetch them faster through discord itself, rather then keeping a sketchy database like that

#

I try my best to address and reduce all privacy concerns like that

solemn latch
#

well, youd have to save them either way if your logging.

waxen tinsel
#

Well what I would do is have the command create a txt or html fole w/ the logs, upload it as a file to the log message, and delete it from my own server

solemn latch
#

some channels have millions of messages, doing that for an entire channel isnt feasible even if you could get 10,000 messages per request 🤷‍♂️

waxen tinsel
#

Yeah

#

Thought id explore it, but I dont want to sacrifice user privacy/security for functionality.

#

Thanks for the info

#

Wait, is there a way to get an approximate message count in a channel quicker tho?

sudden geyser
#

I think you'd need access to the search endpoint, which isn't available to bots.

solemn latch
#

sadly, bots dont have access to the search api users have, so i dont think its possible without manually counting

waxen tinsel
#

F

solemn latch
#

you could have users manually add it and track from that point. but thats not a good solution

waxen tinsel
#

Right

solemn latch
#

also since discord already provides it, kind of a useless feature

hollow sedge
#

sadly, bots dont have access to the search api users have, so i dont think its possible without manually counting
@solemn latch makes sense, it's obvious how that could be abused

waxen tinsel
#

It would be more to determine if a full channel is loggable, or how to go about doing that. At some point I want to remaster the ticket system ive used for private servers, and make it more public.

#

My bot is essentially whatever i feel like working on at that point lol

solemn latch
#

honestly, locking the channel is the correct way to store old channels up until guilds hit the channel limit(which is so high, would more likely be abuse at that point).

waxen tinsel
#

Right. Though for tickets, message count is less likely to get as high.

dire obsidian
#

what its a good place to make testings of web development(like glitch, replit etc)

hollow sedge
#

Not sure if this is the best idea..but why don't you just iterate over the message history to see if it exceeds a certain number

tame kestrel
#

what its a good place to make testings of web development(like glitch, replit etc)
@dire obsidian glitch, replit work really well

#

🙂

dire obsidian
#

youre stalking me eh? rarw

opal plank
#

keyword testing

#

please for the love of god dont use it for production

solemn latch
#

or just local webserver pogey

waxen tinsel
#

I mean maybe 500-1000 messages in worst cases i would think. And wdym @hollow sedge?

dire obsidian
#

pc is a toaster

#

anyways, i just want make testings

pale vessel
#

shiv uses it too

hollow sedge
#

I mean maybe 500-1000 messages in worst cases i would think. And wdym @hollow sedge?
@waxen tinsel well with discord.py i can just say that my limit is 100 and it will grab up to 100 messages from a channel

solemn latch
#

webservers are so insanely light in testing enviorments

waxen tinsel
#

Right

hollow sedge
#

so that will work for you?

dire obsidian
#

yeee but im (for the moment) not making web servers

hollow sedge
#

if it's more than 100, you only get 100
if it's less than 100, you get the full text

waxen tinsel
#

So you are saying a system where I just keep going in 100s till I hit a #?

dire obsidian
#

i have some problems 👉👈

hollow sedge
#

NO

dire obsidian
#

so thanks for the help

hollow sedge
#

im saying only get up to 100 messages

#

or whatever your limit is

#

sorry i dont think im expressing this idea in the best way

waxen tinsel
#

True

#

Sorry I had to do that iteration sort of method to get records from an api at one point and it randomly popped up lol

hollow sedge
#

oh lol

stark abyss
#

let embed = new MessageEmbed();
.setAttachment(neko.url);

  message.channel.send({embed})
#

someone teach me how to put it in one line

#

where {embed} is

slender thistle
stark abyss
#

fr i am using it rn

#

anyway how to do it one line

solemn latch
#

all 3 lines on one line?

stark abyss
#

yeah sir

#

i believe there is way to make and send at same time

tame kestrel
#

REPL.IT IS A MASTERPIECE
@slender thistle I won one of their hackathons and made a quick buck, that was fun

stark abyss
#

like message.channel.send(create embed here)

slender thistle
#

Wew

solemn latch
#

message.channel.send({new MessageEmbed().setAttachment(neko.url)});

stark abyss
#

ty

solemn latch
#

or something 🤷‍♂️

stark abyss
#

Unexpected identifier

solemn latch
#

which one

stark abyss
#

didn't tell me

drifting wedge
#

How do I figure out what shard my bot is in?

#

Dpy

solemn latch
drifting wedge
#

Really?

#

Thanks

solemn latch
#

probably

#

hey, what parameter is setAttachment @stark abyss ? can you link me the docs to it

#

I cant find it

#

🤔

stark abyss
#

i meant set image

#

it worked thx

#

what is Promise { <pending> }

solemn latch
#

an unresolved promise

stark abyss
#

ok

modern sable
hollow sedge
#

an invalid HTTP Response

modern sable
#

fair

modern sable
#

turns out i was actually double stupid

earnest phoenix
#

is there a way to execute a piece of code on every shard

#

in my case for a reload command

#

to reload the command on every shard

faint prism
#

like a broadcast?

earnest phoenix
#

uh can someone help me with getting voting updates and sending them in a specific channel with discordjs?

opaque seal
earnest phoenix
#

ok

static trench
#

Where do i find voting. People have to vote after doing 10 questions. How do i get that code?

faint prism
#

You write the code?

static trench
#

No I’m saying. How do i get top.gg to tell my bot that someone voted so they can continue doing trivia questions

earnest phoenix
#

like a broadcast?
@faint prism i tried that but i cant get it to work

hollow sedge
static trench
#

Still. Can’t find it

hollow sedge
#

what language?? all the info is there

earnest phoenix
#
client.shard.broadcastEval("const name = args[0].toLowerCase(); delete require.cache[require.resolve(`./${name}/js`)]; ..")
#

-> name = undefined

drifting wedge
#

How do I add an image to and embed as a file?

#

Not a link?

#

Dpy

static trench
#

what language?? all the info is there
@hollow sedge py. It’s not. Am I being dumb?

earnest phoenix
#

bruh

static trench
#

What?

hollow sedge
#

oops

static trench
#

@hollow sedge ok. Ive been there. I’m asking. Where do i find the code that tells my bot someone voted on top.gg?

hollow sedge
#

did you look at the second link?

#

@static trench

static trench
#

Oh ya sorry.

#

Thanks!

hollow sedge
#

yw

earnest phoenix
#

Anyone know why join/leave events work when I run my bot on my PC but stop working on a VPS

faint prism
#

no clue

#

&& )

#

are you trying to tell me that if (someBoolean && ) makes sense?

#

lol

#

All good

earnest phoenix
#

how can I make it send a message when the bot is mention.

#

only mention

faint prism
#

messages contain a mentions property

#

just check if the bot's mention is one of them in the msg

earnest phoenix
#

it will answer only after tagging.
ex: @earnest phoenix

#

@earnest phoenix hi

#

will not give when written ^^

#
bot.on('message', async message => {
    if (message.channel.type === "dm") return
    let prefix;
        try {
            let fetched = await db.fetch(`prefix_${message.guild.id}`);
            if (fetched == null) {
                prefix = PREFIX
            } else {
                prefix = fetched
            }
        } catch (e) {
            console.log(e)
    }
    try {
        if (message.mentions.has(bot.user) && !message.mentions.has(message.guild.id)) {
            var kSayı =0
            bot.commands.forEach(a=>kSayı+=1)
            const embed = new MessageEmbed()
            .setColor(autimatic)
            .setDescription(stripIndents`Merhaba ${message.author}, ben autimatic.
            **${message.guild.name}** sunucusu için prefix'im: \`${prefix}\`
            Komutlarımı görmek için \`${prefix}yardım\`
            Her hangi bir komut hakkında bilgi almak için \`${prefix}yardım <komut adı>\` yazabilirsin.
            ​`)
            .setAuthor(bot.user.username + ', ' + bot.users.cache.get("257062280779268097").tag + ' tarafından geliştirildi.' , bot.user.displayAvatarURL({ dynamic: true, format: 'png', size: 1024 }))
            .addField(`**Bilgi:**`, stripIndents`![gelitirici](https://cdn.discordapp.com/emojis/705972559715500042.webp?size=128 "gelitirici") **Geliştirici:** ${bot.users.cache.get("257062280779268097").tag}
            ![avataryapimci](https://cdn.discordapp.com/emojis/705972559228960798.webp?size=128 "avataryapimci") **Avatar:** [**Şevval Coşkun**](https://tr.pinterest.com/pin/206884176609870185/)`, true)
            .addField(`**İstatistikler:**`, stripIndents`![sunucular](https://cdn.discordapp.com/emojis/705972559891398668.webp?size=128 "sunucular") **Sunucular:** \`${bot.guilds.cache.size}\`
            ![kullanclar](https://cdn.discordapp.com/emojis/705972559832940557.webp?size=128 "kullanclar") **Kullanıcılar:** \`${bot.users.cache.size}\`
            ![kanallar](https://cdn.discordapp.com/emojis/705972559837134888.webp?size=128 "kanallar") **Kanallar:** \`${bot.channels.cache.size}\`
            ![komutlar](https://cdn.discordapp.com/emojis/705972559513911379.webp?size=128 "komutlar") **Komutlar:** \`${kSayı}\``, true)
            return message.channel.send(embed)
        }
    } catch {
        return;
    };
});
faint prism
#

@earnest phoenix hi
Because the mention is actually this ^

earnest phoenix
#

i have such a code

#

but when I type "@earnest phoenix hi" it also responds.

faint prism
#

@faint prism
@earnest phoenix ?

#

and what?

#

&& = and some condition

#

but you have nothing there

#

so the ) is unexpected

earnest phoenix
#

@earnest phoenix maybe use an IDE that detects syntactical errors

faint prism
#

reread this

#

if (someBoolean && ) is wrong because you mean
if (someBoolean)

toxic jolt
#

hello guys

faint prism
#

You can't just put && and nothing else

#

it "expects" another condition, not the )

toxic jolt
#


client.on('ready', (i, callback) => {
setTimeout(() => {
var randomSaniye;
    setInterval(() => {
        /* Bot Presence (Game and Status) */
        client.shard.fetchClientValues('guilds.size').then(results => {

            //let servercount = results.reduce((prev, guildCount) => prev + guildCount, 0)
            
          var durum = [
      "!!yardım | !!davet | !!p Şarkı",
      "!!cortex | Benle konuşsana :3 ",
      "Özel mesaj at, cevaplıyım UwU",
     // "!!davet | Sunucuna beni çağır >_<",
      ];
       // 
       
       var saniye = [
       "5",
       "10",
       "15",
       "20",
       "25",
       "30",
       "35",
       "40",
       "45",
       "50",
        ]
            randomSaniye = saniye[Math.floor(Math.random() * saniye.length)]
            
            var random = durum[Math.floor(Math.random() * durum.length)]
            client.user.setPresence({game: {type: 0, name: random}})

            
        })
    }, randomSaniye * 1000);
}, 20 * 1000);
})
``` im make it this code for my shard.js bot but im getting so many error
faint prism
#

Which is why you see "unexpected token"

#

Good job

toxic jolt
faint prism
#

np

toxic jolt
#

i how to fix pls help

#

i making a auto change status on shard.js bot (discord.js v11)

faint prism
#

discord.js v11
v11 is deprecated

#

it literally doesn't work anymore

toxic jolt
#

okay i how to fix this pls

earnest phoenix
#

The error gets thrown when you try to get a value of <Client> from each shard using <ShardClientUtil>.fetchClientValues while the Sharding Manager is still spawning shards.

toxic jolt
#

:c

faint prism
#

you update to v12

toxic jolt
#

okay but my bot so many code

#

i how to update

#

:((

earnest phoenix
#

? 😄

toxic jolt
#

I have a university exam

earnest phoenix
#

ne zaman

faint prism
#

well I'm not doing it for you

earnest phoenix
#

dediğim

#

sorun

faint prism
toxic jolt
#

okay but so hard.

earnest phoenix
#

shard üretirken

toxic jolt
#

@earnest phoenix dm

earnest phoenix
#

shard almaya çalırşırsan

#

hata verir

faint prism
earnest phoenix
#

oh sorry.

#

i forgot

faint prism
#

okay but so hard.
@toxic jolt 🤷 good luck. Follow the guide in that link is all I can tell you

#

idk Javascript. I'm a C# developer

#

sounds like you're passing in an incorrect variable type

#

It says it expected a number

#

rememeber "5" does not equal 5

stark abyss
#

I know Js

ember lodge
faint prism
ember lodge
#

i already know that

#

but i want to make a GET with parameters

faint prism
#

do you mean headers?

#

GET can only pass in data via queries

#

which is http://example.com/something?my+query+here

stark abyss
#

@ember lodge example

const fetch = require("node-fetch");
fetch(`url/${parameter or input}`)
    .then(response => response.json())
    .then(data => { 
    
message.channel.send(data.value.toLocalString()
})
faint prism
#

yeah basically

ember lodge
#

I'll see thanks

faint prism
#

np

stark abyss
#

Hopefully that's helpful but I am not good at this so don't blame me if i am wrong

faint prism
#

POST or other HTTP protocols can send content via their body argument

balmy knoll
#

In discord.js, i get this error Error: input stream: Could not find player config, can someone help me and try to fix the problem?

faint prism
#

Is that a custom error?

#

or some module/lib's error?

#

sounds like it's looking for a config file that isn't present in the directory it searched

balmy knoll
#
Error: input stream: Could not find player config
     at exports.getBasicInfo (/home/simo/musibeth/node_modules/ytdl-core/lib/info.js:59:13)
     at processTicksAndRejections (internal/process/task_queues.js:97:5)
     at async Object.exports.<computed> [as getBasicInfo] (/home/simo/musibeth/node_modules/ytdl-core/lib/info.js:296:18)
     at async exports.getFullInfo (/home/simo/musibeth/node_modules/ytdl-core/lib/info.js:187:14)
     at async Object.exports.<computed> [as getFullInfo] (/home/simo/musibeth/node_modules/ytdl-core/lib/info.js:296:18)
quaint peak
#

discord.py, how would i make the bot dm me when an error happens

ember lodge
waxen tinsel
#

@quaint peak you can DM a user/member object w/ send method.

#

easiest way to go about it.

ember lodge
#

@stark abyss

#

doesnt works

earnest phoenix
#

it returned invalid json

#

like the error says

#

more than likely because you failed to spell download properly

ember lodge
#

sry

stark abyss
#

@ember lodge i am sorry ):

#
const body = { a: 1 };
 
fetch('https://httpbin.org/post', {
        method: 'post',
        body:    JSON.stringify(body),
        headers: { { 'x-api-key': 'keyhere' } },
    })
    .then(res => res.json())
    .then(json => console.log(json));```
#

example from the npm

#

i would look at the npm because it really have good examples

ember lodge
#

ujum

#

but where does the "parameter" should go? @stark abyss

earnest phoenix
#

@balmy knoll Update ytdl-core to the latest version and restart your bot

stark abyss
#

assuming the url and then you can use different methods

ember lodge
#

i tried this:

const path = "arkps/ShooterGame/Saved/Logs/ShooterGame_Last.log"

const fetch = require("node-fetch")
 fetch(`https://api.nitrado.net/services/6705374/gameservers/${path}/download`, {
 method: 'GET',
 headers: {
 'Authorization' : `Bearer ${nitrapiToken}`
 }
 })
 .then(res => res.json())
 .then(json =>{
console.log(json)

})
#

but stills the same error

earnest phoenix
#

npm i ytdl-core@3.4.2 @balmy knoll

ember lodge
#

this is what the Api is telling me to do

earnest phoenix
#

It also requires a parameter

wicked pivot
#
fs.readdir("./assets/events/", (err, files) => {
    if (err) return console.log(err);
    files.forEach(file => {
        var event = require(`./assets/events/${file}`);
        let eventName = file.split(".")[0];
        bot.on(eventName, event.bind(null, bot));
    });
});```
earnest phoenix
#
<Base URL>?file="Path to the file"``` @ember lodge
balmy knoll
#

@earnest phoenix Thanks

ember lodge
#

OHHH

#

i'll see

earnest phoenix
#

@wicked pivot Log and see what this returns

fs.readdirSync(".assets/events/").map(file => console.log(require(`./assets/events/${file}`)));```
wicked pivot
#

Date.now() @earnest phoenix

earnest phoenix
#

As you see, one of them returns an empty object with you can't use bind on @wicked pivot

wicked pivot
#

typo I forgot the s on module.exports thanks

earnest phoenix
#

Np

#

args[1] is not a number

#

parseInt(args[1])

#

What is the 4th line in your index.js

#

I mean the 25th line, show me that line in your main file

#

That's where the error comes from

#

Wait a second, it's the 2514th line

#

Bruh moment

#

Also that can happen if args[1] doesn't exist or is not a number

#

Add a check to see if it's a number

blissful coral
#

Best database to use for a bot that is able to handle a lot of information

earnest phoenix
#

MongoDB

sick cloud
#

depends if you want ease of use or actual "lot of information"

#

because straight up look into cassandra, postgres or mariadb for example

still merlin
#

Is there a way I'd be able to grab the description of every command file, And put it into a embed (d.js)

like if my ping description was:
'Get the ping of the bot' the embed would display

Ping (field title)
Get the ping of the bot (field text)

earnest phoenix
#

Of course, do a loop

#

But doing all this in one embed would be bad because embeds can only have 25 fields at max, you need a pagination system as well

hollow sedge
#

you could also use codeblocks

hasty mulch
#
import discord
import asyncio

from discord.ext import commands

bot = commands.Bot

bot.tempf = 'Not Set'
bot.tempc = 'Not Set'
bot.skycon = 'Not Set'
bot.windspdm = 'Not Set'
bot.windspdk = 'Not Set'
bot.winddir = 'Not Set'

weather=f'''
*the weather report is as follows:

Tempature: {bot.tempf}°F/{bot.tempc}°C
Sky Conditions: {bot.skycon}
Wind: {bot.windspdm} MPH/{bot.windspdk} KPH from the {bot.winddir}
'''

class WeatherCog(commands.Cog, name="Weather Cog"):
    
    def __init__(self, bot):
        self.bot = bot
        
    @commands.command(name='weather')
    async def _weather(self, ctx):
        print('Weather Report requested...')
        await asyncio.sleep(0.1)
        await ctx.send(weather)
        await asyncio.sleep(0.1)
        await ctx.send('(Not sure if this will work or if I should make it an embed. Let me know what you think!)', delete_after=7)
        print('Weather Report sent!')
        pass
    
    @commands.command(name='tempf')
    @commands.has_permissions(administrator=True)
    async def _tempf(self, ctx, text):
        print('Setting Fahrenheit Tempature...')
        bot.tempf = text
        await ctx.send('Fahrenheit Tempature Set!')
        print('Fahrenheit Tempature Set!')
        pass
    
    
    
    pass

def setup(bot):
    bot.add_cog(WeatherCog(bot))
#

This is not changing the tempf thing in Python

hollow sedge
#

dude, what is this

trim saddle
#

in a cog you have to use self.bot

hasty mulch
#

@trim saddle I am already using self, in the function

hollow sedge
#

@hasty mulch yes but when you're referencing the bot you have to use self.bot, not just bot

#

tis how classes work

hasty mulch
#

@hollow sedge Yeah, that didn’t work

blissful coral
#
const Discord = require(`discord.js`)
const guildModel = require(`../db/Guild`)
const { connect } = require(`mongoose`)
module.exports = {
    name: 'test',
    async execute(client, message, args) {
        const doc = new guildModel({ id: message.guild.id })
            await doc.save()
            message.reply(`Made new document!`)

        
            await connect('mongodb://localhost/mongodb-demo', {
            useNewUrlParser: true, 
            useFindAndModify: true 
    })
    },
};
hasty mulch
#

self.bot.tempf = text did nothing

blissful coral
#

Not getting a response 🤔

earnest phoenix
#

Any errors?

blissful coral
#

Nope

trim saddle
#

@blissful coral log everything

blissful coral
#

I am doing it rn

earnest phoenix
#

Does it not say "Made new document!"?

blissful coral
#

Nope

#
const { Schema, model } = require(`mongoose`)

const Guild = Schema({
    id: String,
    prefix: {
        default: '?',
        type: String
    }
})
module.exports = model(`Guild`, Guild)
#

That is the export for GuildModel

#

Doesn't get past doc.save()

hasty mulch
#

self.bot.tempf = text did nothing
@hasty mulch @trim saddle @hollow sedge

hollow sedge
#

why are you doing bot.tempf

#

why cant it just be tempf?

#

you cant just add new properties like that

#

@hasty mulch

blissful coral
#

What in the fuck

#

I did npm remove mongoose

hasty mulch
#

On another command I used just “shuffle” and that didn’t work, was told to do bot.shuffle, and it worked @hollow sedge

hollow sedge
#

well anyway you cant add new properties like that

#

so just define them as a global variable

#

or put them in their own class and define an object of that class as a global variable

hasty mulch
#

Then how come only this one doesn’t work?

hollow sedge
#

because it was never defined as a variable in the class

sick cloud
#

how do you get Map.values to work

#

logging it returns [Map Iterator] { } not an array

sudden geyser
#

[...iterable]

earnest phoenix
#

alguém sabe como posso saber quais membros tem o cargo?

#

oh

#

does anyone know how can i know which members have the role?

sudden geyser
#

What library are you using?

earnest phoenix
#

discord.js

sudden geyser
#

You could use <Guild>.members.cache.filter(...)

earnest phoenix
#

ok!

#

thanks

errant perch
#

0.0000003500 anyone know how to get rid of the 0's to the right of the 35 in javascript?

hollow sedge
#

Why do you want to do that?

errant perch
#

look better

#

thanks

#

shouldve googled it first

hollow sedge
#

Yeah I asked because it removes the 0s when you turn it into a string

blissful coral
#
maindb.js
const pool = mysql.createPool({
    host: 'localhost',
    user: 'root',
    password: 'seminole2005',
    database: 'boxfights',
    charset: 'utf8mb4'
})

queries.js
const pool = require(`./maindb`)
module.exports = {
    GuildConfig: function(guildid) {
        pool.query(`SELECT * FROM GuildConfig WHERE guild = ${guildid}`, (err, results) => {
            return results
        })
    },
}

command.js
const db = require(`../db/queries`)
module.exports = {
    async execute(client, message, args) {
        const { column1, column2, column3 } = db.GuildConfig(message.guild.id)
    },
};

This should return the columns results right?

#

for each one

sudden geyser
#

no

#

You try returning results in the callback in GuildConfig, but as it's a callback, it's not propagated to the return of the GuildConfig function.

#

Some solutions would be to accept a callback as a second parameter to GuildConfig and to call it with err and results, or you could use promises with new Promise((resolve, reject) => {...})

#

That's the only error I see in your code at first glance. You can always try it out and see what results you get.

errant perch
#
var n = Number("3.5e-7").toFixed(10)
console.log(parseFloat(n))``` whenever i run this i get 3.5e-7
#

i want it to output 0.00000035

sudden geyser
#

I believe that's just due to the way it's displayed to you.

#

It's value is still 0.00000035

#

Try and log it without the parseFloat() around n.

earnest phoenix
#

people

#

is requesting a package, right?

errant perch
#

0.0000003500

#

thats what i get without parse float

earnest phoenix
errant perch
#

wanted to get rid of the zeros on the end so it is easier to read in a big list

#

yes i use it

earnest phoenix
#

so

#

npm install is requesting a package

#

right?

errant perch
#

i believe so

earnest phoenix
#

npm install discord.js for example

#

is requesting i install the discord.js

#

right?

errant perch
#

in repl.it all you have to do is require the package

earnest phoenix
#

my bot is not turning on

#

i cant stop and run

#

stay STOPPING forever

#

i hate when it happens

#

i cant turn on my bot

#

i am trying to turn on him

#

him turn on before, but when i put commands and turn on again my bot

#

he didn't turn on

#

it looks like because it STOP in the page, but it's not turned on

#

sorry for my english, i am brazilian

#

you can see i am brazilian for the image

opal plank
#

isnt that your linter showing bad closure?

earnest phoenix
#

yes AlexIsSpooky

#

i can type in the terminal

#

why? @swift umbra

opal plank
#

Feedback.
Try not to use ENV AND JSON at once, while theres no problem using both, its better to chose one or another
Multiple line declaration const a,b,c,d;
Merge does IF statements
startsWIth() can have operators inside, no need for repetition
try catch is bad for command handler since it will fail if someone tpyes your prefix and some random commmand infront
@earnest phoenix

earnest phoenix
#

it's requesting quick.db but i cant install

#

ok

#

i am trying for 30 minutes

#

to install everything is requesting

#

i made a bot, but i deleted, and i made the same things to construct this

#

and is joking with me

boreal flume
#

How do I make a log in with discord feature on a web page?

sudden geyser
#

Did you try it?

#

Typically it's faster to try it out and see, but okay.

boreal flume
#

They look the same to me...

#

Ohhh

#

I'd just do ${message.member}

#

and forget about the <@!$

sudden geyser
#

Probably not. Look at these lines for your error: ```js
// #4
if (msg.content.startsWith("e!kiss")) return`

// #5
msg.channel.send(`<@!${msg.author.id}> UwU you kissed <@!${mentioned.user}

This is just off your second code block.
#

Like I said, try it out and see. It only takes a second or two to plop it into your code editor for it to tell you what's wrong

boreal flume
#
if(message.content.startsWith("e!kiss")){return msg.channel.send(`${message.member} UwU you kissed ${message.mentions.members.first()}`)}

I believe this is the solution

hollow sedge
#

return?

boreal flume
#

Return stops everything after the function from working

sudden geyser
#

if the content of the message starts with "e!kiss", don't go further

boreal flume
#

You don't have to return, but you can

hollow sedge
#

no i mean i dont think you return that

sudden geyser
#

notice the logical error there

hollow sedge
#

i know what a return is

boreal flume
#

What is the logical error?

sudden geyser
#

if the command does not start with e!kiss, it doesn't run

earnest phoenix
#

refrain from spoon-feeding code next time

sudden geyser
#

which will also lead to an infinite loop forgot the ignored bots at the top

boreal flume
#

False

hollow sedge
#

False
@boreal flume he was talking about neglected, not yours

earnest phoenix
#

also i can just send e!kiss and i broke your command

boreal flume
#

ahhhhh

#

No

hollow sedge
#

yes

boreal flume
#

You did not cry

hollow sedge
#

you cant return that

boreal flume
#

you can return it

hollow sedge
#

why would you return that

boreal flume
#

I normally dont

earnest phoenix
#

run the command in a dm, another thing broken

#

tldr just explain it instead of spoon-feeding

boreal flume
#

Running it in DMs would not break the command

earnest phoenix
#

yes it would

hollow sedge
#

it would if you dont check for errors

#

people can have dms off

earnest phoenix
#

members do not exist in dms

sudden geyser
#

really the entire code snippet is incorrect

boreal flume
#

Members do exist in DMs, just no GuildMembers

earnest phoenix
#

are you stupid

#

oh djs

sudden geyser
#

Those are called users, and there are only two: you and the person you're talking with.

earnest phoenix
#

uh

#

that

#

users exist, members do not

boreal flume
#

Correct

earnest phoenix
#

member prop is going to turn out undefined

#

there's no members

hollow sedge
#

is it just me or does the snippet look like a combination of d.js and d.py

sudden geyser
#

just you probably

#

to me it looks completely wrong

hollow sedge
#

😆

earnest phoenix
#

how do i go to a new line in my bot description

#

\n doesn't work

boreal flume
#

I have done some testing.... and it definitely breaks in DMs

#

Though, I could likely make it work in DMs

#

It is msg...

#

I usually use message so everywhere in the snippet that says message is incorrect

sudden geyser
#

neglected I don't want to come off rude, but you need to learn JavaScript before you try writing a bot. Most questions you ask are very primitive.

boreal flume
#

I have made it work in DMs

sudden geyser
#

congrats

boreal flume
#

Read up on the discord.js documentation neglected

#
#
bot.on('message', msg => {
    if(msg.content.startsWith("e!kiss")){
        let member = msg.mentions.users.first() || 'No one'
        return msg.channel.send(`${msg.author} UwU you kissed ${member}`)
    }
})

Working in DMs

#

So you know no javascript?

earnest phoenix
#

you should learn js before you learn discord.js

boreal flume
#

Yeah

#

Knowing basic javascript function and such also help with logic in bots

earnest phoenix
#

How do you go to a new link in my discord bot's description?
\n doesn't work

boreal flume
#

How do you go to a new link in my discord bot's description?
\n doesn't work
@earnest phoenix What do you mean?

earnest phoenix
#

I am trying to make a new line

#

Like

this

slender thistle
#

Everyone sent me discord.js thinking I know javascript but plot twist I didnt
@earnest phoenix plot twist learning X before using discord.X is a reasonable expectation

boreal flume
#

<br />

#

If it's html

slender thistle
#

That or press enter two/three times

earnest phoenix
#

YES <br> worked.

boreal flume
#

Ok

sudden geyser
#

Most people will just send you library documentation regardless.

slender thistle
#

Whose fault would that be

#

Fair

sudden geyser
#

hol up

#

shiv you're no longer mod why

tame kestrel
#

he likes the color green

sudden geyser
#

fair

earnest phoenix
boreal iron
#

Rumors say he couldn’t handle the pressure and the fear KEKW

trim saddle
#

ahyes, let's learn a deeper part of programming without knowing how to print to terminal

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

@sage bobcat You don't have to waste your time explaining your experience and what not, i have already told him what he could do and for him to learn it but it's like I'm talking to a wall OMEGALUL

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Everybody makes mistakes

quartz kindle
#

lots of people hate egirls

sage bobcat
#

One message removed from a suspended account.

quartz kindle
#

because they're jealous

#

:^)

earnest phoenix
#

lots of people hate egirls
@quartz kindle OMEGALUL You just roasted the entirety of Twitch

quartz kindle
#

and the entirety of haters

earnest phoenix
#

egirls girls don't even exist, most here are just guys acting like them OMEGALUL

thorny badger
#

Damn

dire obsidian
#

What

#

How did you...

earnest phoenix
#

@quartz kindle Does JS ASM exist?

trim saddle
#

@sage bobcat ngl i learned python from bot templates

#

and i sorta just picked up on js easily

clever rampart
#

message.member.id is giving me "cannot read property 'id' of null" in discord js library... this just started today

#

likewise, message.member.roles.find cannot read property 'roles' of null

#

did they just change how message.member works? Weirdest part is it only happens sometimes, not all the time

trim saddle
#

is member a proper attribute in message?

clever rampart
#

should be; it's been working for almost a year now

#

as long as the message is from a member of a server

delicate shore
#

Why it says this on my website ?

#

is not appropriate

#

My website has no explicit material

#

No abusive word

#

My website is similad

#

My website is similad

clever rampart
#

I'm also having problems with member, not sure if it's the same reason

hollow sedge
#

Why it says this on my website ?
@delicate shore cause of all the fake reviews there 😆

delicate shore
#

Lol

#

It's not fake

#

I promise

#

You can ask adib

hollow sedge
#

Who is that

delicate shore
#

@clever dust pls tell @hollow sedge that you gave the feedback of black sheep bot

#

He changes his pfp

#

But he gave it

#

And jam is this person

hollow sedge
#

"I used to enjoy watching PGamerX play games and do stupid stuff on youtube.
But now I enjoy using bots , meme generator and other things developed by him
I really can't believe that he is the one I used to watch on youtube 3 years ago"

delicate shore
#

"I used to enjoy watching PGamerX play games and do stupid stuff on youtube.
But now I enjoy using bots , meme generator and other things developed by him
I really can't believe that he is the one I used to watch on youtube 3 years ago"
@hollow sedge
You mean this
Yeah this is fake

hollow sedge
#

Lol

#

The grammar mistakes are a big tell

delicate shore
#

Yea

hollow sedge
#

But fr turn off your parents website blocker or whatever

#

That's what's causing your problem

clever dust
#

@clever dust pls tell @hollow sedge that you gave the feedback of black sheep bot
@delicate shore ok

#

hey @hollow sedge , i left the feedback of black sheep bot

hollow sedge
#

Ok cool

clever dust
#

k bye

hollow sedge
#

K bye

#

@delicate shore get your parents to turn off eset

delicate shore
#

Lol

hollow sedge
#

Wdym lol?

#

Are you like 9 years old that they need to watch over you like that 😆

#

Anyway that's an entirely different problem

delicate shore
#

No

hollow sedge
#

But if you turn that off then you can access your site

delicate shore
#

It's not of mine

#

It's of my friend

#

He sent me this ss

hollow sedge
#

ohhhh

#

Rip ur friend

restive lily
#
@bot.event
async def on_member_join(member): 
    await member.add_roles(discord.utils.get(member.guild.roles, name="Syndicate Members"))
    await member.add_roles(discord.utils.get(member.guild.roles, name="In Training"))
    channel = discord.utils.get(member.guild.text_channels, name="sydcranklogs")
    await channel.send(f"`Syndicate Members` and `In Training` was given to `{member.name}({member.id})` by `Auto Role`")```
it wont role both of the roles, even when i make them seperate events, please help. i just need it to autorole both
earnest phoenix
#

Quick question, I'm not really good with classes... By doing this will it create several warns maps or just keep one until the process restarts

#

@restive lily what's your intents setup looks like?

restive lily
#

@earnest phoenix wym by that

earnest phoenix
#

intents, you would need to enable members intent in order to get member_join event

#

here's the usual setup for that ```py
import discord
from discord.ext import commands

intents = discord.Intents.default()
intents.members = True # Subscribe to the privileged members intent.
bot = commands.Bot(command_prefix='!', intents=intents)

This example enables members intent explicitly @restive lily
ancient nova
#
bot.on("guildCreate", guild => {
  if (guild.memberCount < 6) { 
    guild.owner.send(`your server doesnt have enough members`)
    guild.leave() 
  }                           
})

TypeError: Cannot read property 'send' of null

#

why

restive lily
#

ok stella i just added that to the top and ill let u know if ut works or not

#

and i enabled the intents

#

on the dev portal

earnest phoenix
#

okie

restive lily
earnest phoenix
#

update to 1.5.1

#

probably your host have 1.5 but your local didn't

restive lily
#

i updated it last night

earnest phoenix
#

put print(discord.__version__) and see what it prints

restive lily
#

the error went away 💀