#development

1 messages · Page 1461 of 1

tribal siren
#

that's what i wanted to say lol

inner stump
hollow sedge
#

i mean some frameworks actually are

slender thistle
#

Not as effective in what terms

earnest phoenix
#

.-.

weary widget
#

my coding is ineffective to being with

#

don't ask me

gilded olive
#

Python is great for backend

#

It isnt meant for front end

hollow sedge
#

obviously not lol

gilded olive
#

Which is what js is meant for

hollow sedge
#

just because it was meant for something doesnt mean it cant be used in another way effectively

gilded olive
#

True

hollow sedge
#

node.js has many benefits

#

for example only needing one language

#

for frontend and backend

opal plank
slender thistle
#

Erwin

gilded olive
#

I just wish python had as many good frameworks as JS has 😪

opal plank
#

thats me

slender thistle
#

Dead laptop

opal plank
#

ik

opal plank
#

wont stop me from bitching to you about learning ts though

slender thistle
#

I'm not doing TS on phone ty xd

opal plank
#

yes u are

slender thistle
#

Nu

hollow sedge
#

there are great frameworks out there but trash, popular frameworks overshadow them

slender thistle
#

Nope kittyNotLikeThis

hollow sedge
#

for example flask

#

its bad

slender thistle
#

Sanic

hollow sedge
#

yeah

gilded olive
#

Django

hollow sedge
#

wait you're saying sanic is good right?

slender thistle
#

I'm just saying that it exists

hollow sedge
#

ok

gilded olive
#

I use Flask tbh

slender thistle
#

I used it and had no problems using it

hollow sedge
#

flask not async tho 😦

slender thistle
#

Both sync and async clients

gilded olive
#

That was the thing

hollow sedge
#

wait sanic has a sync client

#

isnt the whole point async tho

slender thistle
#

I mean

inner stump
slender thistle
gilded olive
#

No

hollow sedge
#

lol

hollow sedge
#

that just took me to the link to the picture?

opal plank
inner stump
#

it was supposed to be youve been gnomed

gilded olive
#

I think that is the point

#

Oh

#

Nvm then

opal plank
#

this chat for development, not shitpost

inner stump
hollow sedge
#

how is that not

gilded olive
#

🤔

opal plank
hollow sedge
#

you know how you've been gnomed relates to development

gilded olive
#

When the code works but dosent

gilded olive
#

But like why

hollow sedge
#

dude stop

inner stump
#

when discord freezes

hollow sedge
#

someones going to call a mod

#

and you arent going to like it

inner stump
#

and ur trying to show ur bot'

gilded olive
#

What 😭😭😭

#

Bro do you see the name of this channel

inner stump
#

ok\

gilded olive
#

And the topic

weary widget
#

anyway

slender thistle
#

@inner stump stop posting off-topic content in a channel mostly meant for coding help

weary widget
#

back to what I was saying

inner stump
#

i will send some pictures

hollow sedge
#

guys??? waitWhat

weary widget
#

and gals

hollow sedge
#

you realize this is only frenzy right?

hollow sedge
#

oh no

#

i take it back

gilded olive
#

Oh wait that was shitpost from me

#

Welp

hollow sedge
#

ok guys im going to bring us back on-topic real quick:

def hi()
    print("hi")

why doesnt this work

weary widget
#

ok so the problem is

#

you didn't import hi

summer torrent
#

show error

gilded olive
#

you're missing a :

inner stump
hollow sedge
#

it works now

weary widget
#

and hi.run at the bottom

summer torrent
#

is this botghost

#

i guess yes

slender thistle
#

You didn't import antigravity and this

weary widget
inner stump
hollow sedge
#

does botghost host your bot for you?

opal plank
#

yes, and its shit

inner stump
#

yeah i guess

gilded olive
#
import nasa

nasa = nasa.get_nasa_src()
print(nasa)``` ![mindblown](https://cdn.discordapp.com/emojis/779401308825583636.webp?size=128 "mindblown")
hollow sedge
#

YOOO

#

im pretty nasa shares a lot of their source code tho

gilded olive
#

You're pretty?

#

😳

hollow sedge
#

of course i am

inner stump
patent condor
#

in markdown to add
like this

`hi` - this right?
``` for the bot webpage?
hollow sedge
#

dude you wouldve roasted erwin with that

#

he would've been sent home crying

hollow sedge
#

(but yes)

patent condor
#

oh i havent add the bot yet, i am about to

#

theres no preview option while adding?

hollow sedge
#

at the bottom

patent condor
#

oh

hollow sedge
patent condor
#

uh nope

hollow sedge
#

maybe not when you're creating a new bot

#

try submitting it

#

you can just edit it after

patent condor
#

okay!

