#development

1 messages ยท Page 1195 of 1

opal plank
#

thats not the issue

#

its suppose to run twice when debugging

#

pre-commit

#

the upper one is for the beta branch(my debugging session)

#

then commit

#

now it no work on the main branch

earnest phoenix
#

@opal plank soul ?

#

nah

#

i have my template

#

so i just copy and paste

#

that is

#

$3 best price

#

:))

opal plank
#

lets see if that fixes it

#

this is a really odd bug ngl

#

i guess it was that little snippet up there

#

how come this is setting the whole message as empty?

earnest phoenix
#

@opal plank huh ?

#

u use twitch api ?

opal plank
#

ternary is somehow sending the whole message as empty

earnest phoenix
#

uhh

opal plank
#

i dont think thats suppose to happen

earnest phoenix
#

try ? `ur text` : `NOTHING`

#

then see what will happend

#

if it send ntohing

#

nah

#

it is useless

opal plank
#
let a = `a ${ 1 < 0 ? 'yes' : ''}`

thats suppose to send a

#

not ``

earnest phoenix
#

online > 0

#

u have 0 viewers

opal plank
#

wrong

#

thats on the beta branch

#

not on the main

earnest phoenix
#

hmm

opal plank
#

its definetly that bit screwing up

#

though compiles just fine on my end

#

yeah wtf

earnest phoenix
#

1 < 0

#

wait

#

1 > 0

#

is true

opal plank
#

if u didnt realize thats me forcing it to be falsey

earnest phoenix
#

right ?

#

oh

dawn plaza
#

Ho do you get a bot to count how many servers it is in?

misty sigil
#

what lib

opal plank
#

cache size

#

prob d.js

dawn plaza
#

^

earnest phoenix
#

@dawn plaza

client.guilds.cache.size
opal plank
#

then yes, channels cache size

#

guild*

#

not channels

dawn plaza
#

Thank you!

earnest phoenix
#

oh no

opal plank
#

twitch has been fucking my brain up cuz im calling them channels

earnest phoenix
#

i spoonfeeded

solemn leaf
#

can

opal plank
solemn leaf
#

I do this so see if a message about to be sent is morn then 2000 characters

#

if (data.length >= 1500) return;

opal plank
#

works once and then breaks wtf

misty sigil
#

djs docs are confusing

solemn leaf
#

^^

misty sigil
#

i mean not too confusing

#

i can read through them

solemn leaf
#
module.exports.run = async (bot, message, args) => {

    figlet(args.join(' '), function (err, data) {
        if (err) {
            console.log('Something went wrong...');
            console.dir(err);
            return;
        }
        if (data.length >= 1500) return;
        message.channel.send(Embed)
        
    })
}

can I do this to prevent message being to big and breaking my bot?

opal plank
#

cache is also definetly there

#

93 channels in cache

#

wtf

#

OH SHIT

#

i see the issue now

restive furnace
#

if u didnt realize thats me forcing it to be falsey
@opal plank why not just use true

#

i mean false

opal plank
#

no clue tbh

dawn plaza
#

How would I make the bot say the answer to client.guilds.cache.size, if it needs a string to send?

#

Sorry I'm super new

opal plank
#

concat it

#

actually

#

no template

#

fuck my brain frying it

earnest phoenix
#

@misty sigil discordjs.guild is better

misty sigil
#

what

#

no

earnest phoenix
#

yes

#

it has example

misty sigil
#

more detailed

#

and has examples too

earnest phoenix
#

but not alots

#

beginers wont understand it

misty sigil
#

no

earnest phoenix
#

yes

restive furnace
#

discordjs.guild is non-existent too :)

misty sigil
#

you shouldn't be a beginner to reading docs if you're making a bot

earnest phoenix
#

u sure ?

#

huh ?

opal plank
#

thats a guide

#

not a doc

restive furnace
#

i would rather use discord.js.org than non-existent discordjs.guild, even discordjs.guide exists.

misty sigil
#

that isnt a documentation page

#

its more a spoonfeed page ngl

restive furnace
#

^^^

earnest phoenix
#

@restive furnace but it exist : /

opal plank
#

thats the for dummies docs they got

earnest phoenix
#

its more a spoonfeed page ngl
@misty sigil LMAO

restive furnace
#

discordjs.guild doesnt

#

bruh

misty sigil
earnest phoenix
#

yes

#

ik

#

me 2

misty sigil
#

not mr spoonfeed

earnest phoenix
#

LoL

misty sigil
#

at least discordjs.guide says to learn js

restive furnace
#

yes

dawn plaza
#

My bot's response to client.guilds.cache.size is 0, when it's in a server

misty sigil
earnest phoenix
#

does .guild cheap ?

opal plank
#

literaly big ass 'BEFORE YOU CONTINUE'

dawn plaza
#

is there a reason?

misty sigil
#

well it istn cached

restive furnace
#

and probably 0.5 of 10 will lesrn js

misty sigil
#

lOL

restive furnace
#

who read that guide

earnest phoenix
#

does .guild cheap ?

opal plank
#

cheap?

earnest phoenix
#

yes

misty sigil
opal plank
#

define cheap

earnest phoenix
#

the domain

misty sigil
#

@earnest phoenix .guild doesnt exist

earnest phoenix
#

wut

dawn plaza
#

@misty sigil How do I cache it?

opal plank
#

i dont think it exists either

misty sigil
#

.guild isnt a tld

restive furnace
#

abalhahababahahabahahaha.moe/eris is best for eris

earnest phoenix
#

???????????

opal plank
#

GUIDE

#

not GUILD

