#development

1 messages Β· Page 464 of 1

deep inlet
#

Fine

#

Literally this

#
                }).then(rsp => {
                  [
                    "βœ…",
                    (find.permissionsOf(client.user.id).has("externalEmojis") ? ":RedTick:457860110056947712" : "❎")
                  ].concat(numbers).forEach(item => rsp.addReaction(item));
                });```
cerulean zinc
#

hmm

deep inlet
#

OwO

#

I'll try that advaith

cerulean zinc
#

What exactly are you reacting to?

deep inlet
#

Ffs Derp

#

THE CODE ISN'T THE PROBLEM

cerulean zinc
#

mmk

deep inlet
#

OH

#

@bright spear THAT WORKED

#

SEND ME 1 - 5 PLEASE

quartz kindle
#

its the same i sent you lol

cerulean zinc
quartz kindle
#

and other people as well

cerulean zinc
deep inlet
#

When did you send that?

cerulean zinc
#

You even sent it yourself

deep inlet
#

Bruh

#

There's a difference

#

If you open your eyes

#

1 is 2 characters

#

1 is 1 character

bright spear
#

btw this is how i got the one

cerulean zinc
#

\1⃣

bright spear
cerulean zinc
#

:one:

bright spear
#

then pasted it from there

deep inlet
#

Oh

#

Hm

bright spear
#

for some reason its different when you copy and paste it tho

#

just discord being weird i guess 🀷

deep inlet
#

Ye

topaz fjord
#

@bright spear isnt discord always weird

remote tide
#

in discord.js

#

How to add color like this, dont mind im a noob pls dont hate

fast marten
#

How are you currently sending?

zealous veldt
#

What library?

fast marten
#

discord.js

remote tide
#

discord.js

bright spear
#

lol

zealous veldt
#

Ok

bright spear
#

@remote tide how are you sending it currently

fast marten
#

message.channel.send({embed: { color: FF0000, description: "Embed color"}}); isnt it?

zealous veldt
#

Do you already have an embed?

#

Or if you use a RichEmbed it's setColor

knotty steeple
#

hex in js is 0x + the hex code

bright spear
#

@fast marten no it has to be a decimal color

#

oh

knotty steeple
#

yea

remote tide
bright spear
#

@remote tide that should work

knotty steeple
#

i dont use rich embeds

remote tide
#

it doesnt :((

knotty steeple
#

0xFF0000

#

this should work

remote tide
#

ok 1 sec lemme see

bright spear
#

oh

#

cyan isnt a valid color @remote tide

#

you can use one of those color names, a string with a hex code, or a decimal code

fast marten
#

Do you guys use discord.js?

bright spear
#

yes

loud salmon
#

why wouldn't an error/warning be thrown for an invalid color?

remote tide
#

oh

#

this isnt working

knotty steeple
earnest phoenix
#

You could make a random color for embed color.. πŸ‘€

remote tide
fast marten
#

Dont you need 's

remote tide
#

not working

#

oh f

#

brb

#

Yes works now

#

thanks

#

:))

fast marten
#

cool

bright spear
#

Thonk for some reason it takes fff as blue but ffffff as white

cerulean zinc
#

Any way to generate silent PCM data to fill in silence for recordings?

bright spear
#

and fyi @remote tide u can just do .setColor('ffffff') for white etc

remote tide
#

Is there a way we can record voice convors into a mp3 file?

#

Oh thank you very much

cerulean zinc
#

Record to something such as PCM, save to file, convert to mp3 via ffmpeg

remote tide
#

what is PCM

cerulean zinc
#

Audio codec

bright spear
cerulean zinc
#

@bright spear Says that, its implemented

knotty steeple
#

voice receive?

bright spear
#

you can

bright spear
#

theres just no good documnetation

cerulean zinc
#

I use master

knotty steeple
#

i use stable

bright spear
#

obv

#

ew

cerulean zinc
#

But yea, Any way to generate silent PCM data to fill in silence for recordings?

knotty steeple
#

what

#

stable is stable

#

i like stable things zoomeyes

remote tide
#

Hey can anyone give me a code that if i put in eval it tell number of bots in a server

cerulean zinc
#

m8 I usse not the public ios beta, but the developer beta

bright spear
#

waiiit a minute

cerulean zinc
#

I already scoped that

#

Nothing different

knotty steeple
#

video?

#

wot

remote tide
#

Hey can anyone give me a code that if i put in eval it tell number of bots in a server

cerulean zinc
#

Wanna know what I think the video thing is for?

knotty steeple
#

docs

bright spear
#

there are a few new commits tho

cerulean zinc
#

Wait

bright spear
earnest phoenix
#

yeah @remote tide "client.users.size;client.token;"

cerulean zinc
bright spear
#

banne

earnest phoenix
bright spear
#

experiments tab

cerulean zinc
knotty steeple
#

so bots will be able to do video shit now?

fast marten
#

That would be interesting

knotty steeple
cerulean zinc
#

Ive had this for like a month now

earnest phoenix
#

bots about to replace watch2gether&sync-video POGGERS

cerulean zinc
#

LOL

earnest phoenix
#

Wtf lol

#

rip bandwidth tho

knotty steeple
#

ikr

earnest phoenix
#

I have never seen that function

knotty steeple
#

we could make video games

#

literally

#

video

#

games

cerulean zinc
#

Anyways

#

Any way to generate silent PCM data to fill in silence for recordings? sadcatte

bright spear
#

no idea what that is lol

cerulean zinc
#

Audio data

bright spear
#

and do you use the experiments tab zoomeyes

knotty steeple
#

how would bots even "screen share"

cerulean zinc
#

Magic

knotty steeple
#

what screen do they have

cerulean zinc
#

ffmpeg

knotty steeple
#

lmfao

bright spear
#

how can they even "play games"

cerulean zinc
#

lol

frank dust
#

so could you play youtube videos????

earnest phoenix
#

nope u get banne for that

cerulean zinc
bright spear
#

music video bots whenβ„’

knotty steeple
#

wait rlly

#

sad

frank dust
#

oh the discord game store

knotty steeple
#

its only for nitro users

cerulean zinc
#

yea

knotty steeple
#

iirc

#

hecking discord

bright spear
#

oh frick

knotty steeple
#

wat

bright spear
#

staging is a thing again

#

it doesnt go to the video anymore

#

printer does tho

cerulean zinc
#

Ik

knotty steeple
#

what is that

#

staging?

bright spear
#

where they test new features

#

like store and stuff

knotty steeple
bright spear
#

but that url went to a yt vid recently

remote tide
#

this is correct? client.users.size;client.token @earnest phoenix

#

ill test brb

knotty steeple
#

that gives out ur token

remote tide
#

what i already know my token

#

i dont want token

earnest phoenix
#

u need to think @remote tide obvs not

remote tide
#

i want a code which if i put in eval gives me no of bots in a server

#

not my token

earnest phoenix
#

look at docs => "Client" => users property is a Collection => Collection has size property => put it all together

#

and GWfroggyWeSmart ez

#

^

#

._.

fast marten
#

What usage are your bots on .js?

bright spear
#

wdym

fast marten
#

Like CPU/RAM usage

earnest phoenix
#

barely any if ur not autistic

#

any1 know a nsfw api?

#

wait

#

can i ask this here

fast marten
#

danbooru/gelbooru

earnest phoenix
#

google GWfroggyWeSmart

#

i cant find

#

on google

#

all are nsfw identifiers

#

except neko

#

i dotn want neko

#

dont*

fast marten
#

I need to make an api for nsfw, I have one which gets local files but its not really good

eager spoke
#

Try the HubTraffic api 🐰

uneven depot
#

Does anyone have an idea of what the average # of members of a guild there are?

floral zinc
#

Average #?

fast marten
#

Number

floral zinc
#

Dont get it

fast marten
#

50+ at least, in any of the servers im in, even in the small ones there are quite a few

#

Hes asking the average number of members in a guild

floral zinc
#

Thats not average.. Guilds like this one proof that

fast marten
#

Yeah but there are many small guilds, thats why its 50 at least

#

its probably more 100 minimum

woeful karma
#

Can anybody help me dev a bot?

eager spoke
#

Yay

#

Also which language ?

woeful karma
#

English

loud salmon
#

he means programming language

eager spoke
#

Programming language

woeful karma
#

O

eager spoke
#

X)

woeful karma
#

Lol java?

eager spoke
#

Ok

woeful karma
#

C++ is too much lol

eager spoke
#

Which api? i personnaly use javacord

woeful karma
#

Uh

loud salmon
#

jda or riot zoomeyes

eager spoke
#

πŸ‘€

woeful karma
#

Uh javacord

eager spoke
#

Seems jda has a stronger community πŸ‘€

woeful karma
#

I havent made it yet

#

So

#

Anyone

loud salmon
#

yea, i know more people that use jda instead of javacord

woeful karma
#

Okay

#

Lets use jda

#

Its not created yet tjo

#

Tjo

#

Tho

loud salmon
#

are you at least familiar with the java language?

#

or still learning the basics

woeful karma
#

Basics

#

My dad is an it manager so hes teaching mesadcatte

loud salmon
#

you should probably finish learning the basics before making your first bot

eager spoke
#

Ohh thats nice 🐰

woeful karma
#

Okay

loud salmon
#

thats really cool btw

woeful karma
#

Lemme go do a quick review brb

#

Ty

loud salmon
#

time to quiz him with fizzbuzz

woeful karma
#

Okay im kinda back i guess zoomeyes

#

hello

#

<html>

#

Okay anyone alive to help?

loud salmon
#

what exactly do you need help with

woeful karma
#

To literally make the cmds

#

But i cant even do the first step

#

Lol

#

HeLlO

#

hElLo

loud salmon
#

what are you stuck on in the first step

woeful karma
#

I cant even start up the bot

#

I cant do the detailed desc

#

Lemme make the new bot

#

Okay now

#

The dEtAiLeD dEsC

loud salmon
#

where are you getting your instructions from

woeful karma
#

Uh

#

I went to discord bots

#

Then went ro new bot

loud salmon
#

oh

#

you already have a bot done?

woeful karma
#

And after brief desc

#

No

loud salmon
#

this is not to create a bot

woeful karma
#

what

loud salmon
#

it is to add an already created bot on a bot list

woeful karma
#

O

#

So how do create one

#

I need the website

#

Owches

loud salmon
woeful karma
#

Okay

#

Uh im on mobile

#

I cant dOwNlOaD

#

yOuR wOrSt NiGhTmArE

#

Okay

loud salmon
#

then you should do it on your computer

woeful karma
#

I cant until me dad comes home

bright spear
#

btw, you need to code it

woeful karma
#

Ik

#

I cant download either lol

bright spear
#

do you know any programming languages?

woeful karma
#

Yes

#

jAvAsCrIpT

#

yOuR wOrSt NiGhTmArE

quartz kindle
#

you said java, not javascript

#

they are totally different lol

floral zinc
#

Weird duuude

neat falcon
#

Did the set status code for discord.js change? it isn't working for me anymore

#

code: client.setActivity(`${res.body.title} by ${res.body.artist[0]}`)

quartz kindle
#
        game: {    name: 'playing xyz',    type: 0    }
    });```