delicate shore
#
at Function.resolve (/root/Muser/node_modules/discord.js/src/util/BitField.js:150:19)
at Permissions.has (/root/Muser/node_modules/discord.js/src/util/BitField.js:45:28)
at Permissions.has (/root/Muser/node_modules/discord.js/src/util/Permissions.js:45:85)
at GuildMember.hasPermission (/root/Muser/node_modules/discord.js/src/structures/GuildMember.js:271:24)
at Client.<anonymous> (/root/Muser/bot.js:726:32)
at processTicksAndRejections (internal/process/task_queues.js:97:5) | Make sure you ran command properly```
hollow sedge
# patent condor

this does bring up an interesting question though, you should be able to preview your bot's page before you create it

#

it would make sense

gilded olive
hollow sedge
#

yeah

delicate shore
#
2|index  | (node:960755) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
2|index  |     at RequestHandler.execute (/root/Muser/node_modules/discord.js/src/rest/RequestHandler.js:154:13)
2|index  |     at processTicksAndRejections (internal/process/task_queues.js:97:5)
2|index  |     at async RequestHandler.push (/root/Muser/node_modules/discord.js/src/rest/RequestHandler.js:39:14)
2|index  |     at async ReactionCollector.<anonymous> (/root/Muser/node_modules/discord.js-collector/src/collectors/reactionCollector.js:417:33)
2|index  | (node:960755) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
2|index  | (node:960755) [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.

#

In editing Message?

#

It's simply editing message

#

but my bot doesn't have perm

#

wat

#

huh

worldly patrol
#

f!yardım

#

f!webpanel

pure lion
#

@delicate shore maybe you're targeting the message from the message listener

mild umbra
#

türk varmı ?

delicate shore
#

No I'm not

#

It works if my bot has manage messages permission

#

But it doesn't delete anything

#

It just edits

mild umbra
#

why don't open vote me bot ?

pure lion
#

Maybe that's the issue then

mighty quiver
#

how to make the bot delete its own messages

boreal flume
#

Can someone help me out with a small bot I did?

bot.on('message', async m => {
    if(m.author.bot === true || m.channel.type === 'dm') return;
    if(m.content.startsWith('realm')){
        let num = parseInt(m.content.split(' ')[1]) || 1
        if(num > 3 || num < 1) return
        else{
            console.log(num)
            m.channel.setTopic(`Realm: ${num}`)
            m.channel.send(`Set realm to ${num}`)
            console.log(m.channel.topic)
        }
    }else{
        return
    }
})

It's supposed to update the channel topic, but even with admin privs it doesnt

frail holly
#

Did you queue it?

boreal flume
mighty quiver
#

rn ive made a small bot to ping me as soon as someone says certain words during convos

frail holly
#

Dunno if the api you're using requires you to queue actions or not.

boreal flume
#

I'm using discord.js

#

And I don't know anything about queuing actions...

cinder patio
#

nah discord.js automatically queues all api calls

#

it's not that

frail holly
#

Ah I use JDA. Everything normally needs to be like "message.delete().queue()

#

Ah

#

Nvm then

mighty quiver
#

import discord
import os

client = discord.Client()

my_pings= ("fury","FURY","NIGHTFURY","nightfury","Nightfury","adrian","Adrian","Strawhats","strawhats")

myid= '@mighty quiver'

@client.event
async def on_ready():
print('We have logged in as {0.user}'.format(client))

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

if message.content.startswith(my_pings):
    await message.channel.send(myid)

client.run(os.getenv('TOKEN'))

#

this is my code

#

and it works

boreal flume
#

Ohhh you use python

mighty quiver
#

yea

boreal flume
#

Oops

#

I gave you a js solution

mighty quiver
#

but couldnt figure out deleting part

mighty quiver
#

i just want my bot to ping me and delete message as soon as it sends it

#

just so that i can keep an eye on what people are saying bout me

#

on my server

boreal flume
#

if message.author == client.user:
await client.delete_message(message)

#

And you can add some more if statements to filter that specific message

mighty quiver
#

so this will delete anything the bot says

#

right?

boreal flume
#

Yes

mighty quiver
#

ohhh

#

tysm\

#

btw you should try out repl.it if you havent

#

its awesome

boreal flume
restive furnace
#

ctx.delete works too

boreal flume
#

I don't have Python installed on my computer so that's what I use repl.it for... I have node.js installed

restive furnace
#

and if you pass the sent message to variable you can use <variable>.delete()

mighty quiver
#

i didnt think of this

restive furnace
boreal flume
#

I've only ever made one bot in python

#

I've made tons in javascript

restive furnace
#

im bad at py, normal on js, proficient o c/++

boreal flume
#

Eh, I've never done a bot in c++, mostly arduino stuff

restive furnace
#

well i have, but i don't focus on bot making tho

delicate shore
#

How to see how invited user in guildMemeberAdd event

boreal flume
#

Language?

delicate shore
#

Ja

#

Js

boreal flume
#
bot.on('guildMemberAdd', async member => {
 code
})
delicate shore
#

I know that ;-;

#

I want to know how to get who invited the user

boreal flume
#

FOr that you would have to store all invite codes

delicate shore
#

Ahh

#

No other way ?

boreal flume
#

Not that I know of

#

Wait, maybe

mighty quiver
#

didnt work

#

the delete thing

mighty quiver
#

im sure i messed up somewhere

#

but idk where

boreal flume
#

No other way @delicate shore

#

Try ctx.delete()

delicate shore
#

Okk

boreal flume
#

Do you know how to go about storing the invites?

mighty quiver
#

bbl

#

ty

boreal flume
#

@delicate shore?

delicate shore
#

Nah

boreal flume
#

Do you need some help?

prime glacier
#
if (options.Filter) {
      Seek = Db.ExtraTime ? Db.Bot.dispatcher.streamTime + Db.ExtraTime : Db.Bot.dispatcher.streamTime;
    }```

error :- ` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'streamTime' of null
`
delicate shore
boreal flume
#

DM me if you can't get it

delicate shore
#

K thanks

cunning rock
#

how do i crack passwords ?

#

for my email that got hacked

#

they changed the password for my email and i need to crack the password can someone teach me please

cinder patio
#

bruh, do you really think anyone can crack email passwords? If yours really did get cracked it was probably really weak. Next time, think of a stronger password

prime glacier
#

lol

earnest phoenix
#

Does anyone here know python code for welcome message?

sage crescent
#

Like "welcome, tomson, you enter in this server" message?

earnest phoenix
#

Ye but with a ping to a role

#

And a channel

#

If possible

sage crescent
#

M

#

Function - on_member_join

#

Channel - bot.get_channel(id)

#

Ping user - member.mention

#

And:

 await channel.send(f'{member.mention} hello!')
#

like so

earnest phoenix
#

Tysm

fiery trellis
earnest phoenix
#

do what

sage crescent
#

Just i use this code:

@bot.event
async def on_member_join(member):
    print(config.system_msg + f'Пользователь {member.name} зашёл на сервер.')
    news_channel = bot.get_channel(id=745223801419202590)
    #await news_channel.send(f'Пополнение на сервере, {member.mention} теперь с нами!')

    colour = discord.Colour.from_rgb(random.randint(0, 255), random.randint(0, 255), random.randint(0, 255))
    embed = discord.Embed(title = f'Пополнение на сервере, {member} теперь с нами!', colour=colour)

    embed.set_author(name=member, icon_url=member.avatar_url)
    embed.set_footer(text=f"Цвет обложки - {colour}")
    await news_channel.send(embed = embed)

fiery trellis
#

And how to do the vote requirement command

earnest phoenix
#

So this will send a message to a specific channel?

#

@sage crescent tysm

#

One question before I go

#

Do I change the bot.event to client.wvent

sage crescent
#

wrong ping)

earnest phoenix
#

@sage crescent ty

#

It’s means a lot

sage crescent
#

:)

earnest phoenix
#

wait

sage crescent
#

?

earnest phoenix
#

the message is sent as an embed

#

how to send a normal msg

sage crescent
#

Yes, my code send embed

#

My code have comment

earnest phoenix
#

oh

sage crescent
#

Its just message

earnest phoenix
#

ok thx

