#development

1 messages ยท Page 601 of 1

neat falcon
#

just wanted to inform

earnest phoenix
#

Oh

#

lmao

earnest phoenix
#

im done with my bot

topaz moth
#

Why do i get a forbidden 403 error when trying to post my server counts using dblpy?

slender thistle
#

Easier to make an HTTP call manually

hard tendon
#

uh hi

#

I have a bit of a problem

#

so for my bot I use the following as a welcome message:
A new user by the name of ${member} has joined **${member.guild.name}**!
It tells me that {member} is not defined

#

so what can I do?

#

<@&304313580025544704>

zealous veldt
#

Don't tag all mods

modern sable
#

please dont ping all mods for non-emergencies

hard tendon
#

sty

zealous veldt
hard tendon
#

sry sry

#

but can u help meh?

idle basalt
#

define member

hard tendon
#

should I do smt like member = GuildMember

idle basalt
#

is this the guildMemberAdd event?

hard tendon
#

yes

idle basalt
#

use whatever you defined the parameter as

hard tendon
#

I have a list of random messages that will be sent

idle basalt
#

so if you called it guildMember, use that

topaz moth
#

Why do i get a forbidden 403 error when trying to post my server counts using dblpy?

idle basalt
topaz moth
#

ok thanks

hard tendon
#

syztum can I pm u for a sec?

idle basalt
#

why ๐Ÿค”

late hill
#

Maybe don't put member

idle basalt
#

just use the parameter you passed in

late hill
#

As member is most likely an object

#

member.tag is probably what you're looking for ?

idle basalt
#

no thats fine

#

the problem is member is undefined

hard tendon
#

this is the list of messages I use

idle basalt
#

ag well of course its undefined

late hill
#

lol

idle basalt
#

move that into the place where you defined member

#

or make it a function and pass member

hard tendon
#

I never understood functions how do they work?

idle basalt
#

sorry im on mobile haha lot of typos

hard tendon
#

np lol

late hill
#

yes

#

But still

#

^Depending on what lib he uses, just putting "member" there might not be the best idea

idle basalt
#

hes using d.js obv

hard tendon
#

disocrd.js

#

discord.js*

idle basalt
#

and stringifying the member object gives you the tag

late hill
#

He didn't say it was discord.js

#

I don't just assume ๐Ÿ˜ฉ

idle basalt
#

i do because if hes not using d.js he should switch lol

#

its the only good js lib

late hill
#

why's that

#

Big disagree

hard tendon
#

but I had only one massage at the start when I first coded the bot and that message was in guildMemberAdd event and it worked fine

idle basalt
#

yea because it was in the event

#

move your messages into the event where member is defined and it will work

hard tendon
#

oh okay lemme see

#

I understand most of discord.js but sometimes I do get stuck on simple stuff

idle basalt
#

its not discord.js lol its javascript

#

this is basic js

hard tendon
#

yeah yeah xD

late hill
#

Scopes

#

yes

idle basalt
#

i gotta blast but good luck have fun lol

hard tendon
#

cya

late hill
#

Don't use var btw or I will slaughter you

hard tendon
#

xD

scarlet phoenix
#

Was there ever a survey don't about what languages/libs everyone here uses. I feel like a solid 80%+ is js stuff.

earnest phoenix
#

in here probably

#

its not oop so its easily picked up by low iqs

#

even then they fail to have basic understanding of if closures

dusky marsh
#

What?

unkempt halo
#

Kikkia: I feel like a solid 80%+ is js stuff.
cry: its not oop so its easily picked up by low iqs

#

discordjs is oop library

dusky marsh
#

Oh, yeah lmao

#

I just saw your message without the context and was confuswd

balmy lantern
#

Does this server count as multiple servers?

zealous veldt
#

Um

#

No

#

Why would it? What do you mean by that

balmy lantern
#

Really? Like if it had a member boost

#

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

zealous veldt
#

We might have 2x the members of other guilds but we don't count as 2 guilds

balmy lantern
#

Ok cool

spring ember
#

2x is an understatement

#

It counts as a big guild in terms of Discord

balmy lantern
#

Ya

#

Darn i wish server count was on the site lol

idle basalt
#

it is...

hushed berry
#

@spring ember wdym it counts as a big guild in terms of discord

viral spade
#

Hello,
i want to send an embed and set the thumbnail or image as the guilds main image.
i was trying .setThumbnail(msg.guild.icon), icon is something like '351e9e265e23e0f6df5bbf23708c5f04', but .setThumbnail() expects an url. what can i do?

inner jewel
#

iconUrl?

viral spade
#

oh its actually there. i missed it while going through the object. thanks!

robust ice
#

Hello, I want to make a bot that sends cute images on command. What's the best practice for this? I feel like hosting .gif on my own host will just eat bandwidth.... I don't have money for that @_@

#

What do people usually do?

buoyant wagon
#

?

#

๐Ÿคท

balmy lantern
#

how long does a vote last? 12 hrs i assume?

#

@robust ice i hardcoded mine in

#

off of links

#

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

robust ice
#

Yes I'm going to end up doing that

#

uploading gif to giphy

#

then copy the URL

balmy lantern
#

yup

robust ice
#

xD

hushed berry
#

@robust ice It's not as bad as you think. Discord proxies embeds through their own CDN so the only time it'll really get loaded is when its loaded by discord and when anyone that clicks the link

#

I'd expect most people to just keep it in discord and look at it through the embed

robust ice
#

but the initial send attachment (outgoing bandwidth)

hushed berry
#

oh like that

#

i see what you mean

robust ice
#

because it keeps sending from local host

#

even without hotlinking

#

yea the hotlinking will be discord's cdn but the initial... sending :<

hushed berry
#

yeah ik ik

#

i thought you just meant

#

sending a link lol

#

which may just be the best way to go about doing it ๐Ÿคท

#

To sorta emulate the attachment, you could always send an embed with the url as the image

robust ice
#

yep yep

flat flax
#

okay third times a charm anyone able to help with something??

hushed berry
#

just ask your question my dude-erino

flat flax
#