#

unless you mean something else

neat falcon
#

oh

#

thanks

#

will test

#

hmm still doesn't set

quartz kindle
#

it works for me

#

djs 11.3

neat falcon
#

hmm

sick cloud
#

@neat falcon it's supposed to be client.user.setActivity(name, { type: 0/1/2/3 });

neat falcon
#

oh

#

i tried it with name and type and it didn't set

#

oh wait

#

that was presence

#

nvm

#

still doesn't seem to work

fast marten
#

Oh god a guy runs this js bot, and for the command to run (it creates an image) takes 20 seconds +

floral zinc
#

Wrong channel my dude

earnest phoenix
#

user.addRole("479774202782679041").catch(console.error);
It says "TypeError: Supplied parameter was neither a Role nor a Snowflake."
user is defined and the role ID is correct

floral zinc
#

Mhm are you certain?

sick cloud
#

Is user a GuidMember?

earnest phoenix
#

yes

sick cloud
#

Also, I'd try getting the role first, so you can check if it actually exists.

#
const role = <Message>.guild.roles.get(' i d ');
if (!role) return console.log('no role');
// add the role, etc
earnest phoenix
#

Ty @sick cloud

sick cloud
#

np

earnest phoenix
#

TypeError: msg.author.addRole is not a function

#

wth