sonic oar
#
    const fetch =  await channel.messages.fetch({ limit: 100 })
    const msg = fetch.find(m => m.embeds[0].footer.text.startsWith('⭐') && m.embeds[0].footer.text.endsWith(message.id))```
#
(node:9948) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'footer' of undefined
    at C:\Users\Dom\Desktop\projekty\Xibbly2\Xibbly_modules\DiscordBot\utils\starboardAdd.js:22:45
    at Map.find (C:\Users\Dom\Desktop\projekty\Xibbly2\node_modules\@discordjs\collection\dist\index.js:161:17)
    at module.exports (C:\Users\Dom\Desktop\projekty\Xibbly2\Xibbly_modules\DiscordBot\utils\starboardAdd.js:22:23)
    at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:9948) 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(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9948) [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.```
earnest phoenix
#

the embed is undefined 🤷‍♂️

#

easiest way to fix it is to use optional chaining

sonic oar
#

ok, thx

eternal osprey
#

hey guys!
I have a json file with different coordinates. I basically get the distance (in KM, which is a number.) I have made a chart: js 1: 1, 2: 1, 4: 2, 10: 8, 12: 9, 15: 11, 20: 13, 25: 15, 30: 18, 40: 22, 45: 23, 60: 25, 80: 27, 100: 30, 125: 33, 140: 34, 150: 36, 180: 39, 200: 42, 250: 46, 300: 50, 350: 53, 400: 56, 500: 64,
So the left are the kms and right are the cooldowns in minutes. How do i make a code that wil take the cooldown in minutes that is the most near the kms.

#

like for example: 74km will get: 80: 27,

#

so 27 minutes.

#

how would i make a code like that?

earnest phoenix
#

none of what you just said made sense

eternal osprey
#

i have made a distance calculator

#

which gives the distance in kilometers, right.

#

i want to have the right cooldown that belongs to the distance i

#

so for example a distance of 74km > is the most near 80km, so it will give 27minutes cooldown.

#

understand it?

earnest phoenix
#

so a nearest number lol

#

why did you complicate your question so much

#

i guess you can use KNN alg?

eternal osprey
#

KNN?

earnest phoenix
#

k nearest neighbour

#

right

#

js has reduce

#

so you dont have to use KNN

sage crescent
#

does anyone know how to make sending the same message on different servers to specific channels? For example: !message (channel) and this send harvested message in this channel to.

eternal osprey
#

so i won't have to use KNN

earnest phoenix
#

oh you didn't even state your language

#

my bad

eternal osprey
#

i am using js

earnest phoenix
#

oh

#

don't just copypaste it in though

#

try to understand what it does

eternal osprey
#

yeah ofc,

#

thanks.

tired panther
#

How can I see how much memory a map/array uses?

earnest phoenix
#

get a debugging tool

tired panther
#

which one?

earnest phoenix
#

i dont know lol

#

find one that suits your needs

tired panther
#

When I have 2500 arrays with each 3 strings in a map

#

Hoe much memory will it use?

cinder patio
#

you can use chrome dev tools with the --inspect flag

tired panther
cinder patio
#

yeah... you can use the chrome dev tools

earnest phoenix
#

memory profiling

tired panther
#

the ram of this map

earnest phoenix
cinder patio
#

If you know the length of all of the strings you are storing you could get a very rough estimate

tired panther
earnest phoenix
#

lmfao

cinder patio
#

do you know the lengths of the three strings?

sage crescent
#

Find length of strings

tired panther
#

10, 1, 4

cinder patio
#

Why is the "ban" property stored as a string? Storing it as a number / boolean would use less memory

#

@tired panther Well, to determine a string's size, you have to double the amount of characters , so (10 * 2) = 20, 20 bytes are used to store an ID string.

verbal mica
#

Hello I am new

sage crescent
#

Hi

verbal mica
#

Please tel me how to make bots

#

Hi

earnest phoenix
#

ask the magic man

verbal mica
#

Who

earnest phoenix
#

the magic man

sage crescent
#

Internet have so much tutorials

verbal mica
#

K

#

Thnk you

cinder patio
#

?

#

ah

tired panther
#

what should I save in the ban

cinder patio
#

yes 0/1 or true/false

#

true/false would use less memory

earnest phoenix
#

best off storing as a bool

#

since the cost is a single bit

cinder patio
#

I read somewhere that bools are stored as 4 bytes

earnest phoenix
#

yeah because of alignment in some languages

cinder patio
#

but in js numbers are floats and therefore use 8 bytes, so boolean is still better

prime glacier
#

🙄