its easier to explain via voice are you able to join a vc?

hushed berry
#

I guess

robust ice
#

Uh...

#

ok the problem now is that they're slow

#

sending 2mb gif file everytime for a command is a bad idea?

#

maybe I'll just hardcode discord cdn images then, but how reliable are they? will they delete it eventually?

earnest phoenix
#

if the message gets deleted, so do the attachments

#

otherwise no, discord cant afford to have data loss

robust ice
#

๐Ÿค”

high lava
#

The attachment doesn't get deleted from the servers, just locally (eventually)

robust ice
#

I just used mantaro bots for a while, they reply with gifs incredibly fast, how do they do that?

#

no delay at all

high lava
#

Embeds

#

They don't need to save images locally on the bot, it simply takes the picture from a link and tells discord to display it from that link

#

Except it hides the url

lusty dew
#

What are they trying to do? I

robust ice
#

oh they embed and then delete the link!?

#

but how?

lusty dew
#

when using setImage() or whatever it is the embed just displays the image

#

not the link

high lava
#

They don't delete the link. Using embeds just don't show it

lusty dew
#

Yea

robust ice
#

ahh let me try embeds then

lusty dew
#

The link is still there the embed just doesn't show it like Jaylon said

robust ice
#

not attachment

sinful lotus
#

what are you doing

lusty dew
#

I just got here and read only a little bit of chat ยฏ_(ใƒ„)_/ยฏ

#

idk what they are doing

#

I think they are trying to send an image just not the link

high lava
#

They don't want to send a file every time they need to show a picture

lusty dew
#

Oh

sinful lotus
#

upload the picture to some image provider

#

then use that link on .setImage

high lava
#

mhmm

lusty dew
#

Why not use an image api

sinful lotus
#

I have my own image api

lusty dew
#

There usually are some for what you are looking for

sinful lotus
#

but I dont use it lmao

lusty dew
#

may I use it ;3

#

Lel

#

jk

sinful lotus
#

I just want to be kool and use my domain for pictures

#

inser hehe dog emooji

lusty dew
#

What does it retrieve?

#

What kind of images?

high lava
lusty dew
#

I am trying to make my own api

high lava
#

That simply takes the url and outputs the image

lusty dew
#

just not sure how to go about it

sinful lotus
#

imma grab something a sec

lusty dew
#

kk

sinful lotus
#

something like that

lusty dew
#

Also why is my name I'm Your Father Figure?

#

๐Ÿ‘€

sinful lotus
#

we just need to work on our own ui

lusty dew
#

Ah mk

#

What did you make the api out of?

#

js?

sinful lotus
#

apache

lusty dew
#

๐Ÿ‘€

#

I see

#

Heard of it never used it nor looked at it

sinful lotus
#

well its old

lusty dew
#

I'm trying to make my own api to grab images as well.

#

:p

sinful lotus
#

could be slower than node.js

lusty dew
#

Then use it on my bot

sinful lotus
#

we use oauth2 for auth

lusty dew
#

Ouu nice

sinful lotus
#

and make sure its only me or my co dev has access to image api

lusty dew
#

๐Ÿ‘€

sinful lotus
#

then make an ui so that we can upload from webpage

#

then grab the link and use it here

lusty dew
#

Seems nice

#

I should get working on my own api soon

#

Just gotta figure out how

sinful lotus
#

making the webhooks independent is one kind of api tho

#

lmao

lusty dew
#

Ye

#

My api is going to grab non-sfw and sfw images

sinful lotus
#

its just long to maintain that kind of api

lusty dew
#

Huh?

sinful lotus
#

picture api in short

lusty dew
#

wdym it is just long to maintain that kind of api?

#

what is long?

#

๐Ÿ‘€

sinful lotus
#

maintaining pictures, updating it ๐Ÿ‘€

lusty dew
#

Ah

#

Yea

#

I see what you mean now

#

btw does anyone wanna help me test out my bot?

sinful lotus
#

as well you need ssd there

#

since depending on your demand

#

you need fast storage

high lava
#

Just use a danbooru or moebooru based image board

#

the API is super simple

sinful lotus
#

yeah that works tooo

lusty dew
#

Yea

#

I used danbooru before

#

didn't really like is

#

it*

high lava
#

I used Danbooru, Gelbooru, Konachan and Yande.re

lusty dew
#

I was able to search for lolicon ๐Ÿ‘€

sinful lotus
#

ban lolicon

#

ez

high lava
#

you can remove it

#

+-

lusty dew
#

I know

#

There is always ways around it though

sinful lotus
#

use regex for more failsafe

scarlet bane
#

never heard of apache

#

jesus christ this generation makes me sadder by the day

lusty dew
#

and It is tiresome to try and ban all those keywords

sinful lotus
#

apache is big boi

#

I use it on my webpage

bright spear
#

Apache is server software right

lusty dew
#

You can use nadeko to look up lolicon

#

which is bad

sinful lotus
#

apache is a webserver that you can use for lots of stuff

#

supports ssl auto regen too

high lava
#

Well they don't stop the actual request from searching for it

sinful lotus
#

ez pz https

robust ice
#

hmm that works really great the embed

high lava
#

I make sure to put +-lolicon in my request

robust ice
#

but it shows that left bar

lusty dew
#

huh?

#

Left bar?

high lava
#

It's either that or you show a link

#

The embed color

lusty dew
#

Ah

sinful lotus
#

make the embed color invisible

lusty dew
#

Change the embed color :p

high lava
#

True

lusty dew
#

Use discords background color

#

Lol

#

That is what most ppl do

high lava
#

It makes it look odd, but it does the job

lusty dew
#

Question who here codes on mobile?
๐Ÿ‘€

sinful lotus
#

for me I just used my bot's character hair color

#

for my embed colors

#

makes sense if you ask me

lusty dew
#

When I just found out my computer is magnetic

robust ice
#

hmm, the image is significantly smaller too

lusty dew
#

If the image was too big

sinful lotus
#

it scales to the embed size

lusty dew
#

the embed is going to downscale it to fit the embed

#