latent willow
#

msg.member

latent heron
#

well

#

since i am using PHP and not Python

#

i'm having to make an alternative script to pass with access tokens

last rampart
#

Can someone help me create a bot that can be used to spam my server over and over again with a command

#

I've tried and it's not working

knotty steeple
#

why would you want to do that

#

and i dont think anyone would help you with that

last rampart
#

Here's what I have

earnest phoenix
#

what

#

why async funcs when no await

knotty steeple
#

thanks for the token

earnest phoenix
#

why alot of this

#

and u just shared ur token

last rampart
#

not a full toke

#

Token

knotty steeple
#

it is

earnest phoenix
#

yes it is

knotty steeple
#

it is a full token

#

lmao

last rampart
#

I deleted a few digits off the end

bright spear
#

did you have to take up the whole screen

#

really

knotty steeple
#

nah u didnt

last rampart
#

So no, not token

bright spear
#

just use a paste service

earnest phoenix
#

not even in code block

last rampart
#

And you can try it but it won't work

bright spear
knotty steeple
#

also

#

ur gonna get ratelimited

earnest phoenix
#

what that guy said

last rampart
#

Not a big deal

knotty steeple
#

it is a big deal

last rampart
#

I do t care about rate limiting

#

I'm just trying to make a bot

earnest phoenix
#

come to my dms son

knotty steeple
#

well hope your bot gets deleted GWcmeisterPeepoShrug

last rampart
#

Its my own server why does it matter

bright spear
#

because you're spamming discord

knotty steeple
#

spamming discord is bad

topaz fjord
#

@last rampart your bot will get ratelimited like a motherfucker

knotty steeple
#

does discord delete your bot if you hit the ratelimit too much πŸ‘€

#

actually what does happen

topaz fjord
#

probs api banned idk

last rampart
#

Why does it matter it's my bot on my server I can do with it what I want

topaz fjord
#

it does matter

sick cloud
#

because you'll be banned from the API

topaz fjord
#

because even if its your server

sick cloud
#

then no more bots

bright spear
#

it matters because you're spamming discord's servers

#

its not like ur hosting your server

topaz fjord
#

the messages go through the api layer

bright spear
#

all requests will hit discord

sick cloud
#

also guys how do you get the size of keys in an object?
that or how do you make an object into a collection, idk

earnest phoenix
#

Object.keys(o).length

bright spear
#

does anyone have any experience with using the firebase admin sdk in node.js with cloud firestore?

#

i keep getting Error: 7 PERMISSION_DENIED: Missing or insufficient permissions.

earnest phoenix
#

Need more info like what call are you trying to do in what structure with what permission setup etc.

bright spear
#

just trying to set a document 🀷🏾

#

im on "Add data"

#

but its not working

quartz kindle
#

did you set the service account and the json key?

bright spear
#

yeah

#
const serviceAccount = require('../FIRESTOREACCESS.json')

admin.initializeApp({
  credential: admin.credential.cert(serviceAccount)
})

const db = admin.firestore()```
quartz kindle
#

i guess the account's permissions are wrong then

#

or they key is wrong

#

otherwise idk

bright spear
#

well i made it in the IAM section of the gcp console

#

and its my account

latent heron
#

anyone know a way to make my bot restart every so # time?

#

im using python

quartz kindle
#

stackoverflow says add the database url

#
  credential: admin.credential.cert(serviceAccount),
  databaseURL: "https://<DATABASE_NAME>.firebaseio.com"
});```
latent heron
#

I could use the time.sleep method

#

but then that pauses the whole script

quartz kindle
#

im not familiar with python, but either make the script run a new instance of itself and then quit, or have an external handler to restart it automatically or on exit code

latent heron
#

just came up with another ide

#

but it would work weird

#

maybe a loop?

bright spear
#

where is the database url though

#

that seems just for the old "realtime database" not firestore

latent heron
#
while seconds < 6000:
    s = s + 1
    time.sleep(1)