#
if (options.Filter) {
      Seek = Db.ExtraTime ? Db.Bot.dispatcher.streamTime + Db.ExtraTime : Db.Bot.dispatcher.streamTime;
    }```

error :- ` UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'streamTime' of null
`
cinder patio
#

Db.Bot.dispatcher is null

novel snow
#

Hey, So uh, I got a quick question, I am working on a custom welcome message for a server which should be configurable,

novel snow
#
          const welcomeEmbed = new Discord.MessageEmbed()
          if(valueTitle).setTitle()
          .setColor(0xf04747)
          .setDescription();
#

Now ofc this wont work, But if i need to make a brute force method for every type or combination of title + description etc etc

#

it will cause hella cluttered code,

#

would there be a way to do this more efficiently for every different value?

carmine summit
#

let tittle = args[0] || 'No Title'

#

.setTitle(title)

novel snow
#

But it is possible to have a embed to be title-less

#

so this would cause that the title does exist,

carmine summit
#

Yeah, \u200b

novel snow
#

which i don't want to est if there is no title

#

whats that?

carmine summit
#

Blank

#

Smth like that

novel snow
#

I could try that,

#

Thank you!

carmine summit
#

But it needs to be a str

novel snow
#

I'll make sure to report on my progress

#

yeap

carmine summit
#

Okay

sage crescent
#

Ok, i try again

does anyone know how to make sending the same message on different servers to specific channels? For example: !message (channel) and this send harvested message in this channel to.

carmine summit
#

Hmm

prime glacier
tired panther
cinder patio
#

4 * 2 = 8

tired panther
#

wow just 4 bytes more

novel snow
carmine summit
novel snow
#

Since every server has different channel names...

carmine summit
#

Database then iterate all of it

#

To send

#

Thinggys

novel snow
#

yeah

sage crescent
novel snow
#

say for example have a mongo db string like;

#

272764566411149314,412006692125933568,751966421101182996

#

and have it split at (,)

#

and then make it a list

#

and message.channel.send(message)

#

where message is args.join( )

#

or wait

#

no channel.send(message)

#

and then have channel = the list

carmine summit
#

Noooooo

#

Not like that

#

Make an array

tired panther
sage crescent
carmine summit
#

Ffs

#

Wait

#

If you want to make a new array

#

You could do

#

let arr = []

#

Then

#

To add strings into it

#

You need

#

arr.push(str)

sage crescent
#

Ok, how save this array in db?)

novel snow
#

@carmine summit so I tried the blank string in the title, it sends it as undefined, so the search will continue...

carmine summit
#

Let me see your code

#

Its not supposed to be undefined

novel snow
#

me?

carmine summit
#

Yeah

novel snow
#
          if (welcome.title == 'test') var title = '\u200b';
          if (!welcome.title == 'test') var title = welcome.title;
          const welcomeEmbed = new Discord.MessageEmbed()
            .setTitle(title)
            .setColor(0xf04747)
            .setDescription('this is a undefined string...');
          message.reply(welcomeEmbed);
distant hound
#

help me

carmine summit
distant hound
#

pls

sage crescent
#

I try, thx

sage crescent
distant hound
#

npm WARN deprecated dblapi.js@2.4.0: Module is no longer maintained
i get this error

novel snow
carmine summit
cinder patio
#

@tired panther one object stores 20 bytes for the id, 2 bytes for the prefix, 8 bytes for the boolean value that's a string. That's 30 bytes total per object. In reality it's probably more because of property names and offsets. 2500 * 30 = 75k bytes or 75 kb.

carmine summit
#

You have to do it manually

novel snow
#

but the issue is, is that the default string is test, so if it is test it wont have a title

distant hound
#

what should I do

carmine summit
sage crescent
distant hound
#

:(

sage crescent
#

:)

novel snow
#

the first one is either (test) or (some normal other string here)

#

that could work

carmine summit
#

Because null is false

sage crescent
carmine summit
#

@distant hound You need to read the api docs, to do it manually using axios

distant hound
#

I fixed it

#

and I didn't get an error

carmine summit
#

Smh

sage crescent
#

Wait

sage crescent
carmine summit
#

Array?

sage crescent
#

In db

novel snow
#

@carmine summit set it as null, now the title is null

carmine summit
novel snow
#

there is no other way to retrieve it from the database

sage crescent
#

My db need data type, like - text, or bigint

carmine summit
#

Null must not be a string

novel snow
#

lemme try something

#

brb

carmine summit
#

You should do it like welcome.title = null

#

Not 'null'

mortal tree
#

Wut?im confused, what's going on

sage crescent
#

Nothing

novel snow
#

I think I got it, Imma test it brb

#

Nope, Doesn't work like that, But I just remembered, I think I remember seeing something about stuff like this somewhere...

carmine summit
#

Let me see your code

novel snow
#

In some documentation, So Imma test that brb

carmine summit
#

On how you define it

novel snow
#

var title = welcome.title || '\u200b';
const welcomeEmbed = new Discord.MessageEmbed()
.setTitle(title)
.setColor(0xf04747)
.setDescription('this is a undefined string...');
message.reply(welcomeEmbed);

carmine summit
#

The other one

#

That defines welcome.title

novel snow
#

I have a idea, I think I know how

#

Its part of the database

carmine summit
#

Send me the code that defines welcome.title

novel snow
#

look here;

carmine summit
novel snow
#

it takes the title

#

but I think I got a fix hold on

carmine summit
#

By I mean null, I mean null. Not ""

vagrant tree
#

hi, how do i get my bot to update details on the top.gg website? it says its in 0 servers but i know its in more

carmine summit
#

It's not gonna update automatically

eternal osprey
#
  var closest = counts.reduce(function(prev, curr) {
  return (Math.abs(curr - goal) < Math.abs(prev - goal) ? curr : prev);
});

if (closest == "1"){
return closest = "1"

}

if (closest == "2"){
  return closest = "1"
  
  }

  if (closest == "4"){
    return closest = "2"
    
    }
console.log(closest);
              
            if (isRaidBoosted(raid)) {}
              let z = "BOOSTED"
            
            
              let text = `**${name}** | **${varz}**  | **${z}**` + "\n" + ${closest}``` will this return undefined? Because the if statemenets close before the closest is being called in the embed
carmine summit
eternal osprey
#

i cant try

#

it can only be tried in certain events.

#

that is the problem.

#

appreciate your site tho.

carmine summit
#

I can't see return; anywhere so, I guess not?

#

The only way it will return is at the if statement

eternal osprey
#

the send is under the let text

carmine summit
#

Also, you should use a formatter

eternal osprey
#

this was just a snippet

novel snow
#

Hm, Doesn't seem to work for me...

sage crescent
#

Hm

eternal osprey
novel snow
#

Nope,

#

I need to find a way to get this single piece working and then I can go on my merry way

eternal osprey
#

how can i ever define it inside it's scope?

carmine summit
#

Uh

sage crescent
#

How do a command, which set server-prefix? Save server prefix in db, yes, but how set this prefix for need server?

carmine summit
#
let str
if (true) {
str = "test"
}
console.log(str) //"test"
#

@eternal osprey

eternal osprey
carmine summit
#

But if you do it like

if (true) {
let str = "test"
}
console.log(str) //undefined
prime glacier
#

TypeError: message.guild.me.voice.leave is not a function

carmine summit
#

@prime glacier voice.channel.leave()

#

Iirc

prime glacier
#

ok

eternal osprey
#
if (closest == "1") {
                    str= "1"
                  }```so @carmine summit  this would work?
carmine summit
#

No

#

Wait

#

It would be cleaner if

#

return "1";

#

return "2";

#

You get it

earnest phoenix
#

🙄

#

straight up copied the code from so

carmine summit
#

Someone, please get an error. I'm bored af

earnest phoenix
cinder patio
#

gross

#

pretty console though

earnest phoenix
#

can you download and import custom fonts on samsung

#

yes

#

WING

#

oh they renamed to wings or im just dumb

#

downloads fira code

#

Imma go with Samsung Sans

prime glacier
#
if (!Db.Always) {
      await Db.VoiceChannel.leave();
      };```

``` Cannot read property 'Always' of undefined```
earnest phoenix
#

bruh

prime glacier
#

what happen 🙄

earnest phoenix
#

you tell us

#

it's your code

#

Imagine forgetting what your own code does

carmine summit
#

Imagine capitalizing the first letter of a string

earnest phoenix
carmine summit
#

Its the same

earnest phoenix
#

no its not

#

grammar is a thing

delicate shore
#

Ok so guys