Ye what Weeb said

#

How do I get my nickname changed

#

๐Ÿ‘€

#

I don't like it

sinful lotus
#

ask mod

lusty dew
#

Do I ping one or?

sinful lotus
#

just ask oone

lusty dew
#

Mk

robust ice
#

no there's a padding box around the embed

lusty dew
#

Like we said

#

The image will scale to the size of the embed

robust ice
#

if you just attach a file, it doesn't have that embed box

lusty dew
#

Bc

#

you are attaching the file

high lava
#

But then you actually have to send a LOT more data

lusty dew
#

not putting it in an embed

robust ice
#

the mantaro one is like that

#

phew

#

I'll use embed still

earnest phoenix
#

does on mobile because mobile devs lack basic common sense ๐Ÿ™ƒ

lusty dew
#

When you put an image in an embed if the image is too big it will scale to the size of the embed

robust ice
#

............I'm talking about the embed box padding

lusty dew
#

Ok?

#

What about it?

earnest phoenix
#

you cant get rid of it without clientside css

lusty dew
#

Yea

#

It is just there

robust ice
#

So Mantaro bot doesn't use embed... it's direct file attachment

lusty dew
#

Mk.

high lava
#

I'm pretty sure it uses an embed thinkWot

#

One sec

robust ice
#

They don't have that embed box

lusty dew
#

Yea it uses embeds

robust ice
#

but wow the bandwidth....

#

Then how do they get rid of the embed box padding + styling

earnest phoenix
#

they upload a file each time

#

but its compressed

robust ice
#

๐Ÿ‘€

#

.gif compression is pretty damn terrible tho

earnest phoenix
lusty dew
#

Lol

#

Not even that much

earnest phoenix
#

utils like imagemagick do a pretty good job of gif compression

high lava
#

Embed

lusty dew
#

Ye

high lava
#

Actual picture was 34kb large

robust ice
#

that first gif (bite) was 2.5mb

lusty dew
#

Mk

high lava
#

This bot is actually outdated as hell

robust ice
#

but I guess they mix it, using embed

#

and attachment....

lusty dew
#

I don't think it has been updated has it?

high lava
#

I don't think so

robust ice
#

can't imagine that 2.5mb per request bandwidth

lusty dew
#

Not in a while.

#

I thought badnwidth had something to do with Audio stuff or am I wrong?

high lava
#

I tried another command that uses anilist and it doesn't even pull the right information or get rid of html tags

#

And I just found out my bot literally does the same thing, but actually works. lmao

earnest phoenix
#

uploading a file on each command is just straight up api abuse imo

lusty dew
#

Lmao

high lava
#

I didn't even know another bot did that. welp

lusty dew
#

Did what?

high lava
#

Used an anime command that uses the anilist api

lusty dew
#

Ah.

high lava
#

It just uses the outdated one from the look of it

earnest phoenix
#

like 90% of generic weeb bots do that

lusty dew
#

Lol.

#

My bot isn't a weeb bot.

high lava
#

Not really

earnest phoenix
#

okay maybe like 80%

high lava
#

Very few do that

lusty dew
#

It is just called Clap bot with a lewd anime pic.

high lava
#

Clap

lusty dew
#

Guess the server name xD

stable halo
#

arse

lusty dew
#

?

#

Oh no

#

The server name is called

#

Clap Them Sluts

#

It was originally

#

Clap Them Cheeks

#

but my friend dared me to change it to what it is now

stable halo
#

sluts

lusty dew
#

Lol

high lava
#

oof

lusty dew
#

I am so hungry

#

xD

#

Mk I did not understand any of what you said

#

So from what I am gathering

#

you want to send that in an embed

#

Then put the values in an embed?

#

Pull the values from the database

#

and put them in an embed

stable halo
#

just fetch it

#

db.fetch

#

you can read the database's document page lol

idle basalt
#

db.fetch() isnt a method with the db hes using

#

if db.get() returns that array, then all you have to do is map it like i told you to do earlier

idle basalt
#

let me try to explain againjs // you have this const arr = [ { id: '015_00', level: 17, iv: 40 }, { id: '162_00', level: 33, iv: 5 }, { id: '137_00', level: 3, iv: 68 }, ]; arr[0]; // => { id: '015_00', level: 17, iv: 40 } arr[0].id // => '015_00' arr.map(e => e.id) // => [ '015_00', '162_00', '137_00' ]

#

its hard to explain this in better detail without just giving you the answer

stable halo
#

isnt .get and .fetch the same thing

#

.fetch() is an aliases

#

same thing

idle basalt
#

its not in the docs /shrug

#

he said hes using quick.db

stable halo
#

??

#

how is it not in the docs lmao

#

yeah its not in the docs

idle basalt
stable halo
#

there

#

.get

idle basalt
#

hes already getting it. his problem is he cant figure out how to get the values from the objects in his array

stable halo
#

yeah and you're saying .fetch isnt the same as .get

idle basalt
#

i dont see what youre getting at... ive never used quick.db and theres no .fetch() in the docs

stable halo
#

i just sent you the picutre

#

its an aliases

#

and its also changed to .fetch instead of .get

#

can you see now

idle basalt
#

where the hecc did you get that from

stable halo
#

holy shit

#

i need to video this shit

idle basalt
#

oh no im rart

#

i gotchu

stable halo
#

you see it yet?

idle basalt
#

ok .fetch() is an alias but... why does he need to use the alias

#

he already has the data from the db thonk

stable halo
#

whats wrong with using an aliases jesus christ, why are you making such a big deal over .get and .fetch

#

just stop

idle basalt
#

lmao

solid shale
#

how do i make it show the # of servers on discord bot list

idle basalt
#

use the api

late hill
#

๐Ÿ˜ก ๐Ÿ˜ก
1 alias, 2 aliases

bright spear
#

lol

split musk
#

what is the problem ?

astral quail
#

that thingy is undefined.

hasty orbit
#

How do you make a bot that welcomes those who joined?

lament meteor
#

read the docs

hasty orbit
#

where is the docs?

amber fractal
#

