#development

1 messages · Page 1326 of 1

faint prism
#

I was like wtf

fluid basin
tardy hornet
#

i have 2 events

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

Ctrl + F
Then search for .on(
that's fucking same for every text editor made by people with at least 1 IQ

sage bobcat
#

One message removed from a suspended account.

opal plank
#

who me those results

#

@earnest phoenix some 300iq editors might not have the same keybind

faint prism
#

except vim

tardy hornet
#

its showing 4 results

earnest phoenix
#

who me those results
@opal plank world health organisation is not a function

opal plank
#

show me the results

tardy hornet
#

and 2 of them is hasPermission('ADMINISTRATOR'))

#

because of the on('

opal plank
#

not what we looking for

#

we want the other ones

sage bobcat
#

One message removed from a suspended account.

tardy hornet
#

one

opal plank
#

.on('

#

okay, ready looks fine

tardy hornet
#

two

opal plank
#

those are all of your results?

tardy hornet
#

those are all the events

earnest phoenix
#

did you search across all files lol

#

why isn't there a " around sorry

opal plank
#

it DID say emitter on the error though

tardy hornet
#

why isn't there a " around sorry
@earnest phoenix its an embed

earnest phoenix
#

express.js event listeners? I import that shit from my other files into my main bot code and run it so all errors trace back to the main bot code file

#

did you search across all files lol

opal plank
#

try .on( and .emit( @tardy hornet

#

if they do ctrl + shift + f it might come with librbary results

tardy hornet
#

ok

#

one

#

two

opal plank
#

hmmm

#

try emit

tardy hornet
#

three

#

four

sage bobcat
#

One message removed from a suspended account.

opal plank
#

okay, try with .emit(

tardy hornet
#

want me to send all the error

#

its like 300 lines lol

opal plank
#

possibly the reaction collector then

tardy hornet
#

i have reaction collector

opal plank
#

uuugh ngl its 10AM and im borderline sleeping rn

tardy hornet
#

oh wait

#

i dont

opal plank
#

been awake all night

tardy hornet
#

i have message collector

#

i just turned my bot again

#

and he is fine

#

?

earnest phoenix
#

is there a way to check how much resources a single Chrome tab is using
because I'm about to do a for loop on an array of 100 elements and add an event listener for each

my goals are beyond your understanding
I'm making a high-tech ball pit

opal plank
#

cant u do ctrl esc on chrome?

tardy hornet
#

erwin

opal plank
#

yes

tardy hornet
#

1 question

#

i just turned my bot again
and he is fine
?

#

why?

opal plank
#

@earnest phoenix shift + esc

earnest phoenix
#

ok

opal plank
#

@tardy hornet dunno

#

not enough info to debug

tardy hornet
#

hmm

#

ok i will look into that from now

opal plank
#

aight

tardy hornet
#

ty

#

good night

opal plank
#

gn

tardy hornet
earnest phoenix
#

is it normal to have a non-discord tab use 80KiB+ of RAM and 30% average CPU

faint prism
#

not unless it's mining bitcoin mmLol

pale vessel
#

yeha his site probably does that

#

xd

earnest phoenix
#

update from windows caveman edition and most of your ram and security issues'll go poof

#

why would i do that for a private repl (which i made public because repl won't lemme make it private wihtout paying)

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

do you think they'll accept my shit school

faint prism
#

any .edu email iirc

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

#

One message removed from a suspended account.

earnest phoenix
#

wat's dat

#

also i don't really need the student dev pack

#

you just need an .edu email or your school has to be enrolled in some online system

faint prism
#

You have a college with a .org?

sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

mine is @skole.hr but it still got accepted

#

i think they allow anything from jetbrain's SWOT

faint prism
sage bobcat
#

One message removed from a suspended account.

earnest phoenix
#

You have a college with a .org?
@faint prism my computer book says that extension is for non-profit organisations iirc

#

https://github.com/JetBrains/swot just see if your email TLD is here, if so you're qualified for github student pack

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

sly marten
#

hey guys i would like some help with my code

earnest phoenix
faint prism
#

hey guys i would like some help with my code
@sly marten elaborate

pale vessel
#

*proceeds to not elaborate*

sly marten
#

im confused

earnest phoenix
#

hi confused

faint prism
#

me too

#

what's the issue? Because I have no idea

pale vessel
#

your idea is not intellij

sly marten
#

i tried to do this:

#
if (message.content === 'NKBot') {
    message.react('👀');
}
#

and got this: ReferenceError: message is not defined

#

wtf

faint prism
#

lol

pale vessel
#

what did you define message as

faint prism
#

is it inside a message event handler

pale vessel
#

look in your callback function

sly marten
#

huh? (if you're not willing to deal with someone that has 0 discord.js knowledge, then say it now)

faint prism
#

huh? (if you're not willing to deal with someone that has 0 discord.js knowledge, then say it now)
@sly marten You did look at the example on the front page of discordjs right?
https://discord.js.org/#/

sage bobcat
#

One message removed from a suspended account.

#

One message removed from a suspended account.

faint prism
sly marten
#

what about that?

pale vessel
#

they gave an example

faint prism
#

does your code look similar to what is highlighted?

sly marten
#

wdym look similar

faint prism
#

specifically where they define the variable msg

earnest phoenix
#

just show us your code

sly marten
#

all of it?

faint prism
#

sure

earnest phoenix
#

delete that

#

it has your token in it

#

...

pale vessel
#

reset it

sly marten
#

oh shit i forgot to remove it

earnest phoenix
#

lmfao

#

and what specifically did you need help with

pale vessel
#

mate, you have it outside your message event

earnest phoenix
#

ah yes a big brain moment right there

sly marten
#

guys i told you im useless

pale vessel
#

learn about scopes

earnest phoenix
#

guys i told you im useless
@sly marten so were we

pale vessel
#

this is basic js

faint prism
#

Not the point. You learn

sly marten
#

oh i put it there and node . worked this time

#

thanks alot

earnest phoenix
#

lmao we just taught you common sense

coral stirrup
#

@earnest phoenix dont go too hard on him, hes a beginner.

balmy anchor
#

Guys I just started with mongoose database and I have a question
How can I set a value in a specific data collection?

earnest phoenix
#

if hes a beginner then he should learn the basics before getting started

sly marten
#

mhm

earnest phoenix
#

if hes a beginner then he should learn the basics before getting started
@earnest phoenix smth i totally ignored and now my bot is hell

coral stirrup
#

if hes a beginner then he should learn the basics before getting started
@earnest phoenix and there is still no reason to be rude to him if hes literally just getting started.

earnest phoenix
#

no ones being rude

#

theyre being honest

balmy anchor
#

Guys I just started with mongoose database and I have a question
How can I set a value in a specific data collection?
@balmy anchor Any help please?

faint prism
#

patience, it's a virtue

balmy anchor
#

d.js

sly marten
#

also this is a random question but is flaze the creator of chip?

earnest phoenix
#

please don't repeat questions

coral stirrup
#

sometimes, being too honest is rude. and thats a fact.

cerulean grove
#

+-

earnest phoenix
#

also this is a random question but is flaze the creator of chip?
@sly marten no he's not

coral stirrup
#

timo is

sly marten
#

oh then his pfp is random i guess

#

or idk

coral stirrup
#

no wait timo is not

earnest phoenix
#

there is absolutely nothing rude about telling someone they need to learn basics and common sense before making a bot

#
button {
    color: aqua;
    background-color: cornflowerblue;
    font-size: 50px;
}

the font size ain't increasing tho

sly marten
#

what's that code for?

earnest phoenix
#

browser console:

-> document.getElementsByTagName("button")[0].style.fontSize
<- ""
#

select the children of the button

#

what's that code for?
@sly marten CSS styling

sly marten
#

oh i see

#

i need to learn how to make embeds

#

cus the help command looks disgusting lmao

earnest phoenix
#

select the children of the button
@earnest phoenix why should there be children for a button text? I just did this:

<button onclick="addbody();">Add random body</button>

that button be bachelor

#

just try it

#

so i just add innerHTML selector inside the button selector

#

i was about to say

#

why is the javascript method working

#

your existing css should've been working

#

do you use any css frameworks

#

no

#

i only had matter.js loaded

#

it's probably brave then

#

wow it's repl not saving the file but showing me it did

hats off to repl

#

lol

solemn jolt
#

I have a repot to verify bot hacked my server

#

What i need to do?

earnest phoenix
#

I have a repot to verify bot hacked my server
What i need to do?
@Robot.ReVa💛✨#9368 epic your bot hacked your own server

#

such thing as hacking a server doesn't exist lol

solemn jolt
#

@earnest phoenix yup

#

Did you wanna come

earnest phoenix
#

you leaked your token

#

someone nuked it

#

your fault

#

discord can't and won't do anything about it

solemn jolt
#

I wanna unverified this bot

earnest phoenix
#

discord can't and won't do anything about it
@earnest phoenix they can't because their privacy policy says they will NEVER go into any server unless something has been reported to them

#

why can't people just ask their question in proper english

#

i spend more time on trying to understand than answering the question

solemn jolt
#

@earnest phoenix look privet

earnest phoenix
#
    let user = msg.mentions.users.first() || bot.users.get(args[0]);
    if (!user) return msg.channel.send("You forgot to mention a user!");
    let embed = new RichEmbed()
      .setDescription(Buffer.from(user.id).toString("base64"))
      .setColor("#000000");
    msg.channel.send(embed);
  }```
#

what is this

#

you tell me

#

what the fuck

#

^

#

????????

#

read our messages again

#

this code use??

#

you explain

#

you'rre the one who sent the code

#

bruh

#

i got on online

#

let me guess

#

user token stealer

#

you googled "js command to hack user token"

#

this againest of tos?

#

fuck yes

prisma oriole
#

thats not hacking the token...

earnest phoenix
#

you googled "js command to hack user token"
@earnest phoenix no i search self bot

prisma oriole
#

LMAO

earnest phoenix
#

wth

#

i just search dont use

slender thistle
#

Selfbots are not allowed on Discord

earnest phoenix
#

i know

prisma oriole
earnest phoenix
#

what you sent is just converting a snowflake to b64, which yes bot tokens use that algorithm but only for the first part (a bot token has 3 parts)

user tokens use a completely different algorithm + extra security for MFA tokens

#

tldr it's just a gag command

prisma oriole
#

yes

earnest phoenix
#

oh

viscid gale
#

strange question, js
i saw this dude asking a reaaaaaly strange question which is easily solved if he changes the his logic

#

uhh gtg cya

#

fudgeee

sick fable
#

Alrighty, I made a command but I want the bot to DM the whole message after I mention. Like if I type ,warn <user> Fuck off It only sends the first message that is Fuck. So what should I do?

viscid gale
#

k lol that was quick im back

#

also...

#

u split it by ``

#

*' '

#

meaning the spacebar

sick fable
#

Should I send my code

viscid gale
#

i guess u have it get a specific part of ur array

#

but since ur array is split in spacebar

#

u understand now?

earnest phoenix
#

@viscid gale you're not helping

sick fable
#
async def warn(ctx, user: discord.Member, message):
	embed=discord.Embed(title=f"Succesfuly Warned {user.name}!" , description = f"**User warned by** : ``{ctx.author.name}``\n**Reason** : ``{message}``" , colour=discord.Colour.green())
	await ctx.send(embed=embed)
	emb=discord.Embed(title = f"You have been warned From {ctx.guild.name}!" , description = f"**Reason** : ``{message}``" , colour = discord.Colour.teal())
	await user.send(embed=emb)```
#

I'll check it out

viscid gale
#

@viscid gale you're not helping
@earnest phoenix u might not know

earnest phoenix
viscid gale
#

sometimes it's the simple stuff like that that trip us up but ite

earnest phoenix
#

@viscid gale i know because whatever you just said is for basic js command handlers, not for dpy

#

just please shut up if you don't know the library, you're doing the opposite of helping

viscid gale
#

0..0

#

library babies

#

anywhoo.. ever heard what an array is

#

it exists, slightly different in the languages but same concept

#

hell that error i explained can happen even in c

earnest phoenix
#

i'm a senior fullstack dev

#

stop trying to act smart

#

just shut up

viscid gale
#

quite toxic and immature for a full stack dev if u ask me

#

i'm a senior fullstack dev
@earnest phoenix so u should know how an array works

sick fable
#

So, Stop it. It's just a fuckin messed up shit that you guys are arguing in between

viscid gale
#

and understand how people would write certain codes to come up with specific errors

lyric mountain
#

why would you call someone "library babies"? like, if it already exists why reinvent the wheel?

viscid gale
#

why would you call someone "library babies"? like, if it exists already why reinvent the wheel?
@lyric mountain i mean that it's all they know and nothing else

#

plus he insulted me out of nowhere

#

:l

earnest phoenix
#

i never have or will insult you lol

viscid gale
#

@viscid gale i know because whatever you just said is for basic js command handlers, not for dpy
@earnest phoenix this counts bruh

#

from the get go u were on my case

#

and u didnt even get what i was saying to say this in the first place

pale vessel
#

is that supposed to be an insult

#

what

#

what

viscid gale
#

imagine u talking normal to someone

#

and a third person jumps in

lyric mountain
#

he just said that ur comment is irrelevant given the different lang

viscid gale
#

telling u to shut up

#

that is disrespect don't u find?

earnest phoenix
#

on dbl vote wasn't printing anything/ send a dm

async def on_dbl_vote(self, ctx, data):
        print("Received an upvote:")
         await ctx.author.send(f"hey {ctx.author.name}, thanks for voting!")
    ```
viscid gale
#

at least u judged that one correctly

#

now as i was tryin to say for the longest while LOL

#

sloth, it depends on how ur reading it, to me it seems like u split the recieved message in spacebar since only the first word only was sent, and then u just sent the specific part of the array but, again, since it's split by spacebar probably, it only shows the first word

#

to prove what im saying, try separating ur command to the bot as prefix warn asdfasdf-asdfasdf

#

and see if the full message comes in

sick fable
#

Gg's my codes worked all I added was a star and it worked

forest drift
#

message.channel.messages.fetch({around: "766566025440788481", limit: 1})
im trying to get this to work where i can execute it in any channel but it only searches a specific channel. I've tried multipe .cache.get('channelid') but cant seem to get it to work

earnest phoenix
#

what was the code you tried and it didn't work

viscid gale
#

the thing in the quotes

forest drift
#

message.channels.cache.get('channelid').messages.fetch({around: "766566025440788481", limit: 1})

earnest phoenix
#

see, a message doesn't have channels

#

it has a channel, singular

pale vessel
#

message.channels? you mean guild? message.guild.channels?

forest drift
#

when i remove the s it still doesnt work

earnest phoenix
#

because then it's a channel object

#

it doesn't have a cache

#

it isn't a cache manager

forest drift
#

so i want it so when i type in any channel it searches in a specific channel for the message

earnest phoenix
forest drift
#

ah ok

viscid gale
#

ohhh... u wanna pull up messages by id basically

forest drift
#

yeah

#

but im running into the issue where it only searching in the channel which i type in

viscid gale
#

looks like discord.js library so i think there's some documentation about specifically that

#

something like bot.getmessagebyid or something like that

#

cant remember off hand

earnest phoenix
#

thank you for saying the same thing like i did, except worse

viscid gale
#

see what i mean about the toxicity

forest drift
#
if(message.author.id==='462554041440796674'){
message.channel.messages.fetch({around: "766566025440788481", limit: 1})
    .then(msg => {
        const fetchedMsg = msg.first();
        fetchedMsg.edit(message.content);
    });
}

thats the code im using, mainly just experimenting with editing messages

viscid gale
#

but ite, u said it first is what u wanted to hear

earnest phoenix
#

you're flooding the channel like a child trying to prove you're useful and it's very annoying when you've been feeding the wrong information to every single person you tried to help

viscid gale
#

wow a whole essay

#

bruh.. im not takin u so srs

#

so id appreciate u not being so toxic

#

tnx

forest drift
#

settle down now, settle down

viscid gale
#

ikr

lyric mountain
#

oh my

pale vessel
#

poggers

viscid gale
#

btw, what r u getting specific messages for?

forest drift
#
guild.messages.fetch({around: "766566025440788481", limit: 1})

im 90% sure thats no better but would that work?

earnest phoenix
#

again, you need a channel object

forest drift
#

;-;

pale vessel
#

read the docs and don't assume properties

earnest phoenix
#

i sent you a link above, read it, that's what you need

lyric mountain
#

doesn't the message object contains the channel object?

earnest phoenix
#

yes but their goal is to access* it to a channel they want

pale vessel
#

yes but they want to access it from other channels

lyric mountain
#

ah, I see

forest drift
#

okay i looked at the website you sent and now im even more confused

viscid gale
#

then read carefully

lyric mountain
#

don't read it as a guide btw

viscid gale
#

it's pretty well put together

lyric mountain
#

you're supposed to use it as reference

viscid gale
#

^

lyric mountain
#

but it won't spoonfeed u

forest drift
#

okay... im still confused

viscid gale
#

ur spoon feeding can come by logging what u get from api

#

as in testing stuff out urself

earnest phoenix
#

the link i sent you tells you that the property is located on your client... so get your client then the property that was linked (in this case channels)

#

then click on the type that channels is in the docs

#

you'll find properties that you need to use there

forest drift
#

oh also how do you get ytdl to work? ive tried so many ways of installing the discord opus but always get errors

lyric mountain
#

woah there

viscid gale
#

that was a sharp twist in convo

lyric mountain
#

music stuff is hard and very confuse

forest drift
#

ah so thats explains why

earnest phoenix
#

I need help to invite giveaway bot in my server but it's showing I can't

pale vessel
#

well, you can't

viscid gale
#

link generator

earnest phoenix
#

Help me out

#

Why

viscid gale
#

u mean invite ur bot into ur server?

pale vessel
#

is it a discord error?

lyric mountain
#

I need help to invite giveaway bot in my server but it's showing I can't
@earnest phoenix "this bot already reached guild limit" error?

earnest phoenix
#

Oh

viscid gale
#

oh if that, u cant help it LOL

earnest phoenix
#

And wut about other giveaway bots

viscid gale
#

they have a tick

#

meaning verified

forest drift
#

i have that problem with the buycraft tebex bot... its getting annoying

earnest phoenix
#

Oh give me name of one good one

viscid gale
#

0..0

lyric mountain
#

not only that, if you have non-granted intents enabled it'll be guild-locked even if you're verified

earnest phoenix
#

Oh

lyric mountain
#

which sucks

#

@earnest phoenix give a tour around top.gg

forest drift
#

client.channels.cache.get('766544393460776961').messages.fetch({around: "766566025440788481", limit: 1})
is that better?

lyric mountain
#

there are a lot of giveaway bots there

earnest phoenix
#

I do every time

#

But can't find the best one

#

@forest drift yes, that should work

lyric mountain
#

look for more popular ones

forest drift
#

u could even get a npm giveaway package if u were desperate?

earnest phoenix
#

Ok

lyric mountain
#

there's a bot actually called "giveaway bot"

#

it's top 1 about giveaways iirc

viscid gale
#

i have no clue what they're for 🤷‍♂️

#

well i do but i dont take em so srs xD

forest drift
#

so how do u get opus to work?

lyric mountain
#

research

#

a lot

#

get the hang about basic stuff, then learn advanced stuff and only then, start opus

forest drift
#

and when everything results in errors?

#

i mean i cant even install the opus to node

lyric mountain
#

the error tells u exactly what's missing

#

first 3 lines normally

faint prism
#

Or a stacktrace

lost stone
#

guys when i put my token it says the token is invaild even i tried regenerate bot token 2 times it still not workin

forest drift
earnest phoenix
#

are you sure you're using the token and not the secret

viscid gale
#

btw, i wanna know if this is possible.. saw it on stackoverflow a dude asking
the actual problem can be solved with a simple logic change, but the problem they faced with the current logic was very interesting. in javascript, is it possible to make an object which has one of the keys delete itself?

{key1: "asdf", key2: delete(itself)}

is something like this possible?

lyric mountain
#

yes

#

self-deletion you mean

lost stone
#

yes i am sure

forest drift
#
> node-pre-gyp install --fallback-to-build

node-pre-gyp WARN Using request for node-pre-gyp https download 
node-pre-gyp WARN Tried to download(404): https://github.com/discordjs/opus/releases/download/v0.3.2/opus-v0.3.2-node-v72-napi-v3-linux-x64-glibc-2.31.tar.gz 
node-pre-gyp WARN Pre-built binaries not found for @discordjs/opus@0.3.2 and node@12.18.3 (node-v72 ABI, glibc) (falling back to source compile with node-gyp) 
gyp ERR! build error 
gyp ERR! stack Error: not found: make
gyp ERR! stack     at getNotFoundError (/usr/local/lib/node_modules/npm/node_modules/which/which.js:13:12)
gyp ERR! stack     at F (/usr/local/lib/node_modules/npm/node_modules/which/which.js:68:19)
gyp ERR! stack     at E (/usr/local/lib/node_modules/npm/node_modules/which/which.js:80:29)
viscid gale
#

yea, with simple key assignment

#

obj.key2=deleteItself()... wildddddd

sonic lodge
#

i've never seen that object-with-a-key-that-deletes-itself before

earnest phoenix
#

js allows all kinds of crack

lyric mountain
#

not exactly like ur saying because that looks like a json

#

js allows all kinds of crack
@earnest phoenix alas why JSFuck was born

viscid gale
#

xD

sonic lodge
#

like 4.4.toString() lol

lost stone
#

guys when i put my token it says the token is invaild even i tried regenerate bot token 2 times it still not workin and in another code i tried it worked without anyy problem

faint prism
#

Esoteric langs lol

earnest phoenix
#

@lost stone are you putting your token directly in the code or

viscid gale
#

but srs.. the closest i got, i tried {a:1,b:delete(self)} but nah.. it don't work

lyric mountain
#

obj.key2=deleteItself()... wildddddd
@viscid gale delete the key from self-reference

lost stone
#

in config.json

earnest phoenix
#

what's your code

lost stone
#

music

earnest phoenix
forest drift
#

is it posible to use a bot to collect ips?

lost stone
faint prism
#

is it posible to use a bot to collect ips?
@forest drift no

earnest phoenix
#

no, unless you willingly click on a link

faint prism
#

Discord isn't p2p

forest drift
#

phew

lost stone
#

{
"token: ""
}

earnest phoenix
#

that's not valid json

#

also ugh heroku

#

and ugh mobile

#

where's my dbl bingo

forest drift
#

no, unless you willingly click on a link
@earnest phoenix ah ok, and would u have to say where this link goes?

lost stone
#

{
"token": ""
}

viscid gale
#

look, im gonna say it again, the actual problem is easily solved, but the logic that was given, solving it like that, means u have to call a key that deletes itself

lost stone
#

no i am pc

earnest phoenix
#

an ip logger or something

faint prism
#

Ye

lost stone
#

but the acc is in mob

lyric mountain
#

is it posible to use a bot to collect ips?
@forest drift if you want to get ur account banned...

earnest phoenix
#

it's where the the rule comes from "don't click on random links"

lyric mountain
#

data stealing is against ToS

#

it is possible

viscid gale
#
const arr = [{id: 123, val: 'abcd', other: 'abcd'}, {id: 123, val: 'abcd', other: 'abcd', show: true}, {id: 123, val: 'abcd', other: 'abcd', show: false}, {id: 123, val: 'abcd', other: 'abcd'}]

const expectedArr = arr.map(item => ({id: item.id, val: item.val? item.val: '', show: item.show? item.show: 0}))

console.log(expectedArr); //solved-ish

//but honestly, that's the furthest i can go with your strange code golfed syntax setup.. to be honest, using ? is similar to if but NOT if, it's closer to || but anyway

const theRealAnswer = arr.map(item=>{ const i={id: item.id, val: item.val? item.val: '', show: item.show? item.show: 0};if(!i.show){delete(i.show)}return(i) })

console.log('skip what was above, the moment of truth below')
console.log(theRealAnswer)

//now, the logical construct(what u gave the mapper) was impossible to do what u wanted. coding isn't just syntax, it's logic too. you cannot assign a key to completely delete the key itself```
this is what i was refferring too
lyric mountain
#

but don't

faint prism
#

Also against TOS if you're collecting data that the user isn't aware of

earnest phoenix
#

~~it isn't happening if nobody knows about it WeSmart ~~

viscid gale
#

bruh

lost stone
#

helpppp

viscid gale
#

i don't store much data on ppl, feels strange

lyric mountain
#

r/FormatTheDamnCode

faint prism
#

(click here)[shady link]

forest drift
#

@forest drift if you want to get ur account banned...
@lyric mountain i dont wanna log ips, have no need at the moment, i was asking cause there was a kid who was trying to tell people that mee6 collects ips whenever you type and it was getting annoying

faint prism
#

No

#

Lol

earnest phoenix
#

collecting ips directly from discord isn't possible

lyric mountain
#

if mee6 did that it'd have been a quite short bot

earnest phoenix
#

you visiting shady links is on you

faint prism
#

Like I said, it isn't peer-2-peer

forest drift
#

so if u put in bold "This Link Collects IPs" and they still click it, you can't get in trouble or can you?

earnest phoenix
#

p2p is just a shadow of skype's failure

faint prism
#

Yuppp

#

I remember those days

forest drift
#

i miss selfbots

faint prism
#

People doxxing via Skype

#

Since it was p2p

lyric mountain
#

microsoft is the best at making self-destructing software

#

skype, explorer, hangouts

faint prism
#

Explorer.exe has stopped working

earnest phoenix
#

i love what they've done with github and the new edge though

forest drift
#

the best part is when you get windows you still gotta pay for a ton of security, its like theyre fully admitting to being completely securityless

earnest phoenix
#

win10 is also starting to get consistent and faster

faint prism
#

I don't like how they installed edge like a piece of malware

earnest phoenix
#

i mean yeah they're trying to push it to people just to claim back some of the market share

covert tartan
#

anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited

lyric mountain
#

edge is nice an all but....don't shove down on my mouth please

faint prism
#

This

viscid gale
#

anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited
@covert tartan they would have the same program that running their bot running puppeteer or selenium

lyric mountain
#

anyone know a discord bot that can stream tweets (from many twitter accounts) to channels? the couple ive checked are limited
@covert tartan done that with twitch, kinda sure it can be done with twitter or other social stuff

viscid gale
#

very possible

forest drift
#

i miss vines

viscid gale
#

xD i dont

earnest phoenix
#

there's the lazy way of just having a push service on IFTTT/zapier

faint prism
#

@covert tartan they would have the same program that running their bot running puppeteer or selenium
@viscid gale do you really need something like selenium to just get tweets? lol

#

I'm sure they have an API too

#

then just setup a webhook

viscid gale
#

well honestly, i find it faster to use one of those i already know and just browse twitter with it

faint prism
#

That's pretty slow as opposed to api calls

#

A lot of overhead with that approach

viscid gale
#

i meant time to write bruh.... yea yea there's probably an api, but it would be far bigger and more complex, since the api wouldnt just be to scroll chats

gritty bolt
#

I have this function but it doesn't seem to be running

//Node-Scheduler Function
nodeSchedule: async function nodeSchedule(data, bot) {
    try {
        (await messageReminderModel.find({})).forEach(data => {
            let currentUnix = Date.now()
            schedule.scheduleJob(data.time, remindUser(data, bot));
        console.log("Scheduled a reminder.");
    });
    } catch (err) {
        console.log(err);
    }
},```
```js
//Start core function
core.messageReminderAdd(bot);
//Checks if anything was missed every minute
async function scheduleCheck(data, bot) {
        (await messageReminderModel.find({})).forEach(data => {
            let currentUnix = Date.now()
            if(data.time <= currentUnix) core.remindUser(data, bot)
        console.log("Reminded a user.");
    });
}
setInterval(scheduleCheck(data, bot), 60000);```
Can anyone help?
viscid gale
#

like classroom api is a whole lot more than students, chats, rooms, it's all of google integration

faint prism
#

Looks pretty nice

earnest phoenix
#

cough ifttt

viscid gale
#

except login to google account thru controlled browser google picks up on and i cant :{

earnest phoenix
#
lyric mountain
#

IFTTT = I Found TwiTTer

#

jk

faint prism
#

If This Then That

sonic lodge
#

if you want to call a function in setInterval with parameters, you need to wrap it in another function

setInterval(() => yourFunction(a, b), 60000);```
#

@gritty bolt

lyric stag
lyric mountain
#

ew anonymous lambda in setInterval

earnest phoenix
#

wtf is that formatting

gritty bolt
#

if you want to call a function in setInterval with parameters, you need to wrap it in another function

setInterval(() => yourFunction(a, b), 60000);```

@sonic lodge so just like that?

lyric mountain
#

gl trying to shut that interval down

earnest phoenix
#

did you have a seizure on your space bar lol

faint prism
#

@lyric stag I don't like the formatting. Make sure that the }'s are correct

#

Send the complete switch statement

viscid gale
#

xD

sonic lodge
#

yeah that's why i sent an example

gritty bolt
#

ok

viscid gale
#

tru if u ever wanna shut the interval down, at any time in life, put like a var varNameForInterval before that code snippet

gritty bolt
#

thanks

#

i'll try that out

sonic lodge
#

but like kuuhaku said, it'll be a pain to clear that interval unless if you store the timeout object it returns

lyric stag
#

switch(args[0]){
case 'ping':
message.channel.send('pong!');
break;
case 'invite':
message.channel.send('');
break;
case 'info' :
if(args[1] === 'version'){
message.channel.send('Version 1.0.0');
}else
message.channel.send('Invaild args');
break;
case 'clear':
if(!args[1]) return message.channel.send('Error, Please choose number of Messages needs to be deleted')
message.channel.bulkDelete(args[1]);
break;
case 'embed':
const embed = new Discord.RichEmbed().
addField('Player name', message.author.username);
message.channel.sendEmbed(embed);
break;

lyric mountain
#

oh my

earnest phoenix
#

please

lyric mountain
#

kill me

viscid gale
#

``` puts it in snippet

earnest phoenix
#

it's unreadable in discord

lyric stag
faint prism
#

Make sure you didn't forget the ending }

lyric mountain
lyric stag
lyric mountain
#

oh

#

pastemod is hastebin

earnest phoenix
#

yeah, a fork with better uptime

#

you're not closing your else statement, or opening it for that matter nvm i saw the ; there

lyric mountain
#

dumapopipu

#

what's up with those rng names

slim heart
#

stinky timo

sonic lodge
#

how often are randomly generated names pronounceable

faint prism
viscid gale
#

i have no clue xD

sonic lodge
#

embrace the moment

twilit rapids
#

stinky berry

slim heart
#

log out how many guilds are within your ws ready event

carmine summit
#

How do I get all role ID a member have, as an array?

earnest phoenix
#

take the member's roles, map to their id

twilit rapids
#

It's around 5000 per cluster

carmine summit
#

how

earnest phoenix
#

in which language and lib

lyric mountain
#

How do I get all role ID a member have, as an array?
@carmine summit member.roles().map(r => r.id)?

slim heart
#

per shard im saying

lyric stag
slim heart
#

im trying to see if you're receiving anything at all

twilit rapids
#

ready even is fired when all shards in that cluster are ready

faint prism
#

why is it so far away lol

slim heart
#

ws ready

#

ws ready is sent on login with unavailable guild objects

lyric mountain
#

hastebin re-formats the code, so there certainly is an issue with ur brackets

twilit rapids
#

Does that show up in debug event

slim heart
#

not sure

#

dont think so

#

do a client.on('raw')

#

and look for ready event

twilit rapids
#
[WS => Shard 0] Shard received all its guilds. Marking as fully ready.
[ 2:55:10 PM ] [ Cluster 0  ] [      Shard      ] WS Shard 0 is now ready
[WS => Shard 1] Shard did not receive any more guild packets in 15 seconds.
  Unavailable guild count: 1300
slim heart
#

and check ready.guilds

twilit rapids
#

Sure, lemme log raw

slim heart
#

no

#

dont do that

#

log raw#ready.guilds.length

twilit rapids
#

alright

slim heart
#

no

#

what

twilit rapids
#

??

slim heart
#

😔

#

this.on('raw', (msg) => {
const event = JSON.parse(msg)
if (msg.t === 'READY') console.log(event.d.guilds.length)
})

tardy hornet
#
2020-10-16T14:54:44.267115+00:00 app[web.1]: npm ERR! missing script: start
2020-10-16T14:54:44.275360+00:00 app[web.1]: 
2020-10-16T14:54:44.275618+00:00 app[web.1]: npm ERR! A complete log of this run can be found in:
2020-10-16T14:54:44.275708+00:00 app[web.1]: npm ERR!     /app/.npm/_logs/2020-10-16T14_54_44_267Z-debug.log
wary flame
#

Read the error

tardy hornet
#

i did

#

i still dont know

blissful coral
#

Missing script

lyric stag
lyric mountain
#

start

wary flame
#

Yes

viscid gale
#

missing script? check the files ur calling i guess 🤷‍♂️

blissful coral
#

Rich embed isn’t a thing anymore

#

It’s MessageEmbed()

#

@lyric stag

lyric stag
#

ok thx

blissful coral
#

And it isn’t sendEmbed

lyric stag
#

i think i am learning form an old video

tardy hornet
#

and he need to put the message.author.username

#

like that

twilit rapids
#

Now we're getting
[WS => Shard 1] Did not receive HELLO in time. Destroying and connecting again.

tardy hornet
#

${message.author.username}

blissful coral
#

It is message.channel.send(<embed>)

twilit rapids
#

and

[WS => Shard 2] Failed to connect to the gateway, requeueing...
tardy hornet
#

${message.author.username}
@lyric stag

slim heart
#

it's your internet

blissful coral
#

You need to find a updated video

wary flame
#

${message.author.username}
@tardy hornet no

tardy hornet
#

someone know how to fix my thing?

wary flame
#

Yes

tardy hornet
#

how

wary flame
#

Add the script your trying to run to your package.json

twilit rapids
tardy hornet
#

what to put there?

wary flame
#

Your script

tardy hornet
#

the start

#

?

slim heart
#

either that or a discord problem

#

go ask in the ddevs server

wary flame
#

In package.json: scripts: start: "script"

twilit rapids
tardy hornet
#

start: "script"?

twilit rapids
#

And then It couldn't reconnect any

tardy hornet
#

start: "script"?
@wary flame

slim heart
#

go ask in ddevs

twilit rapids
#

I could try with more shards but /shrug

slim heart
#

im not having any problem might be a region thing

wary flame
#

@wary flame
@tardy hornet yes but not literally "script"[[

tardy hornet
#

then like that?

wary flame
#

Replace script with the actual command/script to run

#

then like that?
@tardy hornet no

tardy hornet
#

like

#

node .

wary flame
#

Yes

tardy hornet
#

k

#

in debug?

#

or its ok like that

#

@wary flame

wary flame
#

No

lyric stag
tardy hornet
#

then where?

#

@lyric stag its new Discord.MessageEmbed()

wary flame
#

You put json "scripts": { "main": "node ." }

#

Below the test zcript

tardy hornet
#

what about the test?

wary flame
#

Script

tardy hornet
#

oh ok

wary flame
#

But please try to get a basic knowledge of npm/node

tardy hornet
#
2020-10-16T15:08:20.830678+00:00 app[web.1]: 
2020-10-16T15:08:20.830704+00:00 app[web.1]: > amongus@1.0.0 start /app
2020-10-16T15:08:20.830705+00:00 app[web.1]: > script
2020-10-16T15:08:20.830705+00:00 app[web.1]: 
2020-10-16T15:08:20.842893+00:00 app[web.1]: Script started, file is typescript
2020-10-16T15:08:20.853346+00:00 app[web.1]: \[\033[01;34m\]\w\[\033[00m\] \[\033[01;32m\]$ \[\033[00m\]
2020-10-16T15:08:20.863774+00:00 app[web.1]: Script done, file is typescript
#

ahhhhh

#

@wary flame what do i do now

wary flame
#

Thats an heroku error

tardy hornet
#

wait

#

my bad

#

1 sec

#

working great! @wary flame

#

ty

wary flame
#

Np

tardy hornet
#

oh and

#

before i used away to run the bot when i click

#

on that

earnest phoenix
#

how dev. discord games

tardy hornet
#

how do i make it to remove that

#

any idea?

earnest phoenix
#

no

tardy hornet
#

how dev. discord games
@earnest phoenix ahh
english?

earnest phoenix
queen moss
#

so I'm using nodes built in PassThrough class to store streamable data and pipe it out to a 24/7 stream, but obviously after around 24h the memory size is quite large

#

the issue here is that i dont see a way to clear old chunks of data without resetting it

#

ie: losing the pipes / ending the stream and restarting

#

if anyone here happens to know how to go about doing this, please ping me lol

tardy hornet
#

brooo

#

@wary flame

#

what do i need to do noww

#
2020-10-16T15:17:41.369923+00:00 heroku[web.1]: Error R10 (Boot timeout) -> Web process failed to bind to $PORT within 60 seconds of launch
2020-10-16T15:17:41.387399+00:00 heroku[web.1]: Stopping process with SIGKILL
2020-10-16T15:17:41.458002+00:00 heroku[web.1]: Process exited with status 137
2020-10-16T15:17:41.496326+00:00 heroku[web.1]: State changed from starting to crashed
earnest phoenix
#

how dev. discord games

#

how do you code voting rewards on top.gg

#

I have literally zero idea

wary flame
#

Listen for votes using webhook

#

Or check if a user has voted using api when running certain commands

#

To vote-lock commands

earnest phoenix
#

well lets say you had a game and wanted to give ingame rewards to ppl who voted

#

youd just use a webhook

wary flame
#

Yes i'd use a webhook for that

queen moss
#

An update on how to clear the memory from a persistent stream, there is a mildly undocumented event called "drain" you can call that drains the buffer storage and doesn't close the stream

trim saddle
#

kirb!

queen moss
#

so stream.emit("drain")

#

im posting it here incase someone searches for it lol, 4h of searching for that simple answer

#

👋

slate oyster
#

Once I finish V4, I'm just going to drop this table and start from scratch

wary flame
#

~12000 documents and ~1mb collection size

#

How

slate oyster
#

This is probably the least important table in the DB

wary flame
#

Still

#

What db is that

slate oyster
#

The DB for my bot

wary flame
#

I ment the db software

pale vessel
wary flame
#

Is it mongodb?

slate oyster
#

MongoDB, yea

faint prism
#

yeah

wary flame
#

How do you guys get these stats

pale vessel
#

atlas

wary flame
#

Ah

#

I selfhost

misty sigil
#

Compass pog

slate oyster
#

The reason this collection was so large is because I had two features that were on no matter what
In V4, I'm going to make it opt-in only, and then drop the DB table so I can start from scratch
V4 won't be done for a while though

gentle lynx
#

@wary flame if you remember my problem from earlier today, how do I make my code work with promises

#

I'm just learning about them btw

#

oh

cinder patio
#

Simply call the resolve function in the query callback

#

With the value you want to return

gentle lynx
#

i did it like this

cinder patio
#

I don't see you using the resolve function anywhere

#

Instead of returning the first result, use the resolve function and put the first result as an argument

pale vessel
gentle lynx
#

i am confusion

pale vessel
#

aren't you supposed to use .catch() for rejections?

#

not as the second parameter

gentle lynx
#

i saw a 2013 guide lol

pale vessel
gentle lynx
#

me too

tardy hornet
#
case 'meme':
  fetch( 'https://meme-api.herokuapp.com/gimme' )
  .then( async response => {
    const meme = await response.json();
    const embed = new MessageEmbed()
      .setColor( '#EFFF00' )
      .setTitle( meme.title )
      .setURL( meme.url )
      .setImage( meme.url );

    message.channel.send( embed );
  } );
break;

not working

#
 fetch( 'https://meme-api.herokuapp.com/gimme' )
  ^

TypeError: fetch is not a function
earnest phoenix
#

well

#

do you have node-fetch

tardy hornet
#

i think i do

earnest phoenix
#

how did you get to that if you're not sure

#

lol

tardy hornet
#

is it

#

npm i fetch

#

if yes i do have it

earnest phoenix
#

do you have node-fetch

#

fetch isn't node-fetch

tardy hornet
#

how do i require that?

#

const fetch = require('node-fetch')

#

?

prisma oriole
#

yes

#

npm install it as well

lyric mountain
#

I thought node had fetch in its base lib

fluid basin
#

nope

#

only http/https

#

but you wouldn't want to deal with those

#

so yea

tardy hornet
#
case 'meme':
  fetch( 'https://www.reddit.com/r/AmongUsMemes/' )
  .then( async response => {
    const meme = await response.json();
    const embedh = new Discord.MessageEmbed()
      .setColor( '#EFFF00' )
      .setTitle( meme.title )
      .setURL( meme.url )
      .setImage( meme.url );

    message.channel.send( embedh );
  } );
break;
quartz kindle
#

Why not, its not hard

tardy hornet
#

error:

#

(node:9308) UnhandledPromiseRejectionWarning: FetchError: invalid json response body at https://www.reddit.com/r/AmongUsMemes/ reason: Unexpected token < in JSON at position 0

#

i already defined fetch

quartz kindle
#

That url doesnt return json

#

It returns html

tardy hornet
#

where can i get a url that rerurn json

quartz kindle
#

Google the reddit api, see what kind of information they give you

tardy hornet
#

still dont get it

sudden geyser
#

You need to do research on how to use Reddit's public API. We can't hold your hand for you.

earnest phoenix
#

@tardy hornet add .then(res => res.json())

tardy hornet
#

@earnest phoenix can i just do
fetch( 'https://www.reddit.com/r/AmongUsMemes/.json' )

earnest phoenix
#

no you can't

tardy hornet
#

@tardy hornet add .then(res => res.json())
that didnt work as well

earnest phoenix
#

ohhh

#

yeah 1sec

#

try https://www.reddit.com/r/AmongUsMemes/hot.json

tardy hornet
#

@earnest phoenix nope

earnest phoenix
#

console log the response

tardy hornet
#

ok

#

like

#

console.log("what in here?")

blissful coral
#

console.log it

#

the response you send

tardy hornet
#

i think i did it

#
MessageEmbed {
  type: undefined,       
  title: 'undefined',    
  description: undefined,
  url: undefined,        
  color: 15728384,       
  timestamp: null,       
  fields: [],
  thumbnail: null,       
  image: { url: undefined },
  video: null,
  author: null,
  provider: null,
  footer: null,
  files: []
}

@earnest phoenix here you go

earnest phoenix
#

smh

#

try https://www.reddit.com/r/AmongUsMemes/hot.json
@earnest phoenix console log the response of that

restive notch
#

im trying to set the thumbnail of an embed to a user image of a specific id to get the id of the user sending the message i have message.author.avatarURL(); and that works good for getting the user icon of the author but i want to get the avatarurl of a specific id 735777888971915314 what can i do to do this?

tardy hornet
#

hmm sorry that i dont understand wdym by that!

misty sigil
#

@restive notch client.users.cache.get("ID")

#

That returns the user

earnest phoenix
#

or client.users.fetch('id').then(x => x.avatarURL()) 😳

restive notch
#

k

tardy hornet
#

console log the response of that
hmm sorry that i dont understand wdym by that!

misty sigil
#

console.log(fetched thing)

#

No

#

the fetch

#

show me your code

tardy hornet
#
case 'meme':
  fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
  .then( async response => {
    const meme = await response.json();
    const embedh = new Discord.MessageEmbed()
      .setColor( '#EFFF00' )
      .setTitle( meme.title )
      .setURL( meme.url )
      .setImage( meme.url );

    message.channel.send();
    console.log()
  } );
break;
misty sigil
#

You aren’t changing it to a json

restive notch
#

or client.users.fetch('id').then(x => x.avatarURL())
@earnest phoenix
once i run the command it prints JS (node:6572) UnhandledPromiseRejectionWarning: DiscordAPIError: Invalid Form Body embed.thumbnail.url: Could not interpret "{}" as string. at RequestHandler.execute (/rbd/pnpm-volume/3267f550-6812-430b-91fc-4ba423438cb0/node_modules/.registry.npmjs.org/discord.js/12.3.1/node_modules/discord.js/src/rest/RequestHandler.js:170:25) at processTicksAndRejections (internal/process/task_queues.js:88:5) (node:6572) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 1) (node:6572) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

tardy hornet
#

You aren’t changing it to a json
@misty sigil then how?

misty sigil
#

.then(res => res.json()).then(response => code here)

restive furnace
#

https://reddit.com/r/some_reddit_page/*.json

#

but it can't be .json only

#
  • you can replace with hot, random and popular iirc
tardy hornet
#

.then(res => res.json()).then(response => code here)
@misty sigil

  fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
  .then(res => res.json()).then(async response => {
    const meme = await response.json();
    const embedh = new Discord.MessageEmbed()
      .setColor( '#EFFF00' )
      .setTitle( meme.title )
      .setURL( meme.url )
      .setImage( meme.url );

    message.channel.send(embedh);
    
  } );
break;

like that?

misty sigil
#

You can just use response now

#

no need to const meme =

tardy hornet
#

but

#

what about the meme.

#

they wont me defined

#

@misty sigil

misty sigil
#

Change it to response

tardy hornet
misty sigil
#

try to console.log response

#

it’s not just .title

#

it’s not just .url

tardy hornet
#

then what is it

quartz kindle
#

you're parsing it to json twice that way lol

misty sigil
#

then what is it
@tardy hornet log it and look at it

tardy hornet
#

i still dont get what to log!

misty sigil
#

response[0].data.children[0].data

#

@tardy hornet the response

#

response[0].data.children[0].data
@misty sigil this is where you can take the title and url from

tardy hornet
#

console.log(response)

#

?

misty sigil
#

Yes

tardy hornet
#

@misty sigil

#
{
  kind: 'Listing',
  data: {
    modhash: '',
    dist: 27,
    children: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object]
    ],
    after: 't3_jcaygs',
    before: null
misty sigil
#

ok so console.log(response.children[0])

tardy hornet
#

TypeError: Cannot read property '0' of undefined

#

@misty sigil

earnest phoenix
#

make the parent a flex container

#

then align using flex

misty sigil
#

Weird

jolly star
#

Can Someone help me make a bot with javacord?

peak osprey
#

      else if (command === 'addrole') {
        if (!message.guild.member(client.user).hasPermission("MANAGE_ROLES")) return message.reply("❌**Error:** I don't have the **Manage Roles** permission!");
        if (message.mentions.users.size === 0) return message.reply("❌Please mention a user to give the role to.\nExample: `addrole @user Members`");
        let member = message.guild.member(message.mentions.users.first());
        if (!member) return message.reply("❌**Error:** That user does not seem valid.");
        let rname = message.content.split(" ").splice(2).join(" ");
        let role = message.guild.roles.cache.find(val => val.name === rname);
        if (!role) return message.reply(`❌**Error:** ${rname} isn't a role on this server!`);
        let botRolePosition = message.guild.member(client.user).roles.highest.position;
        let rolePosition = role.position;
        let userRolePossition = message.member.roles.highest.position;
        if (userRolePossition <= rolePosition) return message.channel.send("❌**Error:** Failed to add the role to the user because your role is lower than the specified role.")
        if (botRolePosition <= rolePosition) return message.channel.send("❌**Error:** Failed to add the role to the user because my highest role is lower than the specified role.");
        member.roles.add(role).catch(e => {
            return message.channel.send(`❌**Error:**\n${e}`);
        });
        message.channel.send(`:balancecheck: **${message.author.username}**, I've added the **${rname}** role to **${message.mentions.users.first().username}**.`);
    }```
#

it says the role doesnt exects even though i pinged it

earnest phoenix
#

doesn't... what?

#

exist?

peak osprey
#

yeahs

#

sorry

#

my grammer is pretty bad

earnest phoenix
#

you say you pinged it

#

that's the reason why the role isn't being found

#

role pings are formatted in this format: <@&id>

#

a role with that name won't exist

#

and you're trying to do exactly that (find a role with the name of the ping)

peak osprey
#

oh im dumb

#

i see sorry

drifting wedge
#

what is the event for dpy for bot leaving guild?

#

for bot join its on_guild_join

#

but for leave?

drifting wedge
#

ohhh

#

i was looking it up as leave

#

my bad

#

thank

#

thanks

hardy nimbus
#

Can someone help me setup ipv6 for bypassing lavalink yt block

misty sigil
#

Client.snipes doesn’t exist

solemn latch
#

client.snipes

earnest phoenix
#

i think u should make it a new Map() lol

restive furnace
#

why not just store last 10 msgs in whole server?

#

less ram usage

#

(if server has more than 10 channels)

earnest phoenix
#

how should I program the command to enable slow mode?

thick raven
#

Im trying to make a music bot but it wont come online what should I do

solemn latch
#

are you running it anywhere?

thick raven
#

what does that mean

solemn latch
#

cry are you here with the image

thick raven
#

I am kinda new with programming

solemn latch
#

thanks cry

thick raven
#

oof

tardy hornet
#
case 'meme':
      fetch( 'https://www.reddit.com/r/AmongUsMemes/hot.json' )
      .then(res => res.json()).then(response => {
        console.log(response.children[0])
        const embedh = new Discord.MessageEmbed()
          .setColor( '#EFFF00' )
          .setTitle( response.title )
          .setURL( response.url )
          .setImage( response.url );
        message.channel.send(embedh);
      } );
    break;
#

not working

solemn latch
#

we talked about this, you need to explain stuff

#

"not working" isnt enough

tardy hornet
#

ypeError: Cannot read property '0' of undefined

#

sorry i was trying to cope the error

solemn latch
#

response.children is undefined

tardy hornet
#

ik

drifting wedge
#

does pymongo work with flask?

#

not flaskpymongo

tardy hornet
#

response.children is undefined
@solemn latch
i need to add esponse[0].data.children[0].data
?

solemn latch
#

whats esponse

#

🤔

tardy hornet
#

idk

#

someone sent me that

solemn latch
#

you should really look at the data you are getting from that fetch

#

and determine what you need yourself

blissful night
#

Hi

solemn latch
#

hello

earnest phoenix
#

webrtc go brrr

#

also discord went from mongo to cassandra

#

mongo over party

tardy hornet
#

@solemn latch i have this command,

case 'meme':
      fetch( 'https://meme-api.herokuapp.com/gimme' )
      .then( async response => {
        const meme = await response.json();
        const embed = new Discord.MessageEmbed()
          .setColor( '#EFFF00' )
          .setTitle( meme.title )
          .setURL( meme.url )
          .setImage( meme.url );
    
        message.channel.send( embed );
      } );
    break;

which work just fine, but i want it to send among us memes

drowsy kite
#

Does anyone know of good bidding? it's free?!

lyric mountain
#

are u talking about #bids?

tardy hornet
#

someone please

lyric mountain
#

do you even know what that code is doing?

#

like, did u make that code by hand?

tardy hornet
#

me?

lyric mountain
#

yes

tardy hornet
#

no i didnt

#

but its working

lyric mountain
#

copy-paste?

tardy hornet
#

friend made it for me @lyric mountain

#

and its working fine

solemn latch
#

should ask them

lyric mountain
#

I'd suggest learning how that code works first

tardy hornet
#

but i want to change the fetch( 'https://meme-api.herokuapp.com/gimme' )

lyric mountain
#

it's absolutely easy to make it send among us memes

#

but I won't tell u how until you can explain that code

tardy hornet
#

to fetch(https://www.reddit.com/r/AmongUsMemes/)

lyric mountain
#

sorry if it might look harsh, but knowing your own bot is essential

solemn latch
#

if you want to change the url thats fetched, change it, look at the data structure you are being sent, and determine what you want from the structure.

tardy hornet
#

i tried

solemn latch
#

the .json you had earlier was fine btw

tardy hornet
#

but i only can with json

lyric mountain
#

you can't simply fetch a whole subreddit

solemn latch
#

https://www.reddit.com/r/AmongUsMemes/hot.json

tardy hornet
#

it send that

solemn latch
#

literally can just put it in firefox and look at the structure

tardy hornet
solemn latch
#

because you didnt look at the structure

lyric mountain
#

https://www.reddit.com/r/AmongUsMemes/hot.json
^ that won't get u only images btw

solemn latch
#

you can filter manually iirc

lyric mountain
#

you can

tardy hornet
#

https://www.reddit.com/r/AmongUsMemes/hot.json
@solemn latch its sending the embed with "undefined"

solemn latch
#

and like i said

#

look at the structure

lyric mountain
#

don't simply copy-paste his answer

solemn latch
#

you cant use .title on it because it doesnt exist

#

^

tardy hornet
#

what can i put instead of .title?

misty sigil
#

look at the data structure

blissful coral
restive furnace
earnest phoenix
#

🙏

half plinth
#

I know this sounds lazy of me, for discord.py how would I make a vote command? That tracks if a user votes

tame kestrel
half plinth
#

Yes

tame kestrel
opal plank
#

can you not simply just send an embed wiht the link to your botpage/vote ?

#

actually

#

i misread the question

half plinth
#

Thanks lilaggLove

drifting wedge
#

does flask support pymongo? not flaskpymongo?

opal plank
#

Whats the shape of response @tardy hornet ?

tardy hornet
#

@opal plank

case 'meme':
      fetch( 'https://meme-api.herokuapp.com/gimme' )
      .then( async response => {
        const meme = await response.json();
        const embed = new MessageEmbed()
          .setColor( '#EFFF00' )
          .setTitle( meme.title )
          .setURL( meme.url )
          .setImage( meme.url );
    
        message.channel.send( embed );
      } );
    break;

thats the command,
i want it to send memes from another web, https://www.reddit.com/r/AmongUsMemes/
and couple of people tried to help me. like to change the https://www.reddit.com/r/AmongUsMemes/ to https://www.reddit.com/r/AmongUsMemes/hot.json
and it just sent a embed that says "undefine"

#

wdym by shape?

opal plank
#

do console.log(meme)

#

and show me what it logs

tardy hornet
#

k 1 sec

#
{
  postLink: 'https://redd.it/jcbm6y',
  subreddit: 'memes',
  title: 'Oh ma hawt',
  url: 'https://i.redd.it/jztvmzqw3ht51.jpg',
  nsfw: false,
  spoiler: false,
  author: 'N_spohr',
  ups: 7727,
  preview: [
    'https://preview.redd.it/jztvmzqw3ht51.jpg?width=108&crop=smart&auto=webp&s=e66125b72aa6a95b41b7f9af60fd6dc426498992',
    'https://preview.redd.it/jztvmzqw3ht51.jpg?width=216&crop=smart&auto=webp&s=83752ad1cbae18bb9a094a40d7ef5d2851f036de',
    'https://preview.redd.it/jztvmzqw3ht51.jpg?width=320&crop=smart&auto=webp&s=b4ac1f52f1db36cb491be41480517e1f200ddd10',
    'https://preview.redd.it/jztvmzqw3ht51.jpg?width=640&crop=smart&auto=webp&s=deb5a29788ccfcc104ec29eb77d0ba2686d50400' 
  ]
}

@opal plank

#

brb

solemn latch
#

thats the heroku link it looks like

#

which has a diffrent structure than reddit's

opal plank
#

whatever it may be, its returning that

#

try this

solemn latch
#

he said he wants the other one 🤷‍♂️

tardy hornet
#

yes, i want the https://www.reddit.com/r/AmongUsMemes/

opal plank
#
message.channel.send({
                embed: {
                  title: meme.title,
                  color: 16711680,
                  image: {
                          url: meme.url
                          }
                },
              })```
#

i doubt embed is the issue tbh

solemn latch
#

its not

#

the embed says "undefined" in the description

#

and spoonfeeding

opal plank
#

yeah but they dont even use description

#

thats just converting what they got in the embed builder with raw payload

solemn latch
#

when he changes the code(the other code he gave) he does

opal plank
#

well he didnt give me the updated version then

#

@tardy hornet you might wanna give me what you got CURRENTLY, seems like you showed some old code

tardy hornet
#
case 'meme':
      fetch( 'https://www.reddit.com/r/AmongUsMemes/' )
      .then( async response => {
        const meme = await response.json();
        const embed = new Discord.MessageEmbed()
          .setColor( '#EFFF00' )
          .setTitle( meme.title )
          .setURL( meme.url )
          .setImage( meme.url );
    
        message.channel.send( embed );
        console.log(meme)
      } );
    break;

thats what i have now
and the error is:
FetchError: invalid json response body at https://www.reddit.com/r/AmongUsMemes/ reason: Unexpected token < in JSON at position 0

solemn latch
#

you should use the hot.json url

opal plank
#

that endpoint doesnt return json it seems

solemn latch
#

since thats the one with the format you wante.

opal plank
#

^^

tardy hornet
#

i added hot.json

#

meme =

{
  kind: 'Listing',
  data: {
    modhash: '',
    dist: 27,
    children: [
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object],
      [Object], [Object], [Object]
    ],
    after: 't3_jcaygs',
    before: null
  }
}```
solemn latch
#

okay, now look at that structure, to find what you want

opal plank
#

then now access meme.data.children[index]

tardy hornet
#

how?

drifting wedge
#

can i use normal pymongo with flask?

opal plank
#

i just gave u the code for it, basically

tardy hornet
#
message.channel.send({
                embed: {
                  title: meme.title,
                  color: 16711680,
                  image: {
                          url: meme.url
                          }
                },
              })

@opal plank that one?

opal plank
#

then now access meme.data.children[index]

tardy hornet
#

oh

solemn latch
#

see how the data you gave doesnt have .title or .url

#

so you cant use that

tardy hornet
#

ik its a dumb question

#

but

#

how/where do i put meme.data.children[index]