#
2|index  | https://www.youtube.com/watch?v=KXdRl6Ml37I
2|index  | https://www.youtube.com/watch?v=MVc3Z-bG6Eo
2|index  | https://www.youtube.com/watch?v=6Z3N79ktprw
2|index  | https://www.youtube.com/watch?v=_bZH1ygc5IA
2|index  | https://www.youtube.com/watch?v=mdQvsppbxQY
2|index  | https://www.youtube.com/watch?v=SEYdPQ5VKbY
2|index  | https://www.youtube.com/watch?v=0opZqh_TprM
2|index  | https://www.youtube.com/watch?v=WyX-PRqzV78
#
 let songs = await getTracks(args22[1])
 songs.forEach(async (ar) => {
  let result = await distube.search(ar.name)
        bruh.push(result[0].url)
        console.log(result[0].url)
 });```
#

Why is array empty

#

even tho it gets all the song

earnest phoenix
#

can't you conclude why just based on your logs output

delicate shore
#

oh waut

#

wait

#

I don't get it

earnest phoenix
#

forEach just fires a bunch of promises

#

it doesn't wait for them to finish

#

don't use forEach and instead do the classic for loop

#

you shouldn't use forEach anywhere really

#

it's super slow compared to classic for

knotty obsidian
#

when a user doesnt have a nickname and you try to rename it this happens:
https://gyazo.com/547349744e67bc2dddb7a9c89fd300e0

heres my code:

event.getMessage().getMentionedMembers().get(0).modifyNickname(event.getMessage().getContentRaw().substring(11).replace(event.getMessage().getMentionedMembers().get(0).getAsMention(), "")).queue();

event.getChannel().sendMessage("Successfully renamed " + event.getMessage().getMentionedMembers().get(0).getEffectiveName() + " to" + event.getMessage().getContentRaw().substring(11).replace(event.getMessage().getMentionedMembers().get(0).getAsMention(), "")).queue();

//Java
delicate shore
#
 let songs = await getTracks(args22[1])
 for (i = 0; i < songs.length; i++) {
    let result = await distube.search(songs.name)
    let final = await result[0].url
    bruh.push(final)
    console.log(final)
 }```
#

But I guess it will be something like this

earnest phoenix
#

yes

#

you need to declare i

delicate shore
#

null

earnest phoenix
#

and you need to index songs

delicate shore
#

index songs like

#

[0]

earnest phoenix
#

correct

delicate shore
#

But i want all of them

earnest phoenix
#

but instead of 0, you're going to use i

delicate shore
#

Oh hhhh

#

Brilliant

#

OMG IT WORKed

ivory seal
#

can someone help me with this

earnest phoenix
#

gonna need more than that chief

ivory seal
#

sec

#
const Discord = require('discord.js')
const client = new Discord.Client()
client.on("message",async(message)=>{
const role_switch = await message.guild.roles.fetch('781710153354575892')
console.log(role_switch)
})
client.login('mytoken')
#

and thats the error i get

earnest phoenix
#

that's exactly the code you have in your editor?

ivory seal
#

yes

#

just something simple

earnest phoenix
#

and it is saved?

ivory seal
#

ohh i found the error

#

thanks

earnest phoenix
#

sorry what

young jungle
#

I'm making a bot with a friend which is meant to check the status of everyone in the server and then send a certain message based on that, but at the moment it's the member list it's getting only incudes itself and no one else in the server

async def vibeCheck(self, ctx):
    bot=self.bot
    memberList = ctx.guild.members
    print(memberList)
    for member in memberList:
        print (member)
#

does anyone know what's going wrong here?

earnest phoenix
#

enable intents

young jungle
#

?

#

sorry I don't know what you mean

young jungle
#

Thanks for that, should fix everything ^-^

ancient dagger
#

Is there a way to make your bot send a message like when it joins it says (thank you for adding me!)

earnest phoenix
#

sure

delicate shore
ancient dagger
earnest phoenix
ancient dagger
earnest phoenix
#

Can some give me py script of server up vote

tribal siren
#

ok, so i got this problem

ancient dagger
#

Yes?

tribal siren
#

when i do userinfo on someone else, it works

ancient dagger
#

?

tribal siren
ancient dagger
#

Bye

#

I don’t use dat stuff I use it Simple with bdfd

knotty obsidian
#

how can i get the message from the reaction cuz i can only get its id

tribal siren
#

reaction.message

knotty obsidian
#

Cannot resolve method 'getMessage' in 'GuildMessageReactionAddEvent'

#

@tribal siren

tribal siren
#

oh

#

then idk

eternal osprey
#

could anybody tell me why my text is not being sent? I know it is because of the if statements, but why and how to fix it?

earnest phoenix
#

you return out of the method

#

also wtf

#

why are you doing that sausage if

eternal osprey
earnest phoenix
#

yes but why are you doing it in the first place

drifting wedge
#

how can i set specific redirect urls with flask and discord auth flask?

eternal osprey
earnest phoenix
#

i didn't ask that

eternal osprey
#

i have a specific distance between raids

earnest phoenix
#

i'm asking why you're transforming it like that

eternal osprey
#

and i want the corresponding cooldown

#

and it goes by a specific list: js 1:1 2:1 4:2 10:8 12 :9 15:11 20:13 25:15 30:18 40:22 45:23 60:25 80:27 100:30 125:33 140:34 150:36 180:39 200:42 250:46 300:50 350:53 400:56 500:64 600:72 750:82 800:86 900:93 950:97 1000:100 1150:111 1200:115 1250:118 1266:120

#

left km (distance), right the cooldown

earnest phoenix
#

so why not just use a map

eternal osprey
#

,ap?

#

map*?

earnest phoenix
#

fill the map when your app boots up

#

and then just get(key)

clever agate
#

module.js:550
throw err;
^
Error: Cannot find module '../build/better_sqlite3.node'
at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/rbd/pnpm-volume/cc2b88ab-6c71-4cd1-93ec-efef8f9711ff/node_modules/.registry.npmjs.org/quick.db/7.0.0-b22/node_modules/quick.db/node_modules/better-sqlite3/lib/database.js:5:21)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

#

pls help

#

me

#

me bot is inactive

earnest phoenix
#

you didn't follow the instructions on the quick.db installation page

clever agate
#

at Function.Module._resolveFilename (module.js:548:15)
at Function.Module._load (module.js:475:25)
at Module.require (module.js:597:17)
at require (internal/module.js:11:18)
at Object.<anonymous> (/app/bot.js:22:12)
at Module._compile (module.js:653:30)
at Object.Module._extensions..js (module.js:664:10)
at Module.load (module.js:566:32)
at tryModuleLoad (module.js:506:12)
at Function.Module._load (module.js:498:3)