Google whatever your db is

obtuse spire
#

@prisma vigil

split musk
#

@astral quail things it doesnt problem

earnest phoenix
#

@ready_dino0924#6878 what language

grim aspen
#

he left

unique nimbus
grim aspen
#

for the third time; message above me

hard tendon
#

Fixed my bot finally xD

unique nimbus
#

yay

hard tendon
#

I was up last night till like 3AM and did not fix it but today in like 5 mins I fixed it

unique nimbus
#

lmao

hard tendon
#

Peter can I dm u for a sec?

unique nimbus
#

sure

earnest phoenix
#

o!p ืฆื‘ืขื™ื

earnest phoenix
#

hey can anyone help me?
i want to underline some in discord.

shrewd lintel
#

__underline__

earnest phoenix
#

ohhh thank you ๐Ÿ˜„

dusty cipher
#

Hello peeps , how much time does it take to approve a bot ?

grim aspen
dusty cipher
#

i did read xD nothing is being mentioned there

#

hmm

#

i search in list and check if he is online i dont see anything, even though he is online and ready to kick off

grim aspen
#

once it gets approved, it will be shown on the new bots page

dusty cipher
#

oh i see

#

thanks i got it

#

had to scroll down

earnest phoenix
#

I'm trying to get channel from my db, but is an int, so when i do log['channel'] i ofc get an error, how would i get it as an int?

quartz kindle
#

which language / library?

earnest phoenix
#

python

#

@quartz kindle ^

quartz kindle
#

i dont work with python, so i cant help. but can you post your code on how you get it from the database?

earnest phoenix
#

log = await bot.pool.fetch("SELECT * FROM logging WHERE guildid = $1", ctx.guild.id)

scarlet phoenix
#

@earnest phoenix on mobile, but try python print(str(channel))

earnest phoenix
#

i get channel isn't defined

scarlet phoenix
#

Str(whatevs) gets the string representation of stuff. Although if it's something more complex like a class, do something like python Class.__repr__

#

My code was assuming that you have retrieved the value from the db

lusty dew
#

Is this lua?

#

๐Ÿ‘€

scarlet phoenix
#

Where channel = that value

earnest phoenix
#

no

scarlet phoenix
#

Python

earnest phoenix
#

ill try

lusty dew
#

Ah yea

#

Forgot python has a print function as well

#

xD

scarlet phoenix
#

Ecks dee

lusty dew
#

Lel

#

I never understood python

scarlet phoenix
#

It's useful for scripting but not bigger stuff imo

lusty dew
#

Yea.

#

I used python when I first began coding

#

then I switched to rewrite and stopped after that

scarlet phoenix
#

Same, I wrote one in py at launch of the api, then discord.py then split some into Java, then eventually all into Java/kotlin. It gets really unsustainable

teal magnet
#

'-'

teal magnet
#

client.login(config.token);

slim heart
#

How do I get permissions of a member from the guild again?
ex: GET /guilds/399688888739692552/members/142408079177285632
Gives me json { "nick": null, "user": { "username": "JPBBerry", "discriminator": "0001", "id": "142408079177285632", "avatar": "a_efef6cdcb9b5426c5b0925df69e9ce89" }, "roles": [ "399696617504112655", "415323805943070721", "416797136081125377", "417079846011797505", "481283540965916682", "517078121174925314", "518957303920066567", "523577988294639629", "526394881367867412", "540668410217103400", "540668482182709260", "547540372067450880", "551068271542009866", "557607683222667285", "558820531197968384", "559081097271443479", "559086971725807636" ], "mute": false, "deaf": false, "joined_at": "2018-01-07T22:20:57.013000+00:00" }
But that doesn't have any permissions value?

inner jewel
#

no

#

you need to get the roles and calculate them

slim heart
#

oh thats just annoying

inner jewel
#

if you need for a channel, you'll need to get the channel and use the overrides

#

roles are easy

#

just bitwise or

slim heart
#

dont i have to go through all of them?

#

maybe i misunderstand

inner jewel
#

perms = roles.filter(r => member.roles.contains(r.id)).reduce(0, (a, b) => a | b)

#

yes

#

but there's only one extra request

#

to get all roles

slim heart
#

oooo

#

yea

#

oki

slim heart
#

How do I turn 104172609 into what the examples show, (like 0x0000008)

#

i woulda sworn that you can do it on those numbers

inner jewel
#

why would you?

slim heart
#

im lost