if seconds >= 6000:
    s = 0
    restart()```
#

maybe something like that

quartz kindle
#

no idea, i havent actually used firebase

latent heron
#

idk

#

i just want the bot to restart to update itself every so often

#

for DBL statistics

#

and not have to manually do it

quartz kindle
#

can the script restart itself like that?

#

with restart()?

#

idk about python, but from what i know, a script cant restart itself without calling an external function to do it after it quits

viral meadow
#

@quartz kindle im in

quartz kindle
#

so you guys wanna make a bot?

#

first step is to pick a programming language

viral meadow
#

We used discord applications

bright spear
#

to make a bot you need to write code

viral meadow
#

or do we need to use the discord bot maker ?

bright spear
#

no

#

use code

quartz kindle
#

^

#

pick a programming language

#

if you dont know any, chose one and start learning

#

good languages for starters are javascript and python

viral meadow
#

No special programs like the discord bot maker on steam?

quartz kindle
#

honestly they are severely limited in what they can do, and they severely limit your own abilities as well

#

no good bot was ever made with the bot maker

viral meadow
#

ok so it would be better to make it from scratch?

quartz kindle
#

yes

viral meadow
#

what would you recommend for mac?

quartz kindle
#

technically you're not making anything totally from scratch, because there are countless libraries that you can use

#

such as a discord library which provides an easy to use programming interface to connect to discord

#

so there are many things that are already done and free for you to use

#

but you still need to write the bot logic from scratch

#

what it should do to messages and how to reply, etc

#

consider this an time investment into a new skill

#

what kind of skill would you be more interested in?

#

javascript is great for web programming, interfaces, apps, etc

#

python is more geared towards offline applications

#

there are countless other languages out there to chose from

#

i cant make that decision for you, although i myself work with javascript

west raptor
#

The language you choose is down to personal preference

quartz kindle
#

exactly

#

in case of no preference, chose something that has prominence in a field you would be interested in

slim bane
#

Hello. Sorry if I'm interrupting something, but I've been wanting to make a bot that has a command to get the invite link to a random server, from discordbots.org/servers or anything else, and I was wondering if this is possible. I have experience with bots, so I don't need help with the bot itself, but just with fetching a random server invite.

latent heron
#

probably but i cant think of an easy way to do it

quartz kindle
#

use an api if one exists, else scrape the page

latent heron
#

^

#

scraping the page would do it

#

just make a random ID generator and make it input a website link

#

and then get the HTML content of the tag for joining servers

slim bane
#

But wouldn't that only get the invites from that page? So that you'd keep getting the same few invites.

latent heron
#

not if you use a random number generator

#

and then get the HTML content

quartz kindle
#

well, that way you're gonna get 404 99% of the time

latent heron
#

πŸ€”

slim bane
#

Yeah. πŸ€”

latent heron
#

make a page checker function then

#

to check if it does not have keyword "404" in the HTML

#

then you can just make it re-make the random number again

#

and loop it until one is found

#

and then posts

slim bane
#

It would have to make a ton of requests for each server.

quartz kindle
#

you can do this

latent heron
#

like i said

#

i cant think of an easy way to do it

#

it wouldn't be simple

quartz kindle
#

https://discordbots.org/search?q=RANDOMSEARCH&page=RANDOMPAGE

#

and pick one from that

#

Lol

latent heron
#

no

#

he just wants a random server

#

putting search fields will bias the search

quartz kindle
#

make an empty search

latent heron
#

the only true way to probably get a random server is by inputting a random number for the server

quartz kindle
#

or a random character

latent heron
#

it won't be random then

#

ik it sounds weird

#

but you have probably got to do it with numbers

quartz kindle
#

here

#

https://discordbots.org/servers/list/top?page=randompagenumber

latent heron
#

there

#

that'll probably work

quartz kindle
#

of course there's still a risk of going out of bounds

latent heron
#

the only hard part to it is going to check the HTML code for the discord server invite

#

i think

slim bane
#

Ooh, that might work.

quartz kindle
#

thats not hard

latent heron
#

you'll have to obviously add some rules to it

slim bane
#

Yeah, that's not hard.

latent heron
#

to check for things

#

it is when you're dealing with thousands of servers

quartz kindle
#

you can get jquery for node and parse the html response into jquery objects

#

and use jquery to navigate it

#

lmao

latent heron
#

finding a way to do it efficiently is a problem also

#

ew

#

well

#

it depends on what lang the bot is even in

#

to determine whether or not it can do some website check

quartz kindle
#

there are html parsers for pretty much everything

#

its easier than using regex for example

#

but you can always stick with regex

latent heron
#

im not talking about html parsers

slim bane
#

Ew jquery.

latent heron
#

im talking about the programming languaue the bot is in

slim bane
#

I know how to get it from the page. I just didn't know how to get a random page.

latent heron
#

make a random number generator

quartz kindle
#

thats what im saying

latent heron
#

it literally is that simple

slim bane
#

It looks like the top servers goes up to 75.

quartz kindle
#

there are html parsers for many programming languages

slim bane
#

Nevermind.

latent heron
#

in python it is as simple as this:

import random
print(random.randint(0,100))```
slim bane
#

I assume it changes.

#

Yeah.

latent heron
#

just make it a variable

slim bane
#

Well thank you guys. πŸ˜„

#

I know discordbots.org has an API. But that doesn't let you fetch servers I assume, right?

latent heron
#

idk check

#

you'd be surprised on what you can find on the internet

quartz kindle
#

i found a way to get over 300 pages

#

https://discordbots.org/servers/search?q=%20&page=300

latent heron
#

I know that Discord has an API to check guilds on discord

#

but you need to understand OAuth2 and searching with HTTP post requests

slim bane
#

That's even better, Tim!

latent heron
#

i am using oauth2 to make a login system for my website

#

but it is painful

slim bane
#

Goes up to 348.

#

Thank you. πŸ˜„

swift minnow
#

hello

quartz kindle
#

this goes until 381 lol
https://discordbots.org/servers/search?q=a&page=381

sick cloud
topaz fjord
#

what about the regular bots Tim

swift minnow
#

yes?

quartz kindle
#

how many pages in the bots section?

topaz fjord
#

ye

quartz kindle
#

203 using %20

#

https://discordbots.org/search?q=%20&page=203

#

way less using a

slim bane
#

I'll make it get random bots too. πŸ˜„

quartz kindle
#

free advertising :3

slim bane
#

Lol.

gleaming glen
outer niche
#

Me and @viral meadow need help

gleaming glen
#

i have a image uploading thing but i dunno how to open a subdomain

bright spear
#

@gleaming glen just add a dns record for that subdomain

outer niche
#

@gleaming glen me and @viral meadow need help

gleaming glen
#

he answered me thonkku

earnest phoenix
#

@outer niche and @viral meadow need help with the bot invite link in the developer portal

bright spear
#

@outer niche whats the problem

#

do you still not know how to make a bot

viral meadow
#

We cant get the bot to work in the server it keeps saying that you need a code grant

bright spear
#

turn require code grant off in the application page in the dev portal

outer niche
#

Ok

quartz kindle
#

inb4 "why is my bot offline"

bright spear
slim bane
#

Got it working. Fetches a random server or a random server by query. πŸ˜„

#

It takes like 3-5 seconds, but will probably be faster on a VPS rather than my shiternet.

earnest phoenix
#

using API or scraping wtih cheerio or something?

slim bane
#

Scraping.

slate kayak
#

hello all any good addond that corrects codes in visual code ?

lament meteor
#

idk

slate kayak
#

andbody that can help me with a problem please

earnest phoenix
#

you have to kinda do it yourself dude

#

ik it might be hard but you will get through it GWfroggyPepoThumb