crimson vapor
#

lol

#

the file doesn't exist

#

stop pasting error codes and learn js tbh

ivory seal
#

````MongoError: Authentication failed.``` what does this error usually mean?

earnest phoenix
#

would you believe me if i told you that the authentication failed

ivory seal
#

but its the correct username and pass kek

earnest phoenix
#

google around and narrow your problem down 🤷‍♂️

ivory seal
#

ok

midnight viper
#

I wanna make a voting system and idk how to check if there are more reactions with 1 emoji or another in js

quartz kindle
#

reaction.users

crimson vapor
#

hello tim

quartz kindle
#

That will contain all users that used a specific reaction, so you can count them

#

Hello lol

crimson vapor
#

loggers jason.db has more installs than ourcord

cinder patio
#

that's just sad

crimson vapor
#

yep it is

sudden geyser
#

installs on npm don't mean much

crimson vapor
#

ik but its just funny

mellow kelp
#

loggers

clever agate
#

(node:1516) UnhandledPromiseRejectionWarning: TypeError: Cannot read property 'addRole' of undefined

#

HELP

mellow kelp
#

whats your code

crimson vapor
#
throw new TypeError("Cannot read property 'addRole' of undefined")```
mellow kelp
#

lmfao KEKW

eternal osprey
#

how to call it?

#

how to get it to action.

crimson vapor
#

map.get('<corresponding key>')

eternal osprey
#

that is the problem.

#

my distance isn't the same as the mapped ones.

#

i miht have distances of like 74km.

#

that should become 80.

#

you understand?

crimson vapor
#

yes

eternal osprey
#

it has to take the most near.

crimson vapor
#

round up or down?