#
authRequest("/guilds/399688888739692552/members/142408079177285632").then(res1=>{
    authRequest("/guilds/399688888739692552/roles").then(res2=>{
        console.log((res2.filter(r => res1.roles.contains(r.id)).reduce((a,b)=>a.permissions|b.permissions) & 0x0000008) != 0)
    })
})```
this just returns false no matter what i think im doin somethin wrong again
#

o wait

#

i need to switch around a.permissions | b.permissions

scarlet bane
#

What are you doing

#

and why

slim heart
#

checking if a member has certain permissions

earnest phoenix
#

wow

slim heart
#

wym wow

earnest phoenix
#

bc i dont understand what do you do

slim heart
#

ummm, ok?

inner jewel
#

the order for a bitwise or doesn't matter

slim heart
#

the .reduce was the wrong way around

#

ughh im so lost

#

it works in one guild but not another testing one

slim heart
#

ooooo

lapis hazel
#

anyone know why my bot does not show online status on the website any longer?

fiery birch
#

ID?

lapis hazel
#

262691055030370306

fiery birch
#

yup

#

it was kicked from the server

lapis hazel
#

why was it kicked? O.o

fiery birch
#

dm's on join

lapis hazel
#

dm's on join?

#

should not be

#

let me check thank you

fiery birch
#

that's what is written in the mod log case

#

np

lapis hazel
#

gotcha. Is there a way for re review?

fiery birch
#

we can reinvite it here if you fix it and are sure that it is fixed

#

just lemme know when it is and I'll reinvite

lapis hazel
#

fixed. Please reinvite it. Guess i accidentally comment out a line of code.

fiery birch
#

alright, one min

#

its back now. @lapis hazel

lapis hazel
#

thank you! And thanks for checking

fiery birch
#

np

earnest phoenix
#

@zealous veldt

#

just passed up

#

1k

#

on game library

zealous veldt
#

yikers

#

nice nice nice

versed pawn
#

Approve my bot please

#

:(

idle basalt
versed pawn
radiant reef
#

hi

#

sooo

spring ember
#

pip3 install pydisk

radiant reef
#

i need some help

#

did that

spring ember
#

pip3 maybe because python 3

radiant reef
#

ok trying pip3

earnest phoenix
#

thats ghey

spring ember
#

Shut

radiant reef
#

cry

spring ember
#

I can't Google pydisk

#

It doesn't return anything useful

#

Is this a thing?

radiant reef
#

i have no clue

#

my friend just gave it to me

#

with code

spring ember
#

Well ask your friend what's that

radiant reef
#

i have he said it works for him

#

there is the full code

spring ember
#

I have no idea what pydisk is

radiant reef
#

i moded it to meat how i wanted it

#

yea i have no clue what it is as well

#

i go and ask my freind again

#

brb

slender thistle
#

pydisk does not exist on PyPi

#

So you can't just pip install it

obsidian shoal
#

how to make a redeem command like bloxlink?

bright spear
#

@obsidian shoal do you know how to code?

obsidian shoal
#

a bit, not a lot

bright spear
#

well you'll need to first learn a discord lib

obsidian shoal
#

discord.js right?

bright spear
#

yeah discord.js is one

obsidian shoal
#

I use discord.js

bright spear
#

but we won't just give you the code for a command

obsidian shoal
#

I know

#

Ima try to figure out how to do it and come back to see if its correct

bright spear
#

save stuff in a db

obsidian shoal
#

db?

bright spear
#

database

ruby talon
#

@spring ember @slender thistle, pydisc was a custom (private) libary that I created for a bot called 'Snex'.
I opensourced all of the snex code but I forgot to include the libary.
Meanwhile I've lost the libary and can't find it to help Acoustic Pixel, or anyone else who tries to use that code.

analog beacon
#

wouldn't pydisc still be stored in your site-packages folder?

ruby talon
#

@analog beacon I've looked there, couldn't find it.

analog beacon
#

ah ok

ruby talon
#

Maybe in annaconda

#

idk

#

havn't looked in those site-packages

ruby talon
#

welp mission failed.

broken elm
#

Iโ€™m using discord.js

#

Iโ€™m looking at an overwatch api

#

it outputs this as an example

#

{ username: 'Calvin',
level: 861,
portrait: 'https://d1u1mce87gyfbn.cloudfront.net/game/unlocks/0x0250000000000EF7.png',
games:
{ quickplay: { won: 647, played: undefined },
competitive: { won: 15, lost: 12, draw: 0, played: 27 } },
playtime: { quickplay: '129 hours', competitive: '5 hours' },
competitive:
{ rank: 4416,
rank_img: 'https://d1u1mce87gyfbn.cloudfront.net/game/rank-icons/season-2/rank-7.png' },
levelFrame: 'https://d1u1mce87gyfbn.cloudfront.net/game/playerlevelrewards/0x0250000000000974_Border.png',
star: 'https://d1u1mce87gyfbn.cloudfront.net/game/playerlevelrewards/0x0250000000000974_Rank.png' }

#

holy.. that looks awful

#

aaaaanyways

#

how would I go about formatting that, as I have no clue.

#

I would ideally want to just get the name, level, and rank

lucid mesa
#

Why is my bot muted if I can ask ??

broken elm
#

wdym?

lucid mesa
#

@fiery mauve as a role "muted"

broken elm
#

oof

#

dunno about that one

stable halo
grim aspen
#

get the bot's id first

quartz kindle
#

@broken elm just get the data you need and send it?

#

do you know how to access object keys and values in javascript?

lucid mesa
#

@stable halo I updated the bot and it's not that command anymore :/

stable halo
#

ask the moderators for an unmute

lucid mesa
#

Where ??

stable halo
lucid mesa
#

Okay x)

coral trellis
lucid mesa
#

Oh okay oops

low bolt
#

How can I list the members that have 'Administrator' permission?
I'm using discord.js

Like:
?adminlist command
Later message;

Admin List:

  • Admin 1
  • Admin 2

Like that

limber swan
#

how can i get the ids of all the guilds my bot is in

earnest phoenix
#

So when user type ?help check if he got an permission and if yes send an message... @low bolt

low bolt
#

What

earnest phoenix
#

Hello admin when my bot for approve

#

Yeah

winter hawk
#

Does anyone know, why does the font become rectangle when i host the bot on linux?
The text actually: แ |ฯฯƒัะบยขะฝฯƒฯ

#

On windows, it's fine.

earnest phoenix
#

Linux = bad

#

no u

lament meteor
#

hmm probs cause they font file doesn't have the alt code @winter hawk

limber swan
#

And i donโ€™t remember how to make the bot send a new message if the message has more than 2k characters

scarlet phoenix
#

before you send you can

1. look at the message you are about to send
2. if longer than 2k characters
    2a. split it by words (something like string.split(" ") depending on lang)
    2b. Iterate through all words counting the length. 
    2c. Once you've hit over ~1900 chars, then start putting all of the remaining words in a new string.
    2d. keep doing that (splitting by length of ~1900) until done with all
3. send it

Thats probably not the most efficient way to do it, buts pretty easy to do/understand

amber fractal
#

Or if you use d.js use built in message splitting

#

Lmao

scarlet phoenix
#

I know most libs do support built in splitting, but some don't. The ones that I have seen that do, dont require literally any work, just send the message normally

trail dagger
unique nimbus
trail dagger
#

I am on there

#

That is why i ask

unique nimbus
#

have you looked at the example

#

I used the example

#

and it works perfectly

trail dagger
#

I fixed the problem

#

i was out of date

unique nimbus
#

oh

#

well done

#

lmao

grim aspen
#

fuck

#

i realized that i can expose my token with eval

#

how do i not make it not do that

#

i mean like to make it respond with a different message instead of the token

unique nimbus
#

if input = [input] output no

quartz kindle
#

not make it not do that = double negative = make it do that

earnest phoenix
#

Why do you have an open eval?

grim aspen
#

it's protected

earnest phoenix
#

Then surely it's fine

unique nimbus
#

Make it DM you

grim aspen
#

but if i use client.token, that's a problem

earnest phoenix
#

edit the client object i guess

#

because there's so many ways to get "client.token" using different phrasing

#

message.client.token message.guild.channels.first().messages.first().client.token weSmart

sinful lotus
#

regex

quartz kindle
#
client.nope = "haha nope"

if(message.content.indexOf(".token") > -1) { message.content.replace(".token",".nope") }
grim aspen
#

so before

#

msg.channel.send('')

#

i put that

quartz kindle
#

before eval

sinful lotus
#

in our case its after eval

quartz kindle
#

if you wanna use regex to detect an actual token-like string, then yeah

#

there are many ways of doing it

#

im just preventing .token to be called in the first place

#

there are still ways to trick it though lul

dull bobcat
#

@earnest phoenix boy u so wrong

#

Linux is not bad, at all

quartz kindle
#

my linux is bad
my mac is worse
thats right
im bill gates windows

earnest phoenix
#

^^

sinful lotus
#

@amber fractal Im winning lmao

slender thistle
sinful lotus
#

oh

#

F

#

forget my akwardness

#

must be me getting so sleepy now

slender thistle
#

rip

sinful lotus
#

2:45am cant be young again sighs

balmy lantern
#

Is it possible to get all the server names your bot is in, not just for logging

zealous veldt
#

Yeah

#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

balmy lantern
#

Discord.js

mossy vine
#

wdym not just for logging?

balmy lantern
#

Like a command

mossy vine
#

yeah dont do that

zealous veldt
#
<client>.guilds.forEach(guild => {
console.log(guild.name, guild.id) // do whatever you want to do with it here;
});
balmy lantern
#

๐Ÿ‘

hushed berry
#

yeah im sure thats scalable

#

๐Ÿ˜‚

scarlet phoenix
#

I agree it is brute force, but realistically, even if you dont do it asyncronously, unless it's tens of thousands plus, youll be ok.

zealous veldt
#

Yewah

#

A better plan would be to check your database on every new message to see if that guild is in it

hushed berry
#

its more the fact that you cant really fit more than like 100 or so guild names into one message lol

zealous veldt
#

and if not add it

earnest phoenix
#

dump it into hastebin and reply with a link problem solved /s

scarlet phoenix
#

well hes logging them individually

#

cry has a good idea. Or you could just use queries to a db if you use one. But since hers trying to print them to stdout it makes me think he doesn't have too too many

earnest phoenix
#

yeah, probably

quartz kindle
#

sort them alphabetically and make it paginated

#

"showing 100 of 18732 guilds"

zealous veldt
#

lmao

earnest phoenix
#

yo

#

it says ready.js is not denified

#

can anyone help

#

how to link it

slender thistle
#

@quartz kindle Make it 10 instead

gleaming tulip
#

define it

quartz kindle
#

lul

earnest phoenix
#

its already

quartz kindle
#

@earnest phoenix where does it say that? what are you trying to do?

earnest phoenix
#

const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');

var prefix = ayarlar.prefix;

module.exports = client => {
console.log('>>Oynuyor kฤฑsmฤฑ baลŸarฤฑyla gรผncellendi.');
console.log('Bot hazฤฑr ve giriลŸ yaptฤฑ รœstadฤฑm.');

var Games = [
    
    
    `${client.users.size} Kullanฤฑcฤฑ ฤฐรงin TeลŸekkรผrler`,
    
    `${client.guilds.size} Sunucu ฤฐรงin TeลŸekkรผrler`,
   
    `!!help | 7/24๐Ÿ”ฅ | Frep`,
    
    `!!add | !!play | !!skip | !!pause | !!resume`,
];

setInterval(function() {

    var random = Math.floor(Math.random()*(Games.length-0+1)+0);

    client.user.setGame(Games[random], "https://www.twitch.tv/frepturetv");
    }, 2 * 2500);

};

quartz kindle
#

code blocks please

earnest phoenix
#

Error: Cannot find module 'C:\Users\KAAN\Desktop\FREPBOT\readys.js'
at Function.Module._resolveFilename (internal/modules/cjs/loader.js:582:15)
at Function.Module._load (internal/modules/cjs/loader.js:508:25)
at Function.Module.runMain (internal/modules/cjs/loader.js:754:12)
at startup (internal/bootstrap/node.js:283:19)
at bootstrapNodeJSCore (internal/bootstrap/node.js:622:3)

#

but its in FREPBOT/events/ready.js

zealous veldt
#

]]moreinfo

covert turtleBOT
#

If you want people to be able to assist you, please provide more information, such as what library and language you're using, the code in question and what you are trying to do and/or what is causing the error.

earnest phoenix
#

it says FREPBOT/ready.js

quartz kindle
#

where do you require it? i dont see it in your code. also please use code blocks

grim aspen
#

what library are you using?

earnest phoenix
#

js

grim aspen
#

making sure

quartz kindle
#

like this:
```
code
```

earnest phoenix
#

in where

#

const { Client } = require('discord.js');
const YouTube = require('simple-youtube-api');
const yt = require('ytdl-core');
const ayarlar = require('./ayarlar.json');
const client = new Client();
const Discord = require('discord.js')
const youtube = new YouTube(ayarlar.api);
require('./eventLoader')(client);

trim saddle
#

weary

zealous veldt
#

Please use code blocks

earnest phoenix
#

what is that

zealous veldt
earnest phoenix
#

oh k

quartz kindle
#

code blocks:this

earnest phoenix
#

i cant

#

press enter like that

quartz kindle
#

move your cursor to the end of the last `