#

anyone know the function to set client username

fast marten
#

What library?

sick cloud
#

@earnest phoenix what lib? mind you, you can set your bots username from the dev dashboard now, and also you can only change it twice an hour, be careful

earnest phoenix
#

I have set the username

#

now I just need someone to reset the nickname

sick cloud
#

you can set the nickname to null

earnest phoenix
#

but the bot can't set its own username since it doesn't have admin

fast marten
#

I didn't think you need admin for changing username?

earnest phoenix
#

the bot doesn't have any perms

ruby dust
#

It just needs permission to change nickname facepalm

sick cloud
#

change nickname

restive panther
#

We have to wait a long time before the bot gets validated?

knotty steeple
#

validated?

restive panther
#

on the website

knotty steeple
#

depends

#

on how much bots in queue

restive panther
#

ok

#

a month ????!!!!

#

😭

knotty steeple
ruby dust
#

yes, let them think it's a month

heavy burrow
#

lol

neon swift
#

You could probably get the average using the #logs
Shouldn't be more than 2 days actually

floral zinc
#

Wrong channel ay

nimble star
#
    ##----EVENT ON MEMBER JOIN----##
    async def on_member_join(self, member):
        with open("../DSB_Files/welcome.json") as file:
            weldict = json.load(file)
        if str(member.guild.id) in weldict:
            if member.guild.id == 475902932190101504:
                await member.add_roles(id=475931350491332618, reason="Member joined us!")
            channelID = int(weldict[str(member.guild.id)]["chID"])
            channel = self.bot.get_channel(channelID)
            msg = weldict[str(member.guild.id)]["msg"]
            if "{USERNAME}" in msg:
                msg = msg.replace("{USERNAME}", member.display_name)
            if "{USERID}" in msg:
                msg = msg.replace("{USERID}", str(member.id))
            if "{MENTION}" in msg:
                msg = msg.replace("{MENTION}", f"<@{member.id}>")
            if "{SRVNAME}" in msg:
                msg = msg.replace("{SRVNAME}", member.guild.name)
            if "{SRVID}" in msg:
                msg = msg.replace("{SRVID}", str(member.guild.id))
            if "{SRVCOUNT}" in msg:
                msg = msg.replace("{SRVCOUNT}", str(len(member.guild.members)))
            embed_welcome = discord.Embed(title=f"Welcome to {member.guild.name}!", description=msg, color=0x00FF00)
            embed_welcome.set_image(url=member.avatar_url)
            embed_welcome.set_footer(text=f"You are our member #{len(member.guild.members)} !")
            await channel.send(embed=embed_welcome)```

``add_roles`` - I don't know how to use it. It asks for an ID but when I give it one it rejects it, and it also doesn't have an "ID" argument.
#

Any Python experienced able to help me?

quasi marsh
#

Actually add_roles requires a role object

#

You can get one like this

nimble star
#

How do I get the role object? I just need to know how to get it.

quasi marsh
#
role = discord.utils.get(member.guild.roles, id=45234534254523453)
nimble star
#

let me try it out, thanks!

#

thanks a lot Auxim, it works!

quasi marsh
#

np

grizzled isle
#

So if I know java, would learning C, C# and C++ be easier?

gilded blaze
#

Not really. Just the concept of Object Orientated programming

grizzled isle
#

Ah okay.

inner jewel
#

c# would be easier

#

C isn't even OOP

#

C++ is a whole different world

earnest phoenix
#

how do I tell someone that the 2nd part is missing in a kick I've got the user but idk how to do the reason
if (!args[0]) return msg.channel.send("Hmmm, looks like you didn't tell me someone to kick!")

pale marsh
#

if (!args[1]) I would assume

#

Might be wrong

topaz fjord
#

args[0] is the first part

#

args[1] would be the second part

earnest phoenix
pale marsh
#

Show us your full code

#

Also this is js?

earnest phoenix
#
    let member = msg.mentions.members.first();
    let reason = msg.content.split(" ").slice(2).join(' ');
    let mod = msg.author.username
    let args = msg.content.split(" ").slice(1).join(' ');
    if (!msg.member.hasPermission('KICK_MEMBERS')) return msg.channel.send(`You don't have permission to run this command!\nMissing Permissions: \`KICK_MEMBERS\``)
    if (!msg.guild.me.hasPermission('KICK_MEMBERS')) return msg.channel.send(`I don't have permission to run this command!\nMissing Permissions: \`KICK_MEMBERS\``)
    if (!args[0]) return msg.channel.send("Hmmm, looks like you didn't tell me someone to kick! Notice: Please make sure the bot is a higher role then the user you're trying to kick or it will not work!")
    if (!args[1]) return msg.channel.send("Hmmm, looks like you didn't tell me a reason to kick that user! Notice: Please make sure the bot is a higher role then the user you're trying to kick or it will not work!")
    member.kick(reason)
    msg.channel.send(`Lewd hell kick!\nUser ${member}\nWas kicked for ${reason}\nBy moderator ${mod}`)
  },```
#

yes @pale marsh

pale marsh
#

Oh

#

Replace it with if (!reason)

#

Also why did you join the array and assign it to args anyway?

earnest phoenix
#

my bot is weird like that i name some of the names I use are random af

#

ty @pale marsh

pale marsh
#

No problem

earnest phoenix
#

how can i download wav audio?

#

would that be bestaudio[container=wav]

#

?

sick cloud
#

why wav

#

and what lang/lib/things are you using

earnest phoenix
#

python

#

@sick cloud i got it

#

aaaaaaaaaa

#

file size is 100mb

#

dude

#

i'm losing my nmind

sick cloud
#

lol

quiet bobcat
#

How can I get a user object from a mention in JDA?

topaz fjord
#

jonas in jda

#

owo

quiet bobcat
#

yeah

#

it's not going so well though

sick cloud
#

gl buddy

quiet bobcat
#

thanks

quartz kindle
#

why would you use wav files, are you an audiophile?

#

if mp3-320/aac is not enough, at least go for flac

sour perch
#

how do you make a bot use custom emojis

earnest phoenix
#

my bot is advertised as HQ music

#

so of i would want the best

quasi marsh
#

If you type a \ in front of the emoji name it will show it in it's raw form

earnest phoenix
#

which is better m4a or webm?

quasi marsh
#

If you send that, and the bot has as server with the emoji, it will work if you just send that text

#

Isn't m4a for audio?

earnest phoenix
#

yeah

quasi marsh
#

Webm is video too tho

sour perch
#

well is there a way to do botwide emojis?

quasi marsh
#

Technically I think Flac would be one of the best

earnest phoenix
#

i'm talking about audio tho

quasi marsh
#

@sour perch Bot's have Nitro essentially

#

As long as the bot is in a server, it can use all of it's emotes

earnest phoenix
#

after effects it self doesnt support flac

sour perch
#

how do i add an emoji then?

earnest phoenix
#

i need help downloading flac then

sour perch
quasi marsh
#

If you are in a server with the bot, just add an emoji and type a \ in front of it

#

So oliy will look like !oliy

#

So you just send everything between <>

#

And you golden

#

Just curious, do you play from your own library or just get from YouTube

sour perch
#

hm, ok thanks

inner jewel
#

@quiet bobcat a mention as in "<@id>"?

#

or from a message?

quiet bobcat
#

like @quiet bobcat

inner jewel
#

but like

#

do you want to get it from the Message object?

#

or from eg args[n]

quiet bobcat
#

yeah from the message object

inner jewel
#

Message#getMentionedUsers()

quiet bobcat
#

or actually from args

inner jewel
#

could use regex to extract user id and JDA#getUserById

#
JDA#getUserById(args[n].replaceAll("(?:<@!?)(\\d{17,21})(?:>)", "$1"))```
#