clever agate
#
{
const DBL = require('dblapi.js');
const express = require('express');
const http = require('http');
const moment = require("moment")
moment.locale("tr") 

const app = express();
const server = http.createServer(app);
const listener = app.listen(3000, function() {
  console.log('Your app is listening on port ' + listener.address().port);
});
const dbl = new DBL("", { webhookAuth: '123', webhookServer: listener, webhookPort: 3000});

dbl.webhook.on('ready', hook => {
  //console.log(`Webhook running with path ${hook.path}`);
});
dbl.webhook.on('vote', vote => {
dbl.getUser(vote.user).then(user => {
   let tarih = moment().add(3, 'hours').format('__(**DD/MM/YYYY**)__ [Saat:] __(**HH:mm:ss**)__')
const embed = new Discord.RichEmbed()
.setTitle(":canelmasss1: Yeni Oy!")
.setDescription(`> :candansss: **( ${user.username} )** Adlı Arkadaş Sky'a Oy Verdi Teşekkürler!`)
.setColor("RANDOM")
.addField("Oy Veren Bilgileri:",`:cansagagit: <@${user.id}>\n:cansagagit: __${user.username}#${user.discriminator}__\n:cansagagit: __${user.username}__\n:cansagagit: __${user.id}__\n<@&777611852791152670> Vote Supporter Rolünü Başarıyla Verdim 12 Saat Sonra Geri Alacağım`).addField("Tarih:",`> ${tarih} \n\n\n :cans::cank::cancany:`)
.addField("Sende Oy ver Rolüünü Kap", "[Oy Ver](https://top.gg/bot/765291624586018856/vote)")
client.channels.get("784415260085714964").send(`<@${user.id}>`, embed)
let server = client.guilds.get("687692294337331221")
server.members.get(user.id).addRole("788426229699051551")```
#

what is command error

eternal osprey
#

that depends on the distance

#

if it's 50:

#

``js
distanceMap['45'] = '23'
distanceMap['60'] = '25'```it has 2 options

crimson vapor
#

hmm

#

is that momentjs?

eternal osprey
#

who

drifting wedge
#

is html encoding neccesary

crimson vapor
#

no idea

eternal osprey
#

okay so it works

#

i get the nearest number from the logarithm i made.

#

distanceMap.set(60 , "25")

#

how do i get the "25" tho?

mellow kelp
#

I thinkn you can get https://discord.com/api/users/@me/guilds

#

With the Bearer <token> authorization of course

#

Nope

#

it just returns an array

#

so response.length

#

like

#

the json response is an array of guilds and their basic info

#

you have to make another request to the /api/users/@me/guilds endpoint

#

it'll send an array of guilds

#

so you can get its length

#

nope

#

const serverCount = response.length

#

yeah

#

guilds have a permissions number

gaunt crypt
#

How does one go about creating a bot?

mellow kelp
#

create a bot

gaunt crypt
#

Well, yes, but what steps

drifting wedge
#

@gaunt crypt do u know how to code?

hoary junco
#

How can I make a image smaller in css

drifting wedge
#

height width

mellow kelp
#

width: smolWidth

ancient dagger
#

Ok @crimson vapor I am here

crimson vapor
#

I don't know java KEKW

gaunt crypt
drifting wedge
#

what lang?

ancient dagger
eternal osprey
#
let varz = "";
                let z = "";
                let var5 = Boolean(raid.ex_raid_eligible);
                if (var5 == true) {
                  varz = reactionEmoji9;
                  function isRaidBoosted(raid) {
                    var pokemon = [];
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
                  } let text =
                    `**${name}** | **${varz}**  | **${z}**` +``` why is this always showin boosted and ex logo?
#

because it is not always true or false

earnest phoenix
#

What is exactly supposed to return a boolean here? @eternal osprey

#

var5?

eternal osprey
#

let var5 = Boolean(raid.ex_raid_eligible);

mellow kelp
eternal osprey
#

yeah

mellow kelp
#

there are a couple of libraries for permissions i think

earnest phoenix
#

What is the ex_raid_eligible property

eternal osprey
#

and it does return false/true.

mellow kelp
eternal osprey
#

just can't get the emoji to work. Because now it only shows the emoji all the time, even though the boolean shows false.

#

anyone that knows the answer?

mellow kelp
#

response doesnt have an id

#

its an array of guilds

ripe epoch
#

how would i force dark mode on my bot page? i was directed here to ask. thanks for any help 🙂

mellow kelp
#
[
  {
    "id": "some-guild-id",
    "name": "The kids club",
    "permissions": 435632,
    // There was more stuff
  }
]
earnest phoenix
#

Just map it

crimson vapor
#

array.prototype.map

ripe epoch
# mellow kelp on the edit page

the option is there however when i click it and submit my changes it does not work. I get the error:
Forced themes are only enabled for creators who use custom CSS in their detailed description.

However i am unsure of how to rectify the issue.

earnest phoenix
#

console.log(<Guilds>.map(...fn).join(seperator))

mellow kelp
#

apparently

ripe epoch
#

🤔 ok i have no clue on that. I think ill leave it as is

earnest phoenix
#

Notation

#

Read about it

eternal osprey
#

okay so i fixed the EX problem.

#

but i have the same problem with the BOOSTED

#
 let z = " ";
 function isBoosted(raid) {
                    var pokemon = raid.pokemon_id;
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
                  }
             if (isBoosted(raid)) {
                  
                  z = "BOOSTED";
                  
                  }
                  let text =
                    `**${name}** | **${varz}**  | **${z}**` +````
#

this code is not showin the boosted at all

#

i tried logging z

#

but it does nothin

#

could anyone help me please?

mellow kelp
#

well

#

isBoosted doesn't return anything

#

but i guess it should return a boolean

eternal osprey
#

yeah

#

you see

#

it is not working,

earnest phoenix
#

isBoosted function doesn't return anything

#

It doesn't have the return keyword in it

eternal osprey
eternal osprey
earnest phoenix
#

Several ways

lyric mountain
#

for, forEach, do-while, while and iterator

#

choose your flavor

earnest phoenix
#

for() loop, Array.prototype.map(), Array.prototype.forEach(), Array.prototype.reduce(), etc etc

lyric mountain
#

map and reduce technically ain't loops

eternal osprey
mellow kelp
#

for example

earnest phoenix
#

They aren't, but they at least apply a function in the current element so

mellow kelp
#
function isAwesome(value) {
  return value === 'awesome';
}
eternal osprey
#

owh fuck.

#

okay thanks.

earnest phoenix
#
function bruh() {
"Bruh";
}

bruh(); // undefined

function bruh() {
return "Bruh";
}

bruh(); // "Bruh"```
mellow kelp
#

nope

#

well array.map basically creates a copy of the original array

#

you can pass a function that returns a different version of the current element

#

for example

#
const nums = [4, 6, 2, 3];

// I want to double all the numbers
const doubled = nums.map(num => num * 2); // [8, 12, 4, 6]
eternal osprey
#
function isBoosted(raid) {
                    var pokemon = raid.pokemon_id;
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
                    if (isBoosted(raid)) {
                  
                      return z = "BOOSTED";
                      
                      }
                  }```this should just work fine but it doesn't
#

still BOOSTED doesn't show, while it actually should.

mellow kelp
#

you always have to return a value

earnest phoenix
#

then something is broken

#

You can iterate through every guild and access whatever property of it you want, and join it and log all at once instead of spamming the console

#

Wait

#

@eternal osprey Your app is going in a loop

eternal osprey
earnest phoenix
#

isBoosted still doesn't return anything

#

You are calling isBoosted in the function

#

You're closing the function early

#

And calling the function inside the function itself which doesn't even return anything

mellow kelp
#

that function be like

earnest phoenix
#

Hello how to add server count in our bot dashboard

#

Use the top.gg API to post your servercount

#

How

#

I don't know

#

Google basics of making a POST request

earnest phoenix
eternal osprey
earnest phoenix
#

Lemme explain your function lmao

#
// Function definition start
function isBoosted(raid) {
// Defining variables
                    var pokemon = raid.pokemon_id;
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
// This is where the function is supposed to end and return a value but you don't close and call it in a if statement which as usual, it doesn't have a return value because it never passes this block
                    if (isBoosted(raid)) {
                  // Abandoned area
                      return z = "BOOSTED";
                      
                      }
                  }
// Function definition end```
crimson vapor
#
// Function definition start
function isBoosted(raid) {
  // Defining variables
  var pokemon = raid.pokemon_id;
  var key = "" + weathers[raid.cell_id];
  var weatherAffinitie = weatherAffinities[key];
  // This is where the function is supposed to end and return a value but you don't close and call it in a if statement which as usual, it doesn't have a return value because it never passes this block
  if (isBoosted(raid)) {
    // Abandoned area
    return z = "BOOSTED";

  }
}
  // Function definition end``` lemme format your function
eternal osprey
#

so i should close it and return it's value

earnest phoenix
#

Can any one send of server count

eternal osprey
#

and after that scope i should use the if?

earnest phoenix
#

Return the value that's supposed to be the boolean

#

how to add server count in our bot dashboard @earnest phoenix

#

I already told you

earnest phoenix
#

smh

#

@earnest phoenix how

earnest phoenix
mellow kelp
#

well, http request

#

but yea that

earnest phoenix
#

I don't now please help

#

How to post

#

Is it so hard to do a Google search?

#

@earnest phoenix what search

mellow kelp
#

bruh

#

"http requests"

earnest phoenix
#

🗿 I literally said, "Google basics of making a POST request"

eternal osprey
#
function isBoosted(raid) {
                    var pokemon = raid.pokemon_id;
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
                   return m = Boolean(z);
                  
                   }     ```so like this right?
earnest phoenix
earnest phoenix
crimson vapor
eternal osprey
#

omg i fucked up

earnest phoenix
#

So many questions, yet only a few answers

#

🗿

earnest phoenix
eternal osprey
earnest phoenix
eternal osprey
#
**${z}**` +```
#

this is z lmao

earnest phoenix
#

This guy confused himself in his own confusion

eternal osprey
#
 let text =
                    `**${name}** | **${varz}**  | **${z}**` +```
earnest phoenix
#

How to post request

eternal osprey
#

yeah

earnest phoenix
#

But

#

What is m

eternal osprey
#

so if( m == true){

pale vessel
#

Jeez what is wrong with your editor

earnest phoenix
#

Just return the boolean instead of assigning it to a variable

eternal osprey
#

but how would i later on call it then?

earnest phoenix
#

Uhh, just call the function?

#

🗿

eternal osprey
#

but it has no variable assined to it

#

or wait i have to call z

#

nvm

crimson vapor
#

it doesn't need to return a variable

eternal osprey
#
 function isBoosted(raid) {
                    var pokemon = raid.pokemon_id;
                    var key = "" + weathers[raid.cell_id];
                    var weatherAffinitie = weatherAffinities[key];
                   return Boolean(z);
                  
                  }```like this
#

but wouldn't it be undefined if i would try to reach it?

mellow kelp
#

still

#

what is z?

eternal osprey
#

because i closed it right after the return

#

it is my own code and i fuckin forgot

earnest phoenix
#

Wait a minute

#

Uhh

#

If you only need to convert the variable z to a boolean and return it, why to define the other variables that are unused

eternal osprey
earnest phoenix
#

Your function definitions are confusing, you're defining variables or doing operations that doesn't affect the return value whatsoever

eternal osprey
#

yeah nvm boys. Thanks for the help!

#

i will just cut it off and delete that function.

earnest phoenix
#

You take a parameter called raid and define variable based on it, but on return you only convert z to a boolean

#

K

eternal osprey
#

or wait it worked

tribal turtle
#

Slash commands

vague imp
#

Lol

sterile lantern
#
 request('https://verify.eryn.io/api/user/' + message.author.id, { json: true }, (err, res, body) => {```
says it cannot read property 'id' of undefined
knotty obsidian
#

Why does this line throw a NullPointerException?

.setImage(event.getChannel().getHistory().getMessageById(event.getMessageIdLong()).getAttachments().get(0).getUrl())
sudden geyser
#

one of those method calls returned null

mellow kelp
#

probably because the message attachment is null

sterile lantern
#

how come message.author is returning inbalid

#

invalid**

knotty obsidian
#

does a embed image count as a attachment?

sterile lantern
#

since it cant read proeprty of 'id'

#

yes

sudden geyser
#

I don't believe so.

sterile lantern
#

wat really

sudden geyser
#

It would be under the embeds object returned from the API.

knotty obsidian
#

then how do i get the image?

sterile lantern
#

o

mellow kelp
#

o

sterile lantern
#

well why isnt the request working when i send it

#

it just keeps giving me it cant read id

sudden geyser
#

Is the image in an embed, or is it just an attachment

knotty obsidian
earnest phoenix
#

Rr lb

sudden geyser
knotty obsidian
#

ok thx

sudden geyser
sudden geyser
#

Also why are you using request? It's deprecated.

sterile lantern
#

o

#

still get same error

#

it doesnt log msg

sudden geyser
#

Then you probably did it incorrectly.

#

Show how you logged it

sterile lantern
#

console.log(message)

sudden geyser
#

more of your code

sterile lantern
#
 exports.run = async (Discord, client, message, args) => {
    console.log(message)
      let groupid = 1;
          request('https://verify.eryn.io/api/user/' + message.author.id, { json: true }, (err, res, body) => {```
sudden geyser
#

Are you sure it didn't log anything, because going by that, message is not a Message instance like you're using it.

sterile lantern
#

oh its very small

#

[]

#

i missed it mb

knotty obsidian
molten yarrow
sudden geyser
#

You have to check beforehand if any of the methods are null.

#

You could log one-by-one to find the offender.

#

billion dollar mistake™️

sterile lantern
#

ill send the whole code one sec

knotty obsidian
#

u cant upload messages without attachments there

#

so how come its a nullpointer

molten yarrow
sterile lantern
#

in my index?

#

all my other cmds work

#

so thats not the problem

molten yarrow
#

if you have it in your index than yes

sterile lantern
#

ah nvm

#

i didnt have discord defined

#

🤦

molten yarrow
#

xD

earnest phoenix
#

How can i put attachment in .setImage() on MessageEmbed.?

lyric mountain
#

attachments://name.png

knotty obsidian
#

why this throw null pointer

.setImage(event.getChannel().getHistory().getMessageById(event.getMessageId()).getEmbeds().get(0).getImage().getUrl())

(yes, the embed im getting 100% has a image)

tribal turtle
#

Noice

#

Added slashcommands

#

Pretty easy to do with discord.js

knotty obsidian
#

i dont think this is to show off but to ask-

tribal turtle
#

Uh

#

Maybe not

#

😂

mellow kelp
#

nah i guess its good

#

i havent tried yet tho

knotty obsidian
#

people ask questions here

mellow kelp
#

is it just with discord.js?

#

or is there some other extra lib for slash commands

tribal turtle
#

Yeah

#

No

#

Just discord.js

mellow kelp
#

oh cool

tribal turtle
sterile lantern
#

what here is not in v12 bc some of it isnt but i forgot:

         
            } else { 
                rbx.getUsernameFromId(body.robloxId).then(username => {
                  let nametoset = username;
                
                    message.member.setNickname(nametoset).catch(function(err){ 
                message.channel.send(`Error: I was not able to update your discord nickname.`)
                    const newname = body.robloxUsername;
            });
                    message.member.addRole(message.guild.roles.cache.find("name", "Verified")).catch(function(err){ 
                message.channel.send(`Error: I was not able to give you the verified role.`)
            });
                    rbx.getRankNameInGroup(groupid,body.robloxId).then(data => {
                        rbx.getRankInGroup(groupid,body.robloxId).then(data => {
                            let RankForGroup = message.guild.roles.cache.find("name",data);
                            message.member.addRole(RankForGroup).catch(function(err){ 
                message.channel.send(`Error: I was not able to update your discord role.`)
            });
            });```
copper blade
#

Sorry

knotty obsidian
#

?

copper blade
#

Wrong server my bad

knotty obsidian
#

lol

tribal turtle
#

Bro that's a long chain of functions haha

copper blade
#

I accidentally said eat my 🍆

knotty obsidian
#

yeah i saw that..

copper blade
#

Yeah

tribal turtle
#

Nice typo lol

knotty obsidian
#

are all of the cool people gone to sleep

#

i still get error

tribal turtle
#

Add a breakpoint

#

See what is null

mellow kelp
#

use your trusty debugger

knotty obsidian
#

can i set that in intellij?

#

ill try

sterile lantern
#

probs has to do with a .find thing since its in v11

#

is it not message.member.addRole

#

?

molten yarrow
sterile lantern
#

ojj

#

ok ty

#

how abt setNickname

molten yarrow
sterile lantern
#

hmpj

#

i get fn.bind() is not a function

#
 message.member.setNickname(nametoset, "Verification").catch(function(err){ 
                message.channel.send(`Error: I was not able to update your discord nickname.`)
                    const newname = body.robloxUsername;
            });
                    message.member.roles.add(message.guild.roles.cache.find("name", "Verified")).catch(function(err){ 
                message.channel.send(`Error: I was not able to give you the verified role.`)
            });
                    rbx.getRankNameInGroup(groupid,body.robloxId).then(data => {
                        rbx.getRankInGroup(groupid,body.robloxId).then(data => {
                            let RankForGroup = message.guild.roles.cache.find("name",data);
                            message.member.roles.add(RankForGroup).catch(function(err){ 
                message.channel.send(`Error: I was not able to update your discord role.`)
            });
            });```
#

from this

mellow kelp
#

.bind?

sterile lantern
#

yes