#

then you can

earnest phoenix
#
code
#

ok

zealous veldt
#

pepoClap there you go

earnest phoenix
#
const { Client } = require('discord.js');
const YouTube = require('simple-youtube-api');
const yt = require('ytdl-core');
const ayarlar = require('./ayarlar.json');
const client = new Client();
const Discord = require('discord.js')
const youtube = new YouTube(ayarlar.api);
require('./eventLoader')(client);
#

this is my blabla

zealous veldt
#

put js after the first ```

quartz kindle
#

ok, but we still dont see where you require ready.js

earnest phoenix
#

in events

quartz kindle
#

then show code for events

earnest phoenix
#
const Discord = require('discord.js');
const ayarlar = require('../ayarlar.json');

var prefix = ayarlar.prefix;

module.exports = client => {
console.log('>>Oynuyor kฤฑsmฤฑ baลŸarฤฑyla gรผncellendi.');
console.log('Bot hazฤฑr ve giriลŸ yaptฤฑ รœstadฤฑm.');

    var Games = [
        
        
        `${client.users.size} Kullanฤฑcฤฑ ฤฐรงin TeลŸekkรผrler`,
        
        `${client.guilds.size} Sunucu ฤฐรงin TeลŸekkรผrler`,
       
        `!!help | 7/24๐Ÿ”ฅ | Frep`,
        
        `!!add | !!play | !!skip | !!pause | !!resume`,
    ];

    setInterval(function() {

        var random = Math.floor(Math.random()*(Games.length-0+1)+0);

        client.user.setGame(Games[random], "https://www.twitch.tv/frepturetv");
        }, 2 * 2500);

}; 

quartz kindle
#

i dont see any ready.js here

earnest phoenix
#

look

quartz kindle
#

where in your code do you use that file?

earnest phoenix
#

no

#

yes

#

my server.js

#

settings

#

everything is in FREPBOT

quartz kindle
#

yes, but where do you write require("ready.js")

earnest phoenix
#

i didnt

#

only

#

ready.js or

#

events/ready.js

quartz kindle
#

show where did you write it

earnest phoenix
#

i didnt

#

write it

quartz kindle
#

then why do you have that file?

earnest phoenix
#

require('./eventLoader')(client);

#

my codes are deleted

#

i have that

#

in server.js

quartz kindle
#

somewhere in your code, its trying to require the file ready.js

#

you have to find where it is

earnest phoenix
#

hm

#

proboblyeventloader

marble salmon
#

hi, where bots hosts?

earnest phoenix
#

leme dewlete it

grim aspen
#

what

zealous veldt
#

Check the pins in this channel if you are looking for a good hoist @marble salmon

earnest phoenix
#

@quartz kindle how ill fint it

quartz kindle
#

open all your js files

earnest phoenix
#

find*

grim aspen
#

there's a code in one of your files that has readys.js needed

earnest phoenix
#

idk

marble salmon
#

@zealous veldt ok, thx

zealous veldt
#

No problem

earnest phoenix
#

ill send the error message ss

#

maybe you can understand it

#

look

gleaming tulip
#

you are probably requiring the file in the wrong folder

earnest phoenix
#

where should i put it than

gleaming tulip
#

where do you have require("ready.js") or something like that

#

anyway, the path is wrong

idle basalt
#

it says it cant find readys.js

earnest phoenix
#

yes

#

i didnt type that

idle basalt
#

make sure its ready, not readys

earnest phoenix
#

ready

#

but

idle basalt
#

also, the path appears to be incorrect

#

send your actual code

gleaming tulip
#

should be /events/ready.jz

earnest phoenix
#

in my server.js

#

ok

gleaming tulip
#

so send server.js

idle basalt
#

oh you did above

gleaming tulip
#

and tell where it is located

earnest phoenix
#
const { Client } = require('discord.js');
const YouTube = require('simple-youtube-api');
const yt = require('ytdl-core');
const ayarlar = require('./ayarlar.json');
const client = new Client();
const Discord = require('discord.js')
const youtube = new YouTube(ayarlar.api);
require('./eventLoader')(client);

#

its not probobly

gleaming tulip
#

there's no ready.js in there

earnest phoenix
#

yep

#

im telling that

#

what should i add

gleaming tulip
#

you shouldnt add anything

quartz kindle
#

it looks like a module dependency, also the spelling is wrong lmao

idle basalt
#

what the heck is require('./eventLoader')(client)

earnest phoenix
#

idk

quartz kindle
#

what's the code for eventLoader?

idle basalt
#

so you just copy pasted this bot and have no idea whats going on

gleaming tulip
#

do you know what you are doing at least

earnest phoenix
#

no

#

its my friends

gleaming tulip
#

i see

idle basalt
#

have your friend come here /shrug

earnest phoenix
#

i copy the music part

#

from him

quartz kindle
#

do you have an eventLoader.js in your bots folder?

earnest phoenix
#

im trying to fix that

#

nope

#

i dont

idle basalt
#

well this has nothing to do with music

gleaming tulip
#

so why are you requiring it

earnest phoenix
#

does ลŸit care you

gleaming tulip
#

if you don't have that file

earnest phoenix
#

its my bot

#

require('./events/ready.js')(client);

languid dragon
#

๐Ÿค”

earnest phoenix
#

i changed that to this

languid dragon
#

what is your project structure

idle basalt
#

seems to me like youre guessing

earnest phoenix
#

js

languid dragon
#

what is your project structure ๐Ÿ˜ฉ

idle basalt
#

create an event handler (thats probably whats supposed to be in that file thats required and you dont have) and then it should probably work

#

youre just typing in random things

earnest phoenix
#

nop

quartz kindle
#

show a picture of your bot folder

earnest phoenix
gleaming tulip
#

so you have an eventLoader

earnest phoenix
#

yes

quartz kindle
#

so you do have an eventLoader lol

gleaming tulip
quartz kindle
#

you said you didnt

earnest phoenix
#

owh

#

im so sleepy

quartz kindle
#

.>

#

show eventloader

earnest phoenix
#

i think

#

it is the problem bcuz it

#

has reay

#

im sending it

gleaming tulip
#

just show eventloader

earnest phoenix
#
const reqEvent = (event) => require(`./events/${event}.js`);
module.exports = client => {
  client.on('ready', () => reqEvent('ready')(client));
};
gleaming tulip
#

that looks right

earnest phoenix
#

um

#

whats wrong than

quartz kindle
#

right click baslat.bat and click "edit"

#

and show the code

earnest phoenix
#

its

#

open the bot

#

auto type node server.js

lusty dew
#

Just show the code

grim aspen
#

we can't do that

lusty dew
#

Wdym?

grim aspen
#

open the bot

earnest phoenix
#

echo off
title Frep BOT Ana Paneli
color a
cls
:a
node server.js
node readys.js
goto a

grim aspen
#

what

earnest phoenix
#

its easy

#

it open the code auto

quartz kindle
#

node readys.js

#

theres your problem

earnest phoenix
#

ok

#

leme delete it?

lusty dew
#

If that file is in the bot dir and ran in the bot dir

#

it will run those files

earnest phoenix
#

wow

#

yess

#

thanks dude

quartz kindle
#

lul

earnest phoenix
#

so much

lusty dew
#

Ayyy
Tim

#

Just saw tim was here

earnest phoenix
#

i buy a vds

lusty dew
earnest phoenix
#

900download 600upload

#

3ms

#

i love it

lusty dew
#

Nice

#

Tim I have a question for you

#

:3

quartz kindle
#

wut

lusty dew
#

How's your day?

quartz kindle
#

its fine lul

lusty dew
#

Lel

#

Good good

#

now for the real question

#

when using Array.splice()

#

it is

#

Array.splice(Index, NumOfRemoval)

quartz kindle
#

yes

lusty dew
#

Kk

#

Thanks

broken elm
#

Forgot I could just store the output of the api in a variable and use output[0] to get info

earnest phoenix
#
@bot.event
async def on_message_delete(message):
        log = await bot.pool.fetch("SELECT * FROM logging WHERE guildid = $1", ctx.guild.id)

        if log == []:
                return
        else:
                loggingchannel = log[0]['channel']
                embed = discord.Embed(title='Message Deleted', color = discord.Color.gold(), timestamp=datetime.datetime.utcnow())
                embed.add_field(name=f"Message Deleted By: {message.author}", value=f"{message.content}")
                embed.set_footer(text='GBot')
                await bot.get_channel(loggingchannel).send(embed=embed)``` does anyone know why it won't send?