error handling ommitted

earnest phoenix
#

help me

#

download flac

#

would
delay(Num)
work as like wait

quiet bobcat
#

alright @inner jewel

#

thanks

earnest phoenix
#

@quiet bobcat why people ignore me, is that because I'm wearing in blue?

quiet bobcat
sour perch
#

@quasi marsh (sorry for tag if its bad) i looked into the emoji thing you explained earlier, and i dont get it to work, im making the bot send the emoji like you explained, but all it sends is the name of the emoji not the emoji itself

quasi marsh
#

It needs to be in the server with the emoji

sour perch
#

yes the bot is in the server

#

so the emoji isnt botwide?

bright spear
#

it is

floral zinc
#

It needs permission "Use external emojis"

earnest phoenix
#

...

knotty steeple
#

How would i go by finding the first channel in a server/guild which my bot has the Send Messages permission?

night imp
#

Loop over guild.channels and check if you have permission to send message

knotty steeple
#

how would i go by doing that GWqlabsThonkery

ruby dust
#

try to send the message, catch if failed and move to the next channel

night imp
#

Or just check perms

#

var stop = false
guild.channels.forEach((channel)=>if(stop) return else if(can send message) send + stop = true

#

some pseudo code

uncut slate
#

guild.channels.find(channel => channel.permissionsFor(bot).has('send messages'))

earnest phoenix
#

help me please how do i donwload flac from youtube

uncut slate
#

youtube doesn't serve flacs

earnest phoenix
#

against youtube ToS

#

@uncut slate you sure? cause i heard they do

uncut slate
#

even if they did - like railrunner said, against their ToS

earnest phoenix
#

so what do they support?

#

webm , m4a

#

what about wav? can i download wave?

#

no AGAINST TOS

uncut slate
#

the format doesn't matter, it's against their ToS

earnest phoenix
#

what ever i need help

#

i agree on taking the risk

#

we don't

uncut slate
#

we're not going to help you with something like that

earnest phoenix
#

please

knotty steeple
#

what about those websites that give you a download to any youtube video with a link

uncut slate
#

those are against their ToS as well

knotty steeple
#

oh

#

shit

#

im fucked

uncut slate
#

anyways, this is getting offtopic

earnest phoenix
#

anyone want to talk the risk?

#

take

#

i mean look you dont take risks i do

uncut slate
#

I'd suggest stopping before you get muted

earnest phoenix
#

@uncut slate what rule did i break?

uncut slate
#

1, 3 and 8

night imp
#

yt video download is against their tos

#

but everyone does it pretty much (not condoning at all)

#

we can't help you but youtube isn't going to take you to court for it

knotty steeple
#

my web browser can download any media from a website

slim heart
#

discord.js Okay this might be out of any kind of like possibility, but is there a way to make the bot like reread a json file instead of completely having to restart if that makes sense? almost like a mysql server i guess where its a live edit and it query's a new result instead of setting a, well, set result based on a file

knotty steeple
#

delete cache

#

then read the file

slim heart
#

How.?

#

Any guide

knotty steeple
#

delete require.cache[require.resolve('./file.js')]

#

part of how i reload a command

uncut slate
#

requiring at runtime is a horrible practice

earnest phoenix
#

so what all the people

slim heart
#

thats all i have to do samurai

earnest phoenix
#

who made music bots

#

are dead?

night imp
#

no they just break the tos and youtube doesn't do anything

uncut slate
#

streaming the files is grey area but technically against ToS as well - downloading them is something we absolutely do not condone

earnest phoenix
#

@night imp what would the worst thing happen?

night imp
#

the Earth would be hit be a meteor

#

all they would do is revoke your key

#

they wouldn't go out of the way to sue someone for having a discord bot that doesn't make money

earnest phoenix
#

it doesnt make money from the songs tho

#

people donate

slim heart
earnest phoenix
#

think about it this way

night imp
#

yeah that's what Im saying rythm does it you should be fine

#

if you get it revoked then stop doing it

sick cloud
#

why use another npm module when you can just do it natively

night imp
#

we just won't help you

slim heart
#

Idk how to do it natively

#

Imma be honest

#

Is that all i have to do samurai?

knotty steeple
#

pretty much yea

slim heart
#

"pretty much"

knotty steeple
#

no need for a npm package if you can just use the piece of code i sent @slim heart

sick cloud
#

database

#

discord is crapping itself

#

just use a real database

slim heart
#

it didnt work samurai

earnest phoenix
#

here might be the actual problem i'm having. i checked my error monitoring:

SyntaxError: await is only valid in async function
1
at createScript (vm.js line 80 col 10)
2
at Object.runInThisContext (vm.js line 139 col 10)
3
at Module._compile (module.js line 616 col 28)
4
at Object.Module._extensions..js (module.js line 663 col 10)
5
at Module.load (module.js line 565 col 32)
6
at tryModuleLoad (module.js line 505 col 12)
7
at Function.Module._load (module.js line 497 col 3)
8
at Module.require (module.js line 596 col 17)
9
at require (internal/module.js line 11 col 18)
10
at files.forEach.file (/home/node/mini-me-stable/server.js line 32 col 19)
const event = require(`./events/${file}`)
slim heart
#

I just used the npm package words perfectly

knotty steeple
#

well

#

await is only usable in an async function

#

remove the await

earnest phoenix
#

m4a audio only DASH audio 58k , m4a_dash container, mp4a.40.5@ 48k (22050Hz), 61.24MiB
webm audio only DASH audio 71k , opus @ 50k, 73.99MiB
webm audio only DASH audio 88k , opus @ 70k, 99.75MiB
webm audio only DASH audio 106k , vorbis@128k, 117.72MiB
m4a audio only DASH audio 138k , m4a_dash container, mp4a.40.2@128k (44100Hz), 163.54MiB
webm audio only DASH audio 165k , opus @160k, 191.39MiB

#

which is the best one?

devout raven
#

Hmm can i create handler for help?

earnest phoenix
#

quality wise

devout raven
#

./help/${file}.js

earnest phoenix
#

i care about quality

quartz kindle
#

the last one has the highest bit rate

#

but idk about opus vs m4a compression

#

you might wanna google that

earnest phoenix
#

yeah thats why i'm asking

#

google is useless

#

i spent 30 minutes to 1 hour

quartz kindle
#

its not

earnest phoenix
#

and didnt get an answer

quartz kindle
#

mp4a = aac

zealous veldt
#

woah

earnest phoenix
#

you sure m4a = aac?

quartz kindle
#

learn2googleβ„’

earnest phoenix
#

mmmm

quartz kindle
zealous veldt
#

o damn

earnest phoenix
#

thanks homie @quartz kindle

#

saved the day

zealous veldt
#

Tim always saves the day

quartz kindle
#

im just good at google

zealous veldt
#

I'm good at bing Bong asking other people to google for me

earnest phoenix
#

How do I make the logo go up and down like that?

#

like equalzier and many more bots did

bright spear
#

css magic

earnest phoenix
#

yes i know it's css

bright spear
#
.bot-img img {
    -webkit-animation: mover 1.5s infinite alternate;
    animation: mover 1.5s infinite alternate;
    -webkit-animation-timing-function: ease-in-out;
    animation-timing-function: ease-in-out;
    -webkit-animation-iteration-count: infinite;
    animation-iteration-count: infinite;
}```
#

just check devtools

earnest phoenix
#

ty

bright spear
#

oh looks like u need this too ```css
@-webkit-keyframes mover {
0% { transform: translateY(0); }
100% { transform: translateY(-20px); }
}

@keyframes mover {
0% { transform: translateY(0); }
100% { transform: translateY(-20px); }
}```

earnest phoenix
#

thanks

bright spear
#
.bot-img {
    box-shadow: none !important;
}
earnest phoenix
#

that doesn't work

bright spear
#

oh this css #bot-details-page .bot-img { box-shadow: none !important; }

ember flame
#

I just noticed that my bot has n/a for how many servers it is in on the website. Is there something code wise that i need to add to my bot?

austere meadow
#

you need to post your server count manually to DBL’s api

#

you can either check the API docs on the website or use the dblapi module

ember flame
#

Thanks!

earnest phoenix
#

Can i get some help with php?

#

And mysqli

#

For some reason I'm not being able to execute certain queries

#

I've googled the issue but none of the solutions work for me

#

I'm getting an sql syntax error

solid cliff
#

Sho query

earnest phoenix
#

$sql = "SELECT * from myTable WHERE name = $name;";

#

$name is a variable that fetches a url parameter

#

I did an echo($name) and it shows correctly

#

Mysqli says it's an sql syntax error

#

When i use numbers as a url parameter it works though

#

I think it has to do with space characters

quartz kindle
#

use prepared statements

earnest phoenix
#

Do you think can could be the issue here?

quartz kindle
#

sql is iffy with concatenating variables, it doesnt always work to put the variable directly in there

#

besides, prepared statements are pretty much a must, to avoid sql injection

earnest phoenix
#

Btw when i type in a single word it says "unknown column "name"

#

I'll check that then

quartz kindle
#

idk about msqli since i use PDO, but it should be similar

earnest phoenix
#

I'm just using mysqli_query($conn, $sql)

quartz kindle
#

example

earnest phoenix
#

Since I'm a newbie to php and mysqli

quartz kindle
#
$stmt->bindParam(':firstname', $firstname);
$stmt->bindParam(':lastname', $lastname);
$stmt->bindParam(':email', $email);
$stmt->execute();```
earnest phoenix
#

Thanks I'll definitely check that out

#

I've been trying to fix this for almost an hour

quartz kindle
#

what this does, is that it prevents the variable from tampering with the sql execution string

earnest phoenix
#

I'll probably read some documentation about it

quartz kindle
#

if someone attempts sql injection, it will be treated strictly as a value and not modify the sql string into executing something arbitrary

earnest phoenix
#

100% sql injection proof?

#

Or not quite?

quartz kindle
#

from an sql standpoint yes

#

the php script itself can have extra protection as well by using filters

#

example

#

instead of $_GET['variable']

#

$var = filter_input(INPUT_GET, 'variable', FILTER_DEFAULT )

earnest phoenix
#

What's the difference there?

#

"); DROP TABLE MyGuests; -- GWfroggyWeSmart

quartz kindle
#

filter input has many filters to chose from, default being removing any potential dangerous characters

#

there are specific filters for other things

earnest phoenix
#

That's useful

quartz kindle
#

example

#
$search_url = filter_input(INPUT_GET, 'search', FILTER_SANITIZE_ENCODED);```
#

also validation filters, like FILTER_VALIDATE_EMAIL

#

which is extremely useful

earnest phoenix
#

I can see myself using those

#

How would I pull all text from a page?

#

(NodeJS)

zealous veldt
#

Woah PHP

#

Scary

#

@earnest phoenix look into a module called cheerio

#

Correct me if I'm wrong but I think thats the name

quartz kindle
#

you can do it without modules

#

but yeah cheerio is one of them

earnest phoenix
#

@quartz kindle care to help? Modules are kinda ------ up.

zealous veldt
#

Yes but it's a proven fact that the more modules you have the better the product is lafrKappa

#

You don't need to censor yourself btw

earnest phoenix
quartz kindle
#

if you already have an http module such as request, node-fetch, snekfetch, etc... use those

#

else use node-http

viscid falcon
#

is there a way to keep our bot from crashing when it runs into errors?

earnest phoenix
#

@viscid falcon dont make it run into errors

zealous veldt
#

The fuck?

viscid falcon
#

thanks charles, that helps a lot

earnest phoenix
#

nah u can use a .catch(() => {

#

catching them or listening for the event @viscid falcon

quartz kindle
#

there's no way to catch ALL errors, you need to have a catch function for everything that can result in an error

#

thats part of being a developer, catch errors over and over again until very few or none are left uncatched

viscid falcon
#

and anyone know any good api for getting roasts?

#

google just gives me a bunch of stuff about a coffe one

zealous veldt
#

process.on('uncaughtException'... And 'unhandledPromiseRejection'... And my amazing

earnest phoenix
#

@quartz kindle So how should I do it without a module?

zealous veldt
#

Why are you requiring modules multiple times tho

earnest phoenix
#

it was a joke xd

zealous veldt
#

O

quartz kindle
#

with node http

zealous veldt
#

Thank god lol

earnest phoenix
#

o

#

this is well

#

alot

zealous veldt
#

Pepe != Minion shit

#

Pls fix

earnest phoenix
#

no u

zealous veldt
earnest phoenix
#

sssssGWvertiPeepoUpset

zealous veldt
quartz kindle
#

@earnest phoenix basically what you need is

#

https.get('https://encrypted.google.com/', (res) => {
  console.log('statusCode:', res.statusCode);
  console.log('headers:', res.headers);

  res.on('end', (d) => {
    // d = response buffer
  });```
earnest phoenix
#

Hmmm

quartz kindle
#

actually, i dont even think you need on end

#

anyways just console.log res

#

and see what it contains

#

the body is somewhere in there

#

this should help you out

earnest phoenix
#

hnnn

earnest phoenix
#

```}).catch((err) => {return Promise.reject([BOT]: Proxy error.)});
^

TypeError: Cannot read property 'catch' of undefined
at Object.<anonymous> (C:\Users\charl\Desktop\robloxapi\index.js:9:3)
at Module._compile (module.js:643:30)
at Object.Module._extensions..js (module.js:654:10)
at Module.load (module.js:556:32)
at tryModuleLoad (module.js:499:12)
at Function.Module._load (module.js:491:3)
at Function.Module.runMain (module.js:684:10)
at startup (bootstrap_node.js:187:16)
at bootstrap_node.js:608:3

#

Whats the issue? It works with my other errors.

quartz kindle
#

whatever is before the catch is wrong

earnest phoenix
#

Wait wait

#
(node:14384) [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.```
#
  host: `178.128.239.65`,
  port: `8080`
});```
#

its a proxy thingr

quartz kindle
#

you're using `