misty sigil
#

thats guide you silly goat

earnest phoenix
#

but u understand what i ment

opal plank
#

no we didnt

earnest phoenix
#

._.

restive furnace
#

not to bully, but are you kind of blind?

prime glacier
#

what we can do with discord bot list api's

misty sigil
#

@dawn plaza if youre using discord.js it should be cached

opal plank
#

EEEEEEEY i got it

#

pesky bug, go away spray

misty sigil
opal plank
#

now waiting for my cache to reload all the streams

#

roughly 60 seconds

misty sigil
#

remove the bugs

opal plank
misty sigil
#

nobody likes them ๐Ÿ›

earnest phoenix
#

i hate this life

misty sigil
earnest phoenix
#

4 week to wait

#

smh

opal plank
#

OOF

#

i can already see the cpus going up

earnest phoenix
#

just wonderting:
Can i dm a mod and tell them to accept my bot ?

misty sigil
#

no

earnest phoenix
#

:))

opal plank
#

if you wanna get baned? sure

earnest phoenix
#

LoL

opal plank
#

quickest way to get their attention ti so @ mods

#

the role

earnest phoenix
#

do it

opal plank
#

you do it

earnest phoenix
#

or maybe @everyone

restive furnace
#

No one:
Memleaks: ๐Ÿ‘€
Also memleaks: Haha, got you! I ate 12 GB of your ram.

opal plank
#

omg its still joining the subscribed channels

earnest phoenix
#

to get the fastest attention

opal plank
misty sigil
#

bigchomp ๐Ÿ

opal plank
#

finally all channels back up

#

les see

#

eeey les gooo

earnest phoenix
#

102 steream ?

#

bruh

#

how

#

howwwwwwwwwwwwwww

opal plank
#

1.6 mil users

earnest phoenix
#

it is ur bot ?

#

?????????????????????

opal plank
#

indeed

earnest phoenix
#

???????????????

#

bruhhhhhhhhhhhhhhhhhh

opal plank
#

spam

earnest phoenix
#

i hate u

#

-bots @opal plank

gilded plankBOT
opal plank
#

love u too

#

no commands here btw

earnest phoenix
#

ok

opal plank
earnest phoenix
#

@opal plank 6 servers ?

#

bruh

#

why

opal plank
#

wdym 6 servers?

earnest phoenix
#

ur bot

opal plank
earnest phoenix
#

in 6 servers

opal plank
#

no u dummy

#

click the link to invite

#

check if there

#

or just ask me

earnest phoenix
earnest phoenix
#

@opal plank

opal plank
#

ยฏ_(ใƒ„)_/ยฏ

earnest phoenix
#

@opal plank u need to post data

opal plank
#

no u need to post

#

you the one who wants to know about my bot

misty sigil
earnest phoenix
#
setInterval(() => {
            dbl.postStats(bot.guilds.size);
        }, require("ms")("6h"));
#

:))

misty sigil
#

what

#

why use ms for that

#

just use a ms value

earnest phoenix
#

idk

opal plank
#

imagine using dbl

misty sigil
#

and post 30mins not 6 hour

opal plank
#

i just use it for votes

#

ยฏ_(ใƒ„)_/ยฏ

misty sigil
opal plank
#

if you really curious bout the bot how bout you just click me @earnest phoenix

earnest phoenix
#

@misty sigil why

#

i dont want to

#

@opal plank no

#

idc about u

#

:))

earnest phoenix
opal plank
#

anyway, back to writing more spaghetettitteh code

earnest phoenix
#

yeah I'm here Not Erwin

#

what do you want

#

spaghetettitteh ig

opal plank
#

i want free code, pliz gib

earnest phoenix
#

take me to church
and ill worship like a dog EXECUTE MEH
there @opal plank you can take me and go home
for free
not sure if the weapon you use will cost

restive furnace
#

-bots @opal plank --noembed

gilded plankBOT
#

Not Erwin#8753's bots:
@earnest phoenix

opal plank
#

hozier huh

#

why people doing commands here?

restive furnace
#

idk

opal plank
#

just click me

restive furnace
#

but nice bug found

#

it wont answer n.help in dms

#

:)

opal plank
#

i despise dm bots

#

my bot will ONLY ever dm you to thank you for voting

#

thats it

restive furnace
#

ok

opal plank
#

'le user casually doing their stuff'
ping
'le user thinking its some nice people to talk to'
'le user see its bot'
'le user mad'
'bad bot, 0/5 review on google'

clear tiger
#

Heyo, any idea how to change the long description background on your bot page with css? I've tried changing the background-color of .longdescription with no luck

#

Same with the text color of the library link, as well

#

Thanks in advance for any help YuiBless

solemn leaf
#

why isnt it pinging the user

earnest phoenix
#

is that in an embed title

#

/ author

#

now i am not bot dev

#