exotic badger
#

any error?

#

it probably can't find the channel

spring ember
#

@earnest phoenix you forgot to await the send()

#

At the end

earnest phoenix
#

await bot.get_channel(loggingchannel).send(embed=embed)

#

no error

earnest phoenix
#
let serv = bot.guilds.get('466241197867008011')


let trul = serv.members.get(message.author.id).roles.has('534081989758812182')``` I have a problem, if the member are not in the guild its send me ('Cannot read property of roles') and i dont know how to fix that but i cant return trul
amber fractal
#

you could limit it to that guild, or just a try/catch or a .catch()

earnest phoenix
#

i dont want to limit that in the guild, and i'm going to try with try

hushed berry
#

grab the member first and check if it exists

amber fractal
#

that too mmLol

gleaming tulip
#
let serv = bot.guilds.get('466241197867008011')

let guildmem = serv.members.get(message.author.id) 
let trul = guildmem && guildmem.roles.has('534081989758812182')```
amber fractal
#

smh

gleaming tulip
#

that won't throw an error for example

hushed berry
#

why does everyone need to shorten everything

gleaming tulip
#

pls

hushed berry
#

theyre not even called "servers" in api terminology smh

#

keep it c o n s i s t e n t

earnest phoenix
#

oh thx its worked @gleaming tulip