#

instead of '

earnest phoenix
#

Same error, still no.

#

globalTunnel.initialize({
host: '178.128.239.65',
port: '8080'
});

quartz kindle
#

then idk, check the docs for global tunnel

#

are you sure the error is on that line?

earnest phoenix
#

yes

#

oh i got it

#

i think

#

@quartz kindle How would I get page content with the thing you gave me earlier?

quartz kindle
#

read the links i gave you

#

and experiment

earnest phoenix
#

@quartz kindle I read it all the way through and have experimented for a bit

#

no mention of page text

#

So I have the css thing where the bot logo goes up and down

#

how do I make it so when it goes up it doesn't cut off

#

if that makes sense

#

probably overflow:visible;

earnest phoenix
#

SqliteError: database disk image is malformed

clever sandal
#

I feel stupid for asking this, but what's the URL for posting to the Discord API?

gilded blaze
#

What are you trying to do?

zealous veldt
earnest phoenix
#

ytsearch:boop @zealous veldt

#

or scsearch:

zealous veldt
#

@earnest phoenix what do you mean?

earnest phoenix
#

the identifier should start with "ytsearch" or "scsearch" if you want to search youtube or soundcloud

zealous veldt
#

oh, ok, thanks

earnest phoenix
#

πŸ‘

zealous veldt
#

oh awsome, thanks

#

πŸ˜ƒ

earnest phoenix
#

<@&265158261945270273> sorry. My mistake. That was my code. "YOUR BOT WAS HACKED!!!" - that's from me.

spring ember
#

Ooof

earnest phoenix
#

(((((((

#

I'm so sorry

#

I want to bring back my bot

#

Tomori

burnt raven
#

How do I fix my bot?

spring ember
#

What is the problem with your bot

burnt raven
#

Doesn't run

spring ember
#

Errors?

burnt raven
#

I .gitignore'd date

#

data*

#

Because it's showing my bot token.

#

It doesn't work.

spring ember
#

Just make a config file

burnt raven
#

How?

#

I'm kinda new to bot making.

spring ember
#

Json

#

Do you code in js?

burnt raven
#

Yes/

spring ember
#

Then it is very easy

burnt raven
#

I'm also new to coding

spring ember
#

Just make a json file with token as key and the token as value

burnt raven
spring ember
#

Wait

burnt raven
#

My key is inside settings.