:((

#

delete my bot

solemn latch
earnest phoenix
#

:((

opal plank
#

@solemn leaf embeds dont mention users

solemn leaf
#

-bots

gilded plankBOT
opal plank
#

also those mentions are only resolved locally

#

no commands here btw

solemn leaf
#

no

#

I was proving a point

opal plank
#

just screenshot

solemn leaf
opal plank
#

that emans ur bot isnt here

solemn leaf
#

but it did ping it

opal plank
#

its client, its nothing related to discord

solemn leaf
#

how can I do that

opal plank
#

it didnt

solemn leaf
#

okay

opal plank
#

you cant

#

its client side

solemn leaf
#

how can I do name

opal plank
#

if the bot is cached on your client, it'll resolve, if not, it wont and will just show the id

#

idk how you're coding your bot

#

ยฏ_(ใƒ„)_/ยฏ

solemn leaf
#
let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(c => c.displayName.toLowerCase() === args.join(" ").toLowerCase()) || message.member
#

bot is

#

client

opal plank
#

resolve by name

solemn leaf
#

?

opal plank
#

all of those have users accessible on member

solemn leaf
#

so

opal plank
#

access user then user_name iirc

#

either name or user_name

#

i think its name though

#

i should stop doing snake case for my twitch lib

opal plank
#

this is what i get for doing that crap non standartized

solemn leaf
#

why do my gifs

#

keep gettin cleared

#

Im getting made

opal plank
#

wdym cleared?

solemn leaf
#

mad*

opal plank
#

what?

solemn leaf
#

I had like 100s

opal plank
#

not for us to answer, if you think its a bug, go to

solemn leaf
opal plank
#

AAAAAAAAAAAAAAAAAH

#

fucking command broke again

solemn leaf
#

what

opal plank
#

its undefined then

solemn leaf
#

okay

#

so

#

JSON.stringify(user)

opal plank
#

also your variable user isnt a user btw

#

its a member

solemn leaf
#

ok

#

so how do I get name form member

#

or switch to user

opal plank
#

again

#

access user

#

then name

solemn leaf
#

can i do this

#

user = message.mentions.users.first() || message.guild.users.cache.get(args[0]) || message.guild.users.cache.find(c => c.displayName.toLowerCase() === args.join(" ").toLowerCase()) || message.author

misty sigil
#

yes i suppose

solemn leaf
#

'cache' of undefined

opal plank
#

undo what you did

misty sigil
#

message.guild.members

opal plank
#

you already getting a member in all those scenarios

solemn leaf
#

let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(c => c.displayName.toLowerCase() === args.join(" ").toLowerCase()) || message.member

opal plank
#

log your member before

#

just to check whats coming

solemn leaf
#

@opal plank @solemn leaf

#

@solemn leaf

opal plank
#

thats not a member

#

log your member

solemn leaf
opal plank
#

not your user

solemn leaf
#

wai

opal plank
#

titles dont get mentions

#

only fields, description and footer iirc

#

prob not footer

solemn leaf
#

AHH

#

okay

opal plank
#

there was a third one somewhere

solemn leaf
#

footer does

#

i think

#

author

opal plank
#

i dont recall

solemn leaf
#

wait ti did it

opal plank
solemn leaf
#

slow clap

#
.setFooter(user.displayName, user.user.displayAvatarURL({ dynamic: true }))
opal plank
#

whats wrong with that?

solemn leaf
#

it did my name

#

not theirs

misty sigil
#

no it didnt

#

your name is aki

solemn leaf
#

im nicked

opal plank
#

look at the pic

#

its not urs dude

solemn leaf
#

ik

opal plank
#

then?

solemn leaf
#

it should be their name

#

not mine

faint prism
#

ohh

opal plank
faint prism
#

perhaps a variable is incorrectly used

opal plank
#

i got what you mean but idk how the f that happened

#

its really confusing that you calling your var user when its a member though

#

just induces confusion

faint prism
#

console.log variables and the variable's name lol

solemn leaf
#

user is

#

<@id>

opal plank
#

im pretty sure its not suppose to to.string() it

solemn leaf
#

?

opal plank
#

it should return an object

#

not a string

solemn leaf
#

okay

#

but

#

why does the pfp work not the name

#
.setFooter(user.displayName, user.user.displayAvatarURL({ dynamic: true }))
#

doesnt make sense

misty sigil
#

try user.user.username

solemn leaf
#

@misty sigil thank but I want it to be the nick on the server>

misty sigil
#

does it matter

solemn leaf
#

I prefer it

faint prism
#

I don't like how the variable name is user lol. Especially since it has a property with the same same

opal plank
#

oh ffs

solemn leaf
#

anyone got a good icon for spotify

faint prism
solemn leaf
faint prism
solemn leaf
#

yes

#

done

#

that is gonna be it

opal plank
#

i like that you ask a question and answer it yourself

#

anyone got a spotify icon?

faint prism
#

I tried too

opal plank
#

hmmmmmmmmmm

#

aparently that bug isnt over

#

and its such a pain in the ass to debug on ubuntu host

faint prism
#

pull the branch to windows and develop on there

heavy marsh
faint prism
#

guild id/channel id?

heavy marsh
#

hmm nope

opal plank
#

guild_id/channel_id/message_id

faint prism
#

Oh, msg id probably

opal plank
#

oh

#

thats cdn

earnest phoenix
#

Bot id?

heavy marsh
#

Nope

#

Its not bot id

opal plank
#

thats attachment id iirc

heavy marsh
#

Is there a way to get that?

faint prism
#

msg id is probably one of them

opal plank
#

if you delete the media its proxy fucks up

#

send message

#

then edit payload without image

#

try the link again

#

even if message exists its proxy gets removed iirc

#

that last id is the attachment id iirc

#

dont quote me on that though, its been a long as time ive fucked with attachments

heavy marsh
#

hmm so send message then edit it?

opal plank
#

send message with pic

#

grab the attachment url

#

edit the SAME message without image in it

#

then check link(reload)

#

i think it'll say not found iirc

#

cuz that message no longer has any attachments on it

heavy marsh
#

Well I need it for a command

opal plank
#

if a user deletes the message its gg

heavy marsh
opal plank
#

you'd need to store the image somewhere

#

try what i said

heavy marsh
#

Is there a way to do it on discord.js

opal plank
#

of course

#

<channel>.send(payload)

#

I FIXED IT

#

for good this time

#

bad cache

faint prism
#

angry*

opal plank
#

angery

#

the act of being angered

#

cache still booting

#

but the fact that it replied means whatever the fuck was going on fixed

#

this is trust issues 101

#

the amount of conditional chain is insane

misty sigil
#

if if if

faint prism
#
elif```
opal plank
misty sigil
#

? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ?? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ?? ? ? ? ? ? ? ?

opal plank
#

not my fault ubuntu doesnt have a gui

misty sigil
#

or as shivaco once said

opal plank
#

otherwise i'd just open vsc and debug it

#

debugging with just a terminal is cancer

misty sigil
opal plank
#

how the heck am i suppose to debug this

topaz saddle
#

bruv moment

opal plank
#

cant see the values real time, might as well proof it

topaz saddle
opal plank
misty sigil
#

you cannot trust the twitch api

opal plank
#

its not even twitch, thats my code(but yes, dont trust twitch api, its jankier than my code)

#

and THATS saying something

misty sigil
#

jankier than that?

#

bloody hell

opal plank
#

indeed

slender thistle
#

lmao

opal plank
#

they dont even do sharding

#

im having to do cluster node processes to handle that many users

#

well, i will, not rn

drifting wedge
#

im using ffmpeg

#

how can i add it to my bot folder

#

like what files do i add?

opal plank
#

reminder to self:
never again

dawn plaza
#
if(command === 'test'){client.commands.get('test').execute(message, args);
} else if(command === 'insult'){
client.commands.get('insult').execute(message, args);
#

How would I turn this into a switch statement?

sudden geyser
#

You could go a step further and make it more dynamic by not using ifs or switches.

dawn plaza
#

How?

sudden geyser
#

but if you wanted to do switches, just do switch (command) and each case being the command name string

#

To go dynamic, save client.commands.get(...) to a variable and give the first argument command (which is what the user entered)

#

If a command was found, you'll have something. If nothing was found, you'll get undefined. Check if it's not equal to undefined and run it (.execute(message, args)) if it exists.

dawn plaza
#

Okay, thank you!

opal plank
#

use a@dawn plaza command handler

sudden geyser
#

what they're doing is a command handler

opal plank
#

dynamic command handler

#

not a slighlty better if chain

#

im so about to regret doing this too

faint prism
#

Personally, as long as the logic is separated from the event handler, it's fine
||JS devs: muh command handler||

low shard
#

Hi

#

Wassup guys

opal plank
#

not much, screeching at twitch

#

as usual

faint prism
#

Wassup guys
@low shard Is there something development related you had a question for?

opal plank
#

cluster chunk caching implemented

calm junco
#

im trying to add a welcome message but these keep showing up

#
C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\index.js:24
    const channel = member.guild.channels.find(channel => channel.name === "welcome");
                                          ^

TypeError: member.guild.channels.find is not a function
    at Client.<anonymous> (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\index.js:24:43)
    at Object.onceWrapper (events.js:422:26)
    at Client.emit (events.js:315:20)
    at Object.module.exports [as GUILD_MEMBER_ADD] (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\discord.js\src\client\websocket\handlers\GUILD_MEMBER_ADD.js:16:14)
    at WebSocketManager.handlePacket (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\discord.js\src\client\websocket\WebSocketManager.js:384:31)
    at WebSocketShard.onPacket (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\discord.js\src\client\websocket\WebSocketShard.js:444:22)
    at WebSocketShard.onMessage (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\discord.js\src\client\websocket\WebSocketShard.js:301:10)
    at WebSocket.onMessage (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\ws\lib\event-target.js:125:16)
    at WebSocket.emit (events.js:315:20)
    at Receiver.receiverOnMessage (C:\Users\karin\OneDrive\Desktop\Discord VA-Mods\node_modules\ws\lib\websocket.js:797:20)```
faint prism
#

should I try to make a bot in JS instead of dotnet...? ๐Ÿ˜ฌ

calm junco
#

im trying to add a welcome message but these keep showing up
@calm junco ?

still merlin
#

.cache.find

#

not .find

calm junco
#

who u tlkin to

still merlin
#

you

calm junco
#

now it does dis

#
PS C:\Users\karin\OneDrive\Desktop\Discord VA-Mods> .cache.find
.cache.find : The term '.cache.find' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling 
of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
+ .cache.find
+ ~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (.cache.find:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException```
still merlin
#

<your guild channels thing>.cache.find

calm junco
#

oh

#

ty

#

what do i put here

#

do i put this

#

or

#

welcome

eternal osprey
#

hey guys

#

so currently i made a bot that actually shows the weather of a given place

#

how can i actually search places BY the weather?

#

so if i do: weather sunny

earnest phoenix
#

find an api that supports it

faint prism
#

^ that or scrape some website

eternal osprey
#

it will give me a list of countries

#

okay

faint prism
quartz jewel
#

Anyone else use nano as an editor for coding?

faint prism
#

Anyone else use nano as an editor for coding?
@quartz jewel if I'm in a linux terminal, yeah.
I used it for bash scripting mainly

quartz jewel
#

I use it for all coding on Linux and never code on anything other than Linux.

opal plank
#

Nano is literally the only thing ive been using on linux tbh

#

But only when needed

#

Vsc > nano

golden condor
#

Vscode is easier to use

quartz jewel
#

My main reason for using it is because can code faster.

golden condor
#

But if you are reluctant

#

Use text editor

quartz jewel
#

nano > Visual Studio Code

golden condor
#

lies

quartz jewel
#

It's preference though @golden condor

faint prism
#

nano > Visual Studio Code
@quartz jewel They are pretty different, so it's not a very good comparison

digital ibex
#

lmfao

#

if ur looking for ease of use, def sublime text 3 imo

faint prism
#

Isn't that paid software?

quartz jewel
#

@faint prism Yeah one has a graphical interface and the other doesn't.

digital ibex
#

yeah

faint prism
#

or am I thinking of atom

digital ibex
#

but u just press ok and nothing happens

quartz jewel
#

Sublime is free.

eternal osprey
#

hmm i can't find an api where you can actually search by weather type.

#

anyone that knows one by chance?

faint prism
#

hmm i can't find an api where you can actually search by weather type.
@eternal osprey What would that even return with?

digital ibex
#

its like, download it, and then it says ur free trial has expired and that bs, just press ok and nothing happens, auger

faint prism
#

its like, download it, and then it says ur free trial has expired and that bs, just press ok and nothing happens, auger
@digital ibex like WinRAR

quartz jewel
#

You get asked now and then to buy a license but not required to continue using it.

eternal osprey
#

if i type like, !weather sunny

#

it gives me a list with a couple of countries that have the same weather type

#

atm

faint prism
#

so a way to implement that would be to have an array of top 50 popular cities or something and filter it by weather

quartz jewel
#

Why not just use one that does it by country and filter it yourself.

eternal osprey
#

i already have one that actually responds with the weather information

#

but you have to give a country/place first

quartz jewel
#

Use the information from each country/place/town/city and filter the weather types.

eternal osprey
#

yeah i will search a tutorial for that

#

as i have no clue on how to do that right now

solemn leaf
#

hiii

eternal osprey
#

hi aki

ancient nova
thick gull
#

no

#

thatโ€™s a community post

#

suggestion

ancient nova
#

alright

eternal osprey
#

hey guys

#

how do i use this site

#

to make a command like !weather sunny

#

and it gives me all the countries with sunny weather?

thick gull
#

it depends on the site you use

#

some sites might have that functionality

#

others might not

earnest phoenix
#

Is there a way to unreact? I've added await m.react('X') but I'd like to remove the reaction. Anyway I can? Using Discord.js.

faint prism
#

how do i use this site
@eternal osprey https://openweathermap.org/api

eternal osprey
#

?

#

can't i do something like this:

#

fetch(
"https://api.openweathermap.org/data/2.5/forecast?q=" +
this.state.userInput +
"&units=metric&APPID="
)
.then(results => {
return results.json();
})
.then(data => {
let days = data.list.filter(day => {
return day.dt_txt.endsWith("15:00:00");
})
.map((day, index) => {
return (
<CardComponent
i={index}
flip={e => {
let card = document.getElementById(index);
card.classList.toggle("is-flipped");
}}
date={day.dt_txt.slice(5, 11)}
temp={Math.round(day.main.temp)}
/>
);
});
this.setState(() => {
return {
days: days,
userInput: ""
};
});
})
.catch(error => {});

#

but then filter it with the keyword sunny?

#

and make different databases for each weather type?

#

and connect that database to the actual keyword used in the command. So if you type !weather sunny, it would trigger the sunny database?

#

or is this the most shit that you guys have heard?

quartz jewel
#

@eternal osprey Use code block for it.

sand skiff
#

i need help

#

how do i make a

#

DM system

sudden geyser
#

What is a "DM System". If you can come up with what it is, you'll probably be able to fill in the logic on how it goes (but can refer here if you run into trouble).

opal plank
#

while not againts tos i would disencourage dms

#

users dont usually loke dms

sand skiff
#

DM SYSTEM= Where if you run a command "-dm @sand skiff You have been fired.
-Sent from the Team" and this DM system has a cooldown

#

and the mentioned person gets that dm

#

You have been fired.
-Sent from the Team

opal plank
#

dont allow people to dm thru ur bot

sand skiff
#

but with a specific role

opal plank
#

can be used for bsd reasons

sand skiff
#

oh

#

ok

#

ill make sure

#

i want it to be a role setup so that

#

after i mention the role

#

like

earnest phoenix
#

even with a specific role someone can send something that is against the TOS (child porn, cub, etc.) and get your bot terminated

opal plank
#

mass dms likely

sand skiff
#

oh ok

opal plank
#

thsts againsf tos

earnest phoenix
#

mass dming is api abuse, so yes

quartz jewel
#

You'd want to restrict the command and think of all worst case scenarios and prevent them from occurring.

sand skiff
#

ok

drifting wedge
#

whats the code of hex colors?

earnest phoenix
#

0x000000

drifting wedge
#

ah

#

would this be ok? 0x3498DB

quartz jewel
#

Yes.

drifting wedge
#

umm

#

saying invalid syntax

earnest phoenix
#

what's your code

drifting wedge
#

its saying invalid syntax

#

1 sec

#

colour = discord.Colour.0x2ECC71()

earnest phoenix
#

oh my god

quartz jewel
#

Remove () it isn't a function.

sand skiff
#

how do i make a command -uptime and it will say respond with something like I have been online for: 0 days, 10 hours, 53 minutes, 39 seconds.

slender thistle
#

no

earnest phoenix
#

it also isn't a property either

slender thistle
#

no and no

#

also no

sand skiff
#

?

#

how do i make a command -uptime and it will say respond with something like I have been online for: 0 days, 10 hours, 53 minutes, 39 seconds.

slender thistle
#

@drifting wedge it's not a property of the discord.Colour class

drifting wedge
#

?

slender thistle
#

It's literally converted into an integer as-is from 0x......

drifting wedge
#

so remove discord?

quartz jewel
#

@sand skiff Record how much time has passed since the ready event has been emitted.

slender thistle
#

remove discord.Colour

opal plank
#

what

slender thistle
#

Because a hexadecimal number is an object

#

not a property of anything by default

#

It's a Python object

sand skiff
#

@sand skiff Record how much time has passed since the ready event has been emitted.
@quartz jewel what is the code tho

drifting wedge
#

and this is also wrong? colour=self.0x2ECC71

#

giving me errors

quartz jewel
#

That hex color isn't a property.

faint prism
#

Lol

#

@quartz jewel what is the code tho
@sand skiff get creative

slender thistle
#

It's quite literally an object

#

Think of it as a number

#

like 5

drifting wedge
#

ok

tough glen
#

@earnest phoenix

slender thistle
#

It exists on its own and not as a property of anything

eternal osprey
#

hey guys how do i filter information of openweathermap?

tough glen
#

What is your library?

eternal osprey
#

i want it to only show sunny countries

tough glen
#

hey guys how do i filter information of openweathermap?
@eternal osprey use json

#

Oh

#

Idk

eternal osprey
#

if i type !weather sunny

#

it gives me a list of all the countries that have sunny weather at that moment

drifting wedge
#

python

tough glen
#

Wdym?
@earnest phoenix discord py, js, cpp

slender thistle
#

colour=0x......

tough glen
#

@eternal osprey you could look through all countries, that would be long tho

eternal osprey
#

yeah i could create a database for that and manually put that in

#

but that wouldn't update

tough glen
#

Okay

quartz jewel
#

@eternal osprey You can update it using ajax.

eternal osprey
#

uhhm

#

i'll stick with the filtering plan

solemn leaf
#
const Discord = require("discord.js");

module.exports.run = async (bot, message, args) => {
    let color = '#' + ("000000" + Math.random().toString(16).slice(2, 8).toUpperCase()).slice(-6)

    let user = message.mentions.members.first() || message.guild.members.cache.get(args[0]) || message.guild.members.cache.find(c => c.displayName.toLowerCase() === args.join(" ").toLowerCase()) || message.member
    let role = message.guild.roles.fetch(args[1])

    user.roles.add(role.id)

    const Embed = new Discord.MessageEmbed()
        .setColor(color)
        .setTitle('Roled:')
        .setAuthor('Moderation Command')
        .setDescription(`${user.user.username} with ${role.name}`)

    return message.channel.send(Embed);

}

module.exports.help = {
    name: "role"
}

what am I doin wrongs

eternal osprey
#

what is the error

sudden geyser
#

Aki for the record, you can just pass "RANDOM" instead of trying to generate a random color yourself.

#

What is your exact error though? I see that you tried using .fetch(...) on the roles manager, which returns a promise, which could be your issue since you don't resolve it.

solemn leaf
#

@sudden geyser wait what

sudden geyser
#

What what

sand skiff
#

i need helppp

drifting wedge
#

embed = discord.Embed(
colour = 0x3498DB()
)

#

saying not callable

#

int not callebled

solemn leaf
#

@sudden geyser what do i do then

slender thistle
#

You don't call it

sudden geyser
#

It's as it says: int is not callable.

quartz jewel
#

0x3498DB that isn't a function.

sudden geyser
#

So remove the ()

drifting wedge
#

i did

#

didnt wrok

slender thistle
#

0x3498DB()

#

doesn't look like you did

sudden geyser
#

@sudden geyser what do i do then
@solemn leaf you resolve the promise first. Either with await or .then

drifting wedge
#

no like i did

#

and it put it back\

#

but ill try again

solemn leaf
#

okay @sudden geyser

#

let role = await message.guild.role.fetch(args[1])

sudden geyser
quartz jewel
#

@drifting wedge Use something like sololearn or codeacademy to learn the language first.

solemn leaf
#

okay

#

but you said I could do await

faint prism
quartz jewel
#

await looks cleaner tbh.

faint prism
#

especially with that template lol

opal plank
#

that log mzkes

#

itsound

#

like selfbot

#

i hate mobikd

#

dont mind me

solemn leaf
#

?

quartz jewel
#

You make a lot of typos on mobile.

solemn leaf
#

now this is the thing erroin

sudden geyser
#

Yeah using JS isn't that hard but it's also a weakness

solemn leaf
#

once you get into image

#

stuff with js

#

good luck

quartz jewel
#

I've used JS that long that dislike the language.

solemn leaf
#

@sudden geyser okay the role id works I think

sudden geyser
#

good

solemn leaf
#

nvm

#

it is undefined

#
    let role = await message.guild.roles.fetch(args[1])
    console.log(role.name)
eternal osprey
#

how do i filter info from openweatherapi?

solemn leaf
#

@sudden geyser it didnt

quartz jewel
#

By using the .filter method.

eternal osprey
#

okay

#

is it also possible by using the weather-js package?

quartz jewel
#

You would have to read the documentation to find that out.

sudden geyser
#

@solemn leaf log the value of role to the console and see what you got

faint prism
#

Or use a debugger and breakpoints

quartz jewel
#

^

worthy glacier
#

how do i have a command that adds a field to a mongodb document

faint prism
#

That doesn't sound too difficult

quartz jewel
#

Doesn't sound difficult at all.

faint prism
#

how do i have a command that adds a field to a mongodb document
@worthy glacier I'd start by looking for how to add a field with your library

earnest phoenix
#

whatsup gamers

faint prism
#

Then just add that into a new command

quartz jewel
#

Create a command that takes an argument for naming the field, connect to the database and run an sql query on it.

faint prism
#

whatsup gamers
@earnest phoenix 24hrs later

earnest phoenix
#

nevermind

pale vessel
#

sql query

sharp thicket
#

hi does anyone know how to check if a message pinged the bot

quartz kindle
#

which library

sharp thicket
#

discord.js

quartz kindle
#

message.mentions.users contains all the mentions in the message

sharp thicket
#

i tried using if(message.content) but it does not work

#

so

#

if

#

?

#

would that work?

quartz kindle
#

nope

sharp thicket
#

huh

quartz kindle
#

message.mentions.users is a collection

sharp thicket
#

oh

quartz kindle
#

you can use collection.has()

sharp thicket
#

oh ok baii

#

ima go sleep

worthy glacier
#

doesnt work i think id have to edit the schema everytime i added or deleted a field

neon island
#

How to update nodeJS ? Debian 9 linux

drifting wedge
#

how can i add the ffmpeg thing to github?

#

and to heroku?

#

or should i add it as a requirement?

modest smelt
#

lol

faint prism
#

Hm, so in JS
to construct an object you'd do something like: const obj = new MyObject() yeah?

#

And then you can reference it's methods via obj.someMethod()

neon island
#

i'm in vps linux debian 9

#

i have a error for my discord bot

#

is requessted update nodejs

quartz kindle
#

either install the package from the nodejs website or install and use nvm (node version manager)

solemn leaf
#

how do I get apt

quartz jewel
#

You get it by using a debian based Linux distro.

quartz kindle
#

apt is built in depending on your linux distro

solemn leaf
#

I dont have linux

quartz kindle
#

then why do you need apt?

solemn leaf
#

for lifecycle for color thief

quartz jewel
#

Windows sucks.

wheat mesa
#

If I have an event listener for every command (I know, not a good thing, I'm gonna rewrite it), will that cause problems? Or will it just be slower?

quartz jewel
#

You could have conflicts, just create a command handler instead of using more than one event listener per event.

wheat mesa
#

Okay, sounds good. Thanks!

quartz jewel
#

@wheat mesa And if you don't want the command handler to look messy make the commands external.

earnest phoenix
faint prism
#

Hmm, so I have a base64 encoded gif. I want to send it as an embed as a reply to a command

opal plank
#

Idk if u can decode a gif

#

Never tried it

#

Prob can tbh

faint prism
#

I'd think I should be able to attach it

#

Relevant snippet. It's probably garbage, first time writing JS

client.on('message', async msg => {
  if (msg.content.startsWith(wolframPrefix)) {
    var result = await waApi.getSimple(msg.content
        .split(wolframPrefix)[1])
        .catch(console.error)
    var resultBuffer = new Buffer.from(result, 'base64');
    var embed = new Discord.MessageEmbed()
        .attachFiles(resultBuffer)
    msg.reply(embed);
  }
});
opal plank
#

Im not in a position to say it tbh

#

But ive only tried img

plush magnet
#

well if you want to test if your encoding works save it to your local disk

faint prism
#

good idea

plush magnet
#

if you can view it then youre on the right track

faint prism
#

if you can view it then youre on the right track
@plush magnet I scrapped that approach. I found a simpler API call that returned text lol

#

Well, done developing that bot. Took only an hr. EZ

static trench
#

@faint prism how does one invite wolfram alpha?

earnest phoenix
#

it's a private bot

#

it isn't anything revolutionary it just scrapes wolframalpha i believe

faint prism
#

No, I actually use their API.

#

@faint prism how does one invite wolfram alpha?
@static trench give me a few minutes to get back home, I'll make it public and give you an invite if you want.

#

Currently, it only works for short answers

earnest phoenix
#

oh they have an api?

faint prism
#

Yeah and a library too

#

Although their library is pretty simple

#

But then again, their API is just get requests anyways

#

So you really wouldn't need a library TBH

paper phoenix
#

Relevant snippet. It's probably garbage, first time writing JS
@faint prism - Look into discord.js-commando. Making your own command handlers, it'd be silly to re-invent the wheel.

faint prism
#

@faint prism - Look into discord.js-commando. Making your own command handlers, it'd be silly to re-invent the wheel.
@paper phoenix ty, but I'll probably come up with my own solution when I learn how to use classes

static trench
#

Can u make it public?

faint prism
#

Ye 1m I'll DM you

#

Like I said though, he currently only supports questions that can be answered as a "short answer".
If that does not exist I don't have the "full answer" implemented yet

modest crane
#

wolfram alpha have a free API? nice

faint prism
#

mhm

prisma locust
#

d.js can I create a category on a server in V12?

message.guild.channels.create("name", "category") it didn't work. This code created a text channel.

carmine summit
#

is there any way to react to a specific message in a specific channel?

sudden geyser
#

If you have the message ID or store it in cache you can react to it (assuming you have Add Reactions permissions).

carmine summit
#
if (command == "react"){
      if (!args[2]) message.channel.send("?react <ChannelID> <MessageID> <Reaction>")
      var channelid = args[0]
      var messageid = args[1]
      var emoji = args[2]

var react = client.channels.cache.get(channelid).messages.fetch(messageid);
message.react(emoji)

    }
```This is what i got so far
#

but even if all syntax are correct

#

it reacts to the latest message

earnest phoenix
#

look at what you're calling react() on

carmine summit
#

um

#

so what should be there?

earnest phoenix
#

take a guess

carmine summit
#

react.react()?

earnest phoenix
#

correct, however fetch() is a promise and you need to either await it or use the promise pattern (.then())

carmine summit
#

var react = await client.channels.cache.get(channelid).messages.fetch(messageid);

#

?

earnest phoenix
#

try it and see

carmine summit
#

thanks

faint prism
#

@earnest phoenix you'd cry if you saw what I was doing in JS

#

ngl the rapid deployment and short dev time was kinda nice. But boy is not maintainable

#

Do I dare share code? I'd probably embarrass myself

earnest phoenix
#

as you wish lol

#

my brain is all over the place

#

i've been working with node and c# for the past two weeks

#

communicating via pipes

faint prism
#

I really shouldn't be doing that bit in the catch

earnest phoenix
#

that's a yikes

radiant patio
#

is it possible to define a embed on the top that every command can use without const it in the command code?

plush magnet
#

There's no point. If you use the original embed you will make changes to that embed in one command and the next command will have the changes that the first one did so either way you're still going to use the new keyword

earnest phoenix
#

you can create a helper function to generate the embed if the design is the same all the time to cut yourself some slack

faint prism
#

still violating DRY principle with that repeated msg embed though
could do what cry said above though ^

solemn leaf
#

how can I have this not be so long

#

for

#

.createdAt

faint prism
#

maybe a date formatter

#

JS?

solemn leaf
#

can I use something like moment?

faint prism
#

Pretty sure you can construct it with a string. That link is exactly what you're looking for though

solemn leaf
#

well

#

.createdat isnt a function

faint prism
#

What is a "dat"?

solemn leaf
#

.createdAt

faint prism
#

Ah

solemn leaf
#

also

#

can I not do

#

.setDescription(<@${ment.id}>, ment.displayAvatarURL({ dynamic: true }))

karmic compass
#
for profile in profilesData["profiles"]:
    print(profile["cute_name"])
``` is there a way for every "cute_name" in every "profile", it can be (speaking js here) mapped to an array? i tried variable.append(profile["cute_name"]) but it only got 1
#

i think it doesn't save

sudden geyser
#

You're declaring the array only in the loop

#

actually no I may be dumb

karmic compass
#

i'm taking most of this knowledge from js lmfao

#

i've done something like this in discord.js for every role a user has that isn't everyone it would push it to an array

sudden geyser
#

actually I wasn't wrong

faint prism
#

Tfw fruit are cute

karmic compass
#

fruit == cute? pog

faint prism
#

===

karmic compass
#

funny thing is

#

the non cute name is like 0fghhjjkcvvdffgjj45ksd so yeah

#

anyways

sudden geyser
#

Python only takes into account scopes for functions, so that syntax is correct. What I think you're doing wrong is the fact you're assigning the variable an empty list every time in the loop then appending it, so you're always resetting it for every interation.

You could try declaring the list above the loop then only doing .append(...) in the loop, then log the list after the loop

karmic compass
#

OHHH

#

thank you

#

that was a small brain moment

#

it just redeclares it every single time

solemn leaf
#

Sun, Sep 2, 2018 9:39 PM

#

how can I have it format like that not this

#

Sun Sep 02 2018 20:39:20 GMT-0500 (Central Daylight Time)

faint prism
#

Using the link I sent earlier

solemn leaf
#

didnt help lmao

faint prism
#

Then regex it or something

solemn leaf
#

okay fixed

#

thanks

#

but it says my status is this

#

presence.status

#

and how is there a difference in these

karmic compass
#

just a passable question in python what does f"sdfkljs" do?

sudden geyser
#

So you want to format the date so it looks like that instead of the default correct

karmic compass
#

is it the same as doing `sdfkljsdf` in js?

solemn leaf
#

yeah

#

aaa

sudden geyser
#

it's an f string so it's like that in js

#

a few differences but you use {} instead of ${} in js

karmic compass
#

ye

solemn leaf
#

but what it says

karmic compass
#

i got that

solemn leaf
#

isnt when I created my account

#

the top is

#

this is what I did

#
${moment.utc(ment.createdAt).format('dddd, MMMM Do YYYY, HH:mm:ss')}
#

@sudden geyser

carmine summit
#

const streamingRole = message.guild.roles.cache.find(role => role.name === 'temp');
this causing error...

solemn leaf
#

let streamingRole = message.guild.roles.cache.find(role => role.name === "temp");

#

if that doesnt work

#

then temp isnt a role

carmine summit
#

message is not defined

#

then temp isnt a role
@solemn leaf is it case-sensitive?

solemn leaf
#

yes

drifting wedge
#

To use Ffmpeg on heroku

#

I added the buildpaxk

#

But wut else do I need?

karmic compass
#

ok i have a decently hard python question here
if i have an object like this (its from an api so im just assuming) json { "profiles":{ "fdsjaflksdjflkajsdf":{ "cute_name":"Lime", "veryImportant":"Value 1" } "aaaaaaa":{ "cute_name":"Pomegranete", "veryImportant":"Value 2" } } } and i have gotten all "cute_name"s by doing ```python
for profile in profilesData["profiles"]:
cuteNames.append(profile["cute_name"])
specifiedProfile = input(f"What profile out of {cuteNames} would you like?")

#

that's probably a terrible explanation

carmine summit
#

yes
@solemn leaf it just says that message isnt defined

solemn leaf
#

then you didnt do your thing righ stop pingign

carmine summit
#

what thing

faint prism
#

that's probably a terrible explanation
@karmic compass why not just store an integer instead

karmic compass
#

?

solemn leaf
#

@faint prism can I add images to fleids?

karmic compass
#

btw Auger that's an API i can't change that

radiant patio