amber fractal
#

the better question is why the spoonfeed tho

earnest phoenix
#

idk if it is 'working' or 'worked' but thx

idle basalt
#

if the person youre getting is the author of the message then why not just do message.member and delete two lines

hushed berry
#

@idle basalt hes not getting the member from the guild the message was sent in

earnest phoenix
#

With my bot you can not open the page

lusty dew
#

๐Ÿ‘€

#

What

earnest phoenix
#

probably because it isn't approved yet...

#

And How cann Man that Approved yet?

#

be patient

#

ultimate way to get your bot approved not clickbait

#

Ok

#

Sry

zealous veldt
#

]]faq 2

covert turtleBOT
#
Frequently Asked Questions ๐Ÿ“œ

Click the link to get more information on the question:
2) How long is approval?

earnest phoenix
#

a bit confused here

grim aspen
#

i think i missed something

#

i know it's on repl.it, it's only temporary

slender thistle
#

You installed wrong d.py version

#

@earnest phoenix do you still need help with your issue?

grim aspen
#

well shit

slender thistle
#

How did you install it

grim aspen
#

well

earnest phoenix
#

Nah, i got it

grim aspen
#

i might've installed it with 0.16.12

earnest phoenix
#

thx though bb

grim aspen
#

through requirements.txt

#

ok now it works

slender thistle
spring wharf
#

How can I send a RichEmbed() with a normal text message in javascript (If you want to know what I mean just run gr!help in #commands )

#

(ping me in your response)

hushed berry
#

what lib? @spring wharf

spring wharf
#

discord.js

#
message.channel.send(`I finally have the lamb sauce, so here are your commands`); 
message.channel.send(helpEmbed); ```

Currently I am just sending two messages like this
#

oh and dont question the lamb sauce message, I just want it there because I am recreating the bot to the best of my abilities

#

Was just a joke from development of the original because before I added the help embed it just said something along the lines of "I'LL HELP YOU WHEN YOU FIND THE LAMB SAUCE FOR ME"

amber fractal
#

One of the options is RichEmbed.

spring wharf
#

Thanks ๐Ÿ˜„

amber fractal
#

๐Ÿ‘Œ

white stone
#

How do I find open source bots?

mossy vine
#

Either search on github, or find bots on the website that are open source

white stone
#

is there a way to search them - I see Github Repository link on some

#

no tags looks like

#

I think that will work for my needs ๐Ÿ˜ƒ