#development

1 messages · Page 760 of 1

twilit rapids
#

Live streams

earnest phoenix
#

yes

twilit rapids
#

Also the custom settings LL has?

earnest phoenix
#

what custom settings

#

if you're thinking of equalizer

twilit rapids
#

For example

earnest phoenix
#

that is audio manipulation, yes

uncut edge
#

This is interresting

#

i was never able to get live streams to sound good

twilit rapids
#

soundcloud search function

#

youtube playlists support

earnest phoenix
#

i didn't need soundcloud in my case but i could implement it if i wanted to

#

playlist support is there

twilit rapids
#

And how would you deal with YouTube now banning IPv4 and IPv6

earnest phoenix
#

don't know, i stopped working on the bot way long before the banning was implemented

#

though my guess would be ip proxying

twilit rapids
#

I guess I could go on with this for a while, not sure if both of us want that lol

earnest phoenix
#

i was never able to get live streams to sound good
neither did i when i piped the stream straight through the encoder, then i was like oh lets try a buffered stream and it worked, the bot was a bit behind realtime but the sound quality was crisp since i actually had more data to work with

twilit rapids
#

Would you like that I continue with things that LL has

uncut edge
#

Nice

earnest phoenix
#

timo

#

i don't get what's the point of this

twilit rapids
#

Neither do i at this point

earnest phoenix
#

i implemented almost everything lavalink has and cut the resource usage in half

uncut edge
#

O

earnest phoenix
#

the code uses lavalink-styled objects though

uncut edge
#

u said lavalink is wack

earnest phoenix
twilit rapids
#

But is the quality as good as LL

earnest phoenix
#

yes

#

crisp

uncut edge
#

Ok

earnest phoenix
#

af

modest maple
#

meanwhile in the non music bot area

i have completely forgotten the basics of async now F

twilit rapids
#

Rip

earnest phoenix
#

also a fun fact, using native players you remove the need for a lot of async code

#

since you don't need to make a request to a webserver

uncut edge
#

Is it better to have a seperate bot for music only?

modest maple
#

not rlly

uncut edge
#

or it dont matter?

modest maple
#

no point

earnest phoenix
#

it depends

#

does your bot do other stuff? are they intensive features?

twilit rapids
#

tbf, asyncing code is not a big deal

earnest phoenix
#

it adds overhead to the cpu

#

though

uncut edge
#

idk moderation and some utility commands

earnest phoenix
#

async is not implemented the same in all languages

#

so

uncut edge
#

its in djs

earnest phoenix
#

can't speak for all

modest maple
#

tbf i go away from async on most of my code

#

mostly towards threading

#

cuz some blocking code just doesnt run well with async even in run in executor

#

RuntimeWarning: coroutine 'ThreadWatch' was never awaited

#

await Loop.run_in_executor(None, ThreadWatch)

#

REEEEEEE

#

i have forgotten event loops completetly

errant swallow
#

im so confused? i added my bot here but the client.on('guildCreate' thing didnt execute

#

it works on all other servers

#

okay nevermind that

modest maple
#

its not added yet

errant swallow
#

its not? okay thank god

#

sorry im unnecessarily nervous

#

wow the second i tried to see if something is wrong the entire bot crashes

#

thats a good sign isnt it

modest maple
#

dw about it

#

luca will DM you if its approved and added

errant swallow
#

oh no i meant, i submitted the bot, so it should be added to this server
so it said in #logs

#

but my bot didnt register that

#

i think i fixed it now doe

earnest phoenix
#

sorry for the trouble again but for the level command i want to add a means to store peoples, usernames, ids and their level and xp so if needed they can be modified. i have a database installed called sqlite3 but im not sure how to use it, could anyone help?

errant swallow
#

are you using discord.js?

modest maple
#

@errant swallow that just means its in queue for review

#

its not yet added

errant swallow
#

ohhh okay

earnest phoenix
#

yeah well discord or node

#

probably both?

modest maple
#

wdym

errant swallow
#

in that case i would recommend you reading about enmap

#

enmap is a pretty easy to use database manager or smth

earnest phoenix
#

ok but as for to make it do what i need how would i set that up?

errant swallow
#

okay, so first of all you would need to install enmap through node, that would be npm install enmap in your project folder

earnest phoenix
#

im gonna need all the help i can get 😅

mossy vine
#

enmap is extremely limited

earnest phoenix
#

hm?

errant swallow
#

but for such a simple use its enough

mossy vine
#

isnt it that one "database" that can only store strings

earnest phoenix
#

sqlite?

errant swallow
#

no

earnest phoenix
#

wait so what should i use?

errant swallow
#

https://enmap.evie.dev/
@earnest phoenix i recommend you take a look at this

mossy vine
#

right its just a wrapper for sqlite3

errant swallow
#

yeah

mossy vine
#

for easier use

errant swallow
#

i cant stand working with sqlit3 directly

earnest phoenix
#

oh wait no i cant use enmap

errant swallow
#

whys that?

earnest phoenix
#

it says it doesnt work on heroku

errant swallow
#

oh youre on heroku

mossy vine
#

check out mongodb atlas

earnest phoenix
#

my bot is powered by heroku

mossy vine
#

essentially its a cloud hosted mongodb instance

errant swallow
#

in that case setting up a persistant database is gonna be hard

earnest phoenix
#

i got my stuff on github

errant swallow
#

i cant help you, idk shit about heroku

earnest phoenix
#

but heroku keeps it all online and whatnot

mossy vine
#

@errant swallow heroku cant write files iirc so its impossible

errant swallow
#

yeah, i read that

mossy vine
#

unless your database is hosted elsewhere

#

like what mongodb atlas offers

errant swallow
#

thank god im just hosting my bot on a pi

earnest phoenix
#

so i should use mongodb

mossy vine
#

well

#

im sure there are other options

earnest phoenix
#

i mean i asked for help and the other person also mentioned mongodb

#

would mongodb allow me to modify data inside it if i needed to? eg bug fixes or whatnot

modest maple
#

it really depends on your preference mate

#

most DBs allow modifying of data

#

including sql lite

summer torrent
#

@earnest phoenix yes

modest maple
mossy vine
#

most dbs allow modifying of data
isnt that.. the point of a database

errant swallow
#

yeah lmao

modest maple
#

yes

#

xD

mossy vine
#

also it was just discussed that sqlite doesnt work on heroku

earnest phoenix
#

but are they all readable because i just opened a sqlite file and it was all weird

mossy vine
#

an sqlite file isnt a regular text file

errant swallow
#

@earnest phoenix if you have a credit card you could use the free amazon ec2 servers

earnest phoenix
#

well i could use one thats like a text file?

modest maple
#

its a db file

#

no

mossy vine
#

well its not recommended

modest maple
#

text files are bad bad bad dbs

errant swallow
#

yeah

earnest phoenix
#

but then how would i change the data

errant swallow
#

on heroku you either need to keep everything in ram, or use a cloud database

mossy vine
#

not trying to attack or anything, but do you know how a database works

#

lol ram database
restart = bye data

modest maple
#

you make a program to edit and interact with DBs

earnest phoenix
#

nope! 😅

mossy vine
#

okay then please read up on database basics, it will make bringing it into code much much easier

modest maple
#

text files and JSONs as Db is a rlly bad practice

mossy vine
#

right, whats the difference between a json "db" and sqlite (which also writes to a file)

earnest phoenix
#

aww man but thats long to read up on 😅

#

cloud database... Github?

errant swallow
#

if you dont have enough patience for that you shouldnt be making a bot, honestly

#

sorry if this sounds rude

mossy vine
#

github doesnt offer cloud databases

earnest phoenix
#

hey ive spent good time on this bot 😦

mossy vine
#

it hosts your git repositories for you

earnest phoenix
#

oof

#

anyway as for the db's if i needed to change the data in them, how would i do it if its all in a complete format?

modest maple
#

you

#

use the functions

#

of the db

#

e.g

#

SQLLite

#

has UPDATE to update stuff

errant swallow
#

or enmap just uses database.set(key, value) and stuff

modest maple
#

sql is pretty similar tbh

#

you could use an ORM

errant swallow
#

never really worked with sqlite directly

earnest phoenix
#

i have sqlite from a previous thing someone help me set up ages ago

modest maple
#

sql lite you just make a load of functions

#

so you can just do update(x, xyz)

earnest phoenix
#

can someone help me with this pls? 😅

#

as mentioned, jsons arent good for it so...

modest maple
#

well i rlly depends on u m8,

we've given you a list of example systems you can use but;
it depends on what youre using to host your bot

e.g i believe you said heroku (for starts is not a good bot host) and doesnt support certain stuff

#

we cant just say "Yes yes use this _____"

#

because thats not rlly how it works

#

check what DB systems you can use on ur host first

#

then read up on some of the recommended docs

#

Mongodb, Mysql, sqllite, orm framworks all do the same job essentialyl

knotty steeple
#

pls dont use orm

#

god

#

no

modest maple
#

cry will come down and smite you for saying that against orm

fleet glen
#

mongo db is pretty easy to use

knotty steeple
#

come at me

modest maple
#
class Classify:
    def __init__(self, Data, MonsterName, ThreadNo):
        self.data = Data
        self.item = MonsterName
        self.threadNo = ThreadNo


async def AddUserObject(Data, MonsterName, ThreadNo):
    global UserObjDict
    DataObj = Classify(Data, MonsterName, ThreadNo)
    UserObjDict[f"{ThreadNo}"] = DataObj


async def Send(ThreadNo, Toggle):
    global UserObjDict
    print(UserObjDict)
    DataOBJ = UserObjDict[f"{ThreadNo}"]```
errant swallow
#

as i said, i mostly use enmap

modest maple
#

side note from me:

#

the only other possible explanation for this from this code

#

is that the two functions are on separate processes

#

as send() cannot see the same global var as AddUserObject

#

and its driving me nuts

#

cuz how df can i fix this

errant swallow
#

cant help you with that mate idek what that language is and what 90% of that code means

fleet glen
#

is that not python

modest maple
#

it is

lethal stratus
#

correct me if wrong but python I think

modest maple
#

tis python

lethal stratus
#

nice

errant swallow
#

oh python
i should be ashamed for not recognizing that

fleet glen
#

tis python?

#

yes you should be

lethal stratus
#

the telltale signs are clear

#

the structure

errant swallow
#

yeah now i see them

fleet glen
#

the cursed structure

errant swallow
#

i've spent too much time writing my bot in js
anything other rhan js just looks like assembly to me now

lethal stratus
#

why

fleet glen
#

wow, shame

modest maple
#

what i dont get is why theyre even running seperate processes

#

like

lethal stratus
#

assembly is 3 letters per command

modest maple
#

theyre running on the same core

errant swallow
#

its a joke man... dont over analyze it...

lethal stratus
#

wait oh no

modest maple
#

if it should be unable to see it should of broken on a diffrent part

#

where they are multi process

lethal stratus
#

what

modest maple
#

@earnest phoenix lets not spam this in every chat ty

earnest phoenix
#

Ok

fleet glen
#

I host my bot on an old pc in a corner

lethal stratus
#

i host my bot in a raspberry pi

errant swallow
#

same h3

fleet glen
#

not reliable but very controllable

lethal stratus
#

that's off right now because a tree fell on the line :/

earnest phoenix
#

I can’t. PayPal hacked lmao......

errant swallow
#

the rpi4 is just godly for stuff like that

earnest phoenix
#

I host a gen bot

modest maple
#

just use glitch

lethal stratus
#

oh I have like the first pi XD

errant swallow
#

oh lmao

lethal stratus
#

it works

#

but uh

#

that's all

errant swallow
#

i have the rpi3b+ and the rpi4 4gb

earnest phoenix
#

It won’t upload. If anyone can help me, dm me

fleet glen
#

upload what?

modest maple
#

xD

errant swallow
#

woaaha

lethal stratus
#

I've been using SSH to connect to it, stop the bot, SCP the file over, then turn it back on and disconnect

modest maple
#

altho that server is running alot of Services

earnest phoenix
#

My bot won’t upload correctly to Heroku because of the type it is. Same w glitch.

#

I need a real 1,

errant swallow
#

@lethal stratus im using ssh and sftp

lethal stratus
#

hmm

modest maple
#

wdym what type it is

earnest phoenix
#

I have a 60 member server but can’t grow it when the bots online manual

lethal stratus
#

no

earnest phoenix
#

Lmao I

lethal stratus
#

stop pinging people randomly and rambling

#

thanks

opal halo
#

hes not

lethal stratus
#

he keeps asking people to join his server and apparently was sending that in all channels

#

so uh

#

yeah he is

opal halo
#

oh then he finna get banned

earnest phoenix
#

What

errant swallow
#

yikes

earnest phoenix
#

Why would I ask people to join my server

#

Don’t lie lmao

opal halo
#

hm

errant swallow
earnest phoenix
#

I said I’m running it in a 60 member server, and if you can run it, u can be a co w me

lethal stratus
#

before you were asking people to join.

earnest phoenix
#

Please screenshot

#

I would like to see where.

lethal stratus
#

or you were wording very poorly

mossy vine
#

@earnest phoenix should i send dm logs

earnest phoenix
#

Yes please

modest maple
#

WE DONT NEED TO ARGUING OVER THIS JESUS

lethal stratus
#

^

errant swallow
#

especially not here

modest maple
#

what is the file formate ending of your bot @earnest phoenix

earnest phoenix
#

Lmao I just wanted help. I got some thanks to Space.

#

He’s helping me, he/she kindly dmed me.

modest maple
#

alright that G

modest maple
wicked badger
#

Hello, I am having some trouble with my bot. I am using forever.js to restart my bot every time there is an error. Lately, it has been restarting pretty often, I averaged it around once per 20-30 mins. I decided to not use forever to see what the error was by using node bot.js. I did this and surveyed the console from when I first started it until it died. My bot died and left no error in the console log. I looked everywhere and found no warnings from node.js or any issues at all. I'm wondering what the issue is.

knotty steeple
#

are you sure you are logging the error?

#

just try logging every single thing

#

works for me

wicked badger
#

Im trying to log it, logging with forever is useless, it clears upon restart. I've scanned the console from start until the bot died, there were no errors.

sudden geyser
#

it could be anywhere in your code, but your app won't die for no reason (e.g. a call to process.exit somewhere).

knotty steeple
#

dont use forever

#

just run with node and log

wicked badger
#

Alright, but is it possible that it could be a firewall issue?

errant swallow
#

firewall issue would cause problems immediately, and definitely leave a noticable error @wicked badger

wicked badger
#

Oh

errant swallow
#

one question:
since the bots are tested using permissions=0 how are features that require higher permissions tested?

#

idk where else to ask this

drifting reef
#

Move the bot a little higher

errant swallow
#

what?

drifting reef
#

Or just join my server

earnest phoenix
#
{
_id: 1928392830282902,
inv: [item1: {xp: 0}, item2: {xp: 0}]
}
``` I am using normal MongoDB JS driver and can I ask how can I update the xp of item1 without infecting item2 using updateOne?
outer niche
#

Would something like this still work

amber fractal
earnest phoenix
#

^

golden raven
#

how to filter nsfw words in message content in discord.py? im making a google cmd for that i want to filter nsfw searches and send nsfw not allowed

#

should i use profanity_filter module?

green hornet
#

how do i get the bot to check whether a person who's sent a message in a server's user id is the same as the one i'm looking for

golden raven
#

@green hornet py if ctx.message.author.id == "the_person_id"

#

@green hornet just execute the code after this if statement

green hornet
#

ok thank u

wicked badger
#

Hello, I need help with part of my ban command for Discord.js. The following is an excerpt of my ban command. My problem is that if I ban someone with an equal role, it won't work (which is good), but if I ban someone with a higher role, it does work (which is not good). I'm not sure what I'm missing here, so I need some help.

if (message.member.hasPermission("BAN_MEMBERS")){
        var member= message.mentions.members.first();
        if (message.member.highestRole == member.highestRole) {
          message.channel.send("You can't ban those with equal roles as you.")
        }
        if (message.member.highestRole < member.highestRole) {
          message.channel.send("You can't ban those with higher roles than you.")
        }
if (message.member.highestRole == member.highestRole) return;
if (message.member.highestRole < member.highestRole) return;```
#

Also, for those wondering, message.member was defined as the author who typed their command

slate wave
#

@wicked badger use highestRole#position

wicked badger
#

got it, thank you so much!

slate wave
#

equals works cuz its the same but u cant use less than because they aren't numbers

wicked badger
#

Ahh

#

Oh wait, syntax error

#

I feel like I spaced it wrong

slate wave
#

hm

wicked badger
slate wave
#

its not # use highestRole.position lol

wicked badger
#

oh

#

lol

#

my bad

#

Thanks again!

slate wave
#

nah its just the formatting of the documentation

#

I should have been more specific, my bad.

#
let logs = message.guild.fetchAuditLogs().then(logs => {
      let embed = new Discord.RichEmbed()
        .setTitle("Message Deleted!")
        .addField("Channel", message.channel.name)
        .addField("Author:", message.author)
        .addField("Executor/Deleter:", logs.entries.first().executor)
        .addField("Content", message.content);
      logsChannel.send(embed);
    });
#

Could anyone tell my why this would send an error of "Cannot send an empty message"?

wicked badger
#

Are you fetching the deleted message straight from the audit log?

slate wave
#

No, im using the "messageDelete" event

wicked badger
#

Oh, then messageDelete.content

#

im pretty sure

#

Let me check

slate wave
#
bot.on("messageDelete", async message => {
  let deletedMessage = bot.events.get('DeletedMessage')
  deletedMessage.run(bot, message)
});
#

@wicked badger

wicked badger
#

For me, I have it like this: client.on("messageDelete", async (messageDelete) => { so in the embed, it would be messageDelete.content

slate wave
#

Mine is the same, but I use message instead of messageDelete

wicked badger
#

Huh

#

Your deleting normal text right?

slate wave
#

Also it still doesnt work when I have it so that the embed is just let embed = new Discord.RichEmbed().setTitle("Message Deleted!");

wicked badger
#

What error does it spring there?

slate wave
#

DiscordAPIError: Cannot send an empty message

wicked badger
#

let me eval that on my bot, hold on

slate wave
#

So i found the problem but its weird

#

I had it as logsChannel.send(embed); and it didnt work, but it works as logsChannel.send({embed});

#

all my other embeds work without the braces tho

wicked badger
#

oh yeah, you need the brackets

#

Its really weird

slate wave
#

for my help command, it uses message.channel.send(embed); and it works

wicked badger
#

Weird

#

Your using rich or normal for your help?

slate wave
#

rich

wicked badger
#

Hmm

#

That is very weird

#

the const embed = new Discord.RichEmbed() is exactly the same for both, yet for some you need brackets and some you don't

slate wave
#

well i guess I know what to do if I ever have the error again

wicked badger
#

Yeah

earnest phoenix
#
{
_id: 1928392830282902,
inv: [item1: {xp: 0}, item2: {xp: 0}]
}
``` I am using normal MongoDB JS driver and can I ask how can I update the xp of item1 without infecting item2 using updateOne?
minor kelp
#

Problem: making a report command to put report in a JSON file
Copied from a different command, How would i make this work now?
Code:```py
@commands.command()
async def report(self, ctx, *, report):
with open("report.json", "r") as f:
data = json.load(f)
data['reports'][str(user.id)] = reason if reason else "No reason specified"
with open("report.json", "w") as f:
json.dump(data, f, indent=4)
await ctx.send(f"Report: {report} filed by {ctx.author}")

Language: Python
Possible Fixes: Unsure
slender thistle
#

What exactly doesn't work

minor kelp
#

Im trying to make it work like

#

report "report_here"

#

and make that go in a json file

#

like this

fleet glen
#

send your report as text in a json format?

minor kelp
#
{
    "reports": {
        "439582316873121793": "report_here"
    }
}
#

Like that

#

in a json file

#

but im stuck at data['reports'][str(user.id)] = reason if reason else "No reason specified"

slender thistle
#

Why is reasonthere if you're taking user input as report

minor kelp
#

As it was from a different command

fleet glen
#

Well do you understand what you write at least?

minor kelp
#

To some degree, Yes

#

data['reports'][str(user.id)] = report if report else "No reason was specified."

#

So, that would work, yes?

fleet glen
#

hmmm, I'll only try answering since there is no one else doing so. I'm not familiar with python, but if what I'm understanding from your code is correct, you may have an issue in your json formatting

slender thistle
#

That's ok

minor kelp
#

Its almost identical to my blacklist command

#

i just

slender thistle
#

They used reason var that didn't exist in that scope

minor kelp
slender thistle
#

Tbh I'd suggest only opening a file once whenever possible

#

w+ mode exists so that you could both read from and write data into a file

minor kelp
#

Its what my personal dev told me to use, for blacklistso

#

ill make it work with report

outer niche
#
async def leave(ctx):
    server = ctx.messge.guild
    voice_bot = guild.voice_channel
    await voice_client.disconnect()```
Would this work
west raptor
outer niche
#

My Lord I have already tried it It does not work That's why I am asking

#

Traceback (most recent call last):
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'guild' is not defined```
fleet glen
#

hah

#

pretty sure this is saying guild is not a thing in your scope

outer niche
#

I don't know

fleet glen
#

time for research

outer niche
#

I've already done that trust me

fleet glen
#

ok, I'll give it a try

outer niche
#

Kk

fleet glen
#

ok so where is guild from?

#

server = ctx.messge.guild
voice_bot = guild.voice_channel
await voice_client.disconnect()

slender thistle
#

messge

fleet glen
#

is it not assigned to server?

slender thistle
#

That and spelling mistake in message

outer niche
#

Yeah I know I fixed it in the actual command

#
async def leave(ctx):
    server = ctx.message.guild
    voice_bot = guild.voice_client
    await voice_client.disconnect()```
fleet glen
#

ok so correct me if I'm wrong:

    server = ctx.message.guild
    voice_bot = server.voice_channel
    await voice_client.disconnect()
slender thistle
fleet glen
#

lol

outer niche
#

I don't think it's server anymore

slender thistle
#

In other words, you are assigning the guild to your server variable while later using guild @outer niche

outer niche
#

It should be guild

fleet glen
#

man idk python

slender thistle
#

It's you naming it server

fleet glen
#

wait so what I did was right?

outer niche
#

So it should be server

slender thistle
#

Use your server variable

outer niche
#

I'm confused

fleet glen
#

here

slender thistle
#

Do you know what a variable is

fleet glen
#

server = ctx.message.guild
voice_bot = server.voice_channel
await voice_client.disconnect()

slender thistle
#

Let's not spoonfeed

fleet glen
#

ok sorry

outer niche
#

That's legit what I was just asking

#

I asked instead of using guild I used server

fleet glen
#

guild basically does not even exist in that piece of code, you're taking it out of no where

outer niche
#

Ooo ok

fleet glen
#

server = ctx.message.guild
voice_bot = mygrandmaspantry.voice_channel
await voice_client.disconnect()

outer niche
#

Yeah but then it gives me your voice_client is not defined

fleet glen
#

you want to get the voice channel in which the bot is connected right?

outer niche
#

I think so

fleet glen
#

you think so???

#

you don't know what you want?

outer niche
#

Well on basically trying to make a command that makes the bot leave the voice chat

fleet glen
#

and to do that you need certain information. You need to know where you want it to leave from

outer niche
#

The voice chat

fleet glen
#

sounds about right

outer niche
#

So is it not voice client would it be you voice channel

floral bloom
#

The Discord API still doesn't support setting/reading custom statuses, does it?
Ping with response, please.

fleet glen
#

depends on the info voice_client has

outer niche
#

So I'm guessing it probably won't work

fleet glen
prime cliff
#

@floral bloom yea the api does support reading custom status for most libs

floral bloom
#

Dang. Thanks.

west raptor
#

@floral bloom discord.js has implemented I'm sure along with discord.py

outer niche
#
async def leave(ctx):
    server = ctx.message.guild
    voice_bot = server.voice_client
    await voice_client.disconnect()```   still cant figer this out
slender thistle
#

Does it work? Any errors?

outer niche
#
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'voice_client' is not defined```
slender thistle
#

Are you even paying attention to your variable names

outer niche
#

Yes I am yeah I still can't figure out why I can't get this to work I've been working on the same command for 4 hours now

slender thistle
#

... Do you have voice_client defined?

outer niche
#

Apparently not

slender thistle
#

"apparently"?

outer niche
#

Well the error says it's not

slender thistle
#

Do you see yourself defining it in that code snippet?

outer niche
#

Once I figure out how to define that sure

slender thistle
#

What is voice_bot

outer niche
#

By that you're making me think it's not voice_bot

slender thistle
#

Why are you defining voice_bot while trying to use voice_client

outer niche
#

So should it be @bot.command(pass_context=True) async def leave(ctx): server = ctx.message.guild voice_client = server.voice_client await voice_client.disconnect()

slender thistle
#

Yes

outer niche
#

😡 I'm going to pull my hair out if it pulls up with any more errors

#

I don't understand how does it not have an attribute for disconnect

#
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'NoneType' object has no attribute 'disconnect'
```I don't understand how does it not have an attribute for disconnect
prime cliff
#

Are you even checking if the bot is connected to a voice channel and if it has perms and such?

outer niche
#

yes

#

It has permissions it's connected to a voice channel

quartz kindle
#

That means voice_client is a none type, suggesting it is not connected to voice

#

So idk

slender thistle
#

A simple if statement

outer niche
#

Oh so now it wants to work

#

I'm done I'm going to sleep

prime cliff
dusky sundial
#

I thought pass_context wasn't needed anymore? Just wondering :3

outer niche
#

It's not I just haven't taken it out

dusky sundial
#

gotcha

outer niche
#

If you leave it in there it will just be ignored @dusky sundial

dusky sundial
#

Cool cool

modest maple
#

Pass context is needed in certain applications where it isn't automatically parsed

kindred ginkgo
#

admin ? i need help

modest maple
#

?

restive furnace
#

If you got questions for DBL/DSL related, read #502193464054644737 , otherwise ask someone who knows (non-mod is k if he knows).

small prairie
#

I have like A Json Database(Curse me later) How Can I send It As A File On Discord?

#

d.js

late hill
small prairie
#

Nvm

late hill
small prairie
#

Thanks Tho

#

Got help In Official Server

wooden lance
#

anyone know how to break a forEach in js?

#

or just error it out and force it to stop

#

either would do

onyx patio
#

hi does anyone know how to make a selfbot with discord.net? it keeps connecting me 2 times at login

wooden lance
#

no, selfbots are a bannable offence

modest maple
#
  1. You'll get banned cuz of self botting
  2. against Tos
wooden lance
#

we do not indorse or help make selfbots here

modest maple
#

onto Ollie's issue

onyx patio
#

i'm using a selfbot since one year now but in js

modest maple
#

you should be able to use break no?

#

hmm

#

good to know

wooden lance
#

ye

modest maple
#

@onyx patio are you using a self bot rn?

onyx patio
#

not on this account

earnest phoenix
modest maple
#

@flat pelican thoughts?

earnest phoenix
#

Eri, you have the Power of the Ban Hammer.

prisma lion
#

how to make a dashboard xD

flat pelican
#

@onyx patio Are you aware that selfbots are against to Discord's Terms of Services and when you get a report, your account gets terminated?

earnest phoenix
#

Google exits @prisma lion

modest maple
#

@wooden lance back to you, yh you should be able to use break if im not mistaken give it a try

wooden lance
#

@modest maple ok

prisma lion
earnest phoenix
#

No Google it

modest maple
#

@prisma lion using js or some other language interacting with the bot and website

earnest phoenix
#

We ain't Google

onyx patio
#

I will not get reported

prisma lion
#

@earnest phoenix dm for a second

earnest phoenix
#

You will

onyx patio
#

how

wooden lance
flat pelican
#

-b @onyx patio

gilded plankBOT
#

dblMod Banned Gachi#1337 (@onyx patio)

wooden lance
#

and now they cant delete the message amazing

flat pelican
#

Feel free to report the message above

earnest phoenix
#

Lmao

flat pelican
#

I can't rn

earnest phoenix
#

Have it done already @flat pelican

wooden lance
#

me too

flat pelican
#

Thank you Destiny

modest maple
#

we're not gonna give you the code for it, mostly cuz i dont use a dashboard

flat pelican
#

Thanks

earnest phoenix
#

:D

flat pelican
#

The ban was for avoiding him to delete the message

modest maple
#

arrogance didnt help himself

wooden lance
#

yep

flat pelican
#

Let's keep this channel on-topic now eyesFlipped

wooden lance
#

yes

modest maple
#

1577738438.9034271 | 1577738438.9034271 these are the same numbers or am i missing somthing

#

because python is going what numbers?

wooden lance
#

ye they are same

modest maple
#

according to python theyre not the same

#

which

#

is rlly rlly confusing

wooden lance
#

python be weird

earnest phoenix
#

Illegal lmao

flat pelican
#

Are you using Regex or?

modest maple
#

me? eri or ollie

wooden lance
#

i have no clue what that is

flat pelican
#

Ollie

wooden lance
#

i be noob

flat pelican
#

Why do you have a pipe between both numbers

quartz kindle
#

Using break in the wrong context/scope

flat pelican
#

Break should be used in a for loop

modest maple
flat pelican
#

or while

wooden lance
#

i could try making an exception and erroring it out

#

its a bad way of doing it

quartz kindle
#

What are you trying to do?

wooden lance
#

trying to break a forEach loop

quartz kindle
#

You cant break a foreach loop

flat pelican
#

^

wooden lance
#

can u not?

quartz kindle
#

Because foreach is like a for loop that fires functions

wooden lance
#

o

quartz kindle
#

The functions will all be excuted, unless you throw an exception but thats a bad way to go about it lol

#

If you need a breakable loop, use for

wooden lance
#

i have no clue how to do a for loop so...looks like im going to be reading some docs

flat pelican
#
IamLookingForAnUsersID = None
for user in guild.members:
  if user.name == "Ollie":
    IamLookingForAnUsersID = user.id
    break
quartz kindle
#

for(let item = initialValue; condition; nextStep) { }

#

assuming js

wooden lance
#

o

#

thank you

flat pelican
#

yeah it's js for him

#

I suck at JS stuff

wooden lance
#

me too

quartz kindle
#

Also, if youre looping over an array

wooden lance
#

i am

quartz kindle
#

You can take advantage of the special loops, for in and for of

wooden lance
#

cool

quartz kindle
#

for(let item in array) {}
for(let item of array) {}

#

the difference is that in the first one, item will be the object key or array index

#

the second one, item will be the value

earnest phoenix
#

Hey anyone can help me why my bot is not playing music

summer torrent
#

¯_(ツ)_/¯

earnest phoenix
#

Previously it joins the vc and stay there I generated a new YT API key then it says no results found

modest maple
#

yes?

earnest phoenix
#

CF8 can you talk turkish?

earnest phoenix
#

what do u guys use to host ur bots?

#

i use vultr

restive furnace
#

contabo

#

almost all time

slim heart
#

i use galaxy gate

earnest phoenix
#

vultr is really clean but sort of annoying and expensive

#

and it took me 2.5 hrs to get my bot on there

#

lmao

#

i couldnt install nodejs at first

slim heart
#

gg is really easy to use and decently priced

earnest phoenix
#

imma check it out

slim heart
#

and amazing support

#

cuz they use discord

earnest phoenix
#

nice

restive furnace
#

@earnest phoenix how u couldnt install nodejs?

earnest phoenix
#

idk

restive furnace
#

what os?

earnest phoenix
#

centos

#

i had to reinstall it

#

after

#

and that worked

#

@restive furnace

earnest phoenix
#
client.on('roleDelete', async role => {
role.guild.createRole({name: role.name})

})

Will give users with deleted role the newly created role

How can I do it?

late hill
#

but why

earnest phoenix
#

role deletion protection

slender thistle
#

but why

modest maple
#

that can potentially be abused massivley

#
  1. if people delete a role they probs dont want it comming back
#
  1. if you instantly give it to everyone
#

youre gonna be spamming the API

earnest phoenix
#

I'll set it to the cast at a interval of 1 or 2 seconds

#

yeah

#

u could theoreticaly remove others admin i think

#

adjustable, those who want the feature will be able to use

knotty steeple
#

there's no need for it tho

earnest phoenix
#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name})

}
})
knotty steeple
#

you cant really accidentally delete a role

#

if thats the reason for it

earnest phoenix
#

attack protection

knotty steeple
#

what

earnest phoenix
#

I wonder if someone can help if they don't question it..

west raptor
#

@knotty steeple I think they mean it as like a raid/nuke protection

knotty steeple
#

how does that work

sudden geyser
#

also you could add it back to everyone defaultthink

earnest phoenix
#

help, please

sudden geyser
#

but that sounds like api hell, a cool idea. Just iterate over the .members prop adding the role to everyone, but be careful of api spam

earnest phoenix
#

let g = role.guild.roles.find('name', role.name).id
role.members.forEach(f => f.addRole(g))

?

modest maple
#

that is gonna spam the API

west raptor
#

something like that but rather set a timeout between each one

modest maple
sudden geyser
#

yeah, but it's going to be spam regardless. imagine deleting multiple roles

earnest phoenix
#

I'll make adjustments to make sure the api doesn't spam

west raptor
#

true

sudden geyser
#

id rather let the library ratelimit itself and handle it

modest maple
#

that is

slender thistle
#

Yeah no

modest maple
#

really bad practice

#

in so so so many ways

slender thistle
#

Just because the library handles 429s for you doesn't mean you should rely on that

earnest phoenix
#

you can modify all user roles in one request

#

check if d.js supports it

#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name})

let g = role.guild.roles.find('name', role.name).id
role.members.forEach(f => f.addRole(g))
}
})

role but did not return to the former members (I'm trying on a 2-person test server to avoid api spam)

#

nevermind im blind

sudden geyser
#

you could kinda use that

earnest phoenix
#

How to edit the code to work

quartz kindle
#

Creating roles is async

#

Also createRole should return the created role

#

No need to find it again

earnest phoenix
#

I'm getting it found because a new role has been created with the deleted role name

#

But it's not happening.

quartz kindle
#

createRole returns a promise with the new role

#

Just use it properly

#

await or .then

cunning sedge
#

i need help

#
Error: Cannot find module '/app'
    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)```
quartz kindle
#

code?

cunning sedge
#

no

#

error

quartz kindle
#

I mean...

#

Where is the code

#

Show your code

cunning sedge
#

my github

mossy vine
#

there is no code, only error bloblul

earnest phoenix
#

@quartz kindle Can you do it like it's a code and throw it away? please

cunning sedge
#

help me pls

earnest phoenix
#

I think you have to do ./app, not /app

mossy vine
#

no

#

do you have a package.json on your glithc project

quartz kindle
#

@earnest phoenix do you know what is a promise, what is async and how to use await/then?

earnest phoenix
#

@earnest phoenix erensi kod paylaşım atsana xd.

cunning sedge
earnest phoenix
#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name}).then(a => role.members.forEach(f => f.addRole(a))
}
})
#

@quartz kindle ?

#

Does that work?

summer torrent
#

quick db eww

mossy vine
#

show your package.json

#

@cunning sedge

cunning sedge
#

hi

#

ok

quartz kindle
#

@earnest phoenix try it

cunning sedge
#
{
  "name": "bot",
  "version": "1.0.0",
  "description": "",
  "1main": "bot.js",
  "dependencies": {
    "db": "^1.1.1",
    "discord.js": "^11.5.1",
    "moment": "^2.24.0",
    "ms": "^2.1.2",
    "opusscript": "0.0.7",
    "queue": "^6.0.1",
    "ytdl": "^1.0.1",
    "ytdl-core": "^1.0.3",
    "quick.db": "^6.3.2",
    "ffmpeg-binaries": "^4.0.0",
    "node-opus": "^0.3.2",
    "yt-search": "^0.4.1",
    "database": "^0.0.2",
    "parse-ms": "^2.0.0",
    "canvas": "^2.6.1",
    "path": "^0.12.7",
    "fs": "^0.0.2",
    "database-cleaner": "^1.3.0",
    "firebase": "^7.6.1",
    "random-puppy": "^1.1.0",
    "jimp": "^0.9.1",
    "krunker.io.js": "^1.0.4",
    "krunker": "^0.0.2",
    "google-trans-api": "^1.0.1",
    "google-translate-api": "^2.3.0",
    "simple-youtube-api": "^5.2.1",
    "youtube-node": "^1.3.3",
    "superagent": "^5.1.3",
    "databae": "^1.1.0",
    "discord-gestor": "^1.1.1",
    "currency-formatter": "^1.5.5",
    "ffmpeg": "^0.0.4"
  },
  "devDependencies": {},
  "scripts": {
    "start": "node .",
    "test": "echo \"Error: no test specified\" && exit 1"
  },
  "keywords": [],
  "author": "",
  "license": "ISC"
}
quartz kindle
#

Why is there a "1main" ?

mossy vine
#

its supposed to be main isnt it

quartz kindle
#

Yeah

cunning sedge
#

is the main bot file

#

even removing continues the error I'll redo the bot

quartz kindle
#

Yeah but it should be "main" not "1main"

earnest phoenix
#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name}).then(a => role.members.forEach(f => f.addRole(a)))
}
})```
#

did not work, no errors @quartz kindle

quartz kindle
#

Did the role get created?

earnest phoenix
#

yes

tidal ice
#

ok so my bot is online and responds when I say ping, but I don't have experience and I need coding with basic commands that work with the prefix of /

compact oriole
#

we dont spoonfeed here...

tidal ice
#

im willing to pay anyone I just need a basic code that works with the prefix "/" and has command

modest maple
#

if you dont have basic experience in a programming language i suggest you stop coding a discord bot and learn the basics, if you want a discord bot without that i suggest going onto fiverr and getting a discord bot made for you there

compact oriole
#

I actually sold those way back, but yes, that's the best way to get a good bot for a great price

#

But I would suggest to only buy from really reputable sellers

#

as their code is much more "advanced" and stable

earnest phoenix
#

So, I have been trying to add a member to a guild using oauth2. I cant imagine what i have been doing wrong here:

#

req.query["act"] is the oauth2 token i got from the discord api after sending the code parameter

#

@quartz kindle yes

#

Can anyone help me here?

mossy vine
#

@earnest phoenix shouldnt authorization be the bearer token you get from the user authenticating?

modest maple
#

why are you trying to use oauth2 to join a guild?

compact oriole
#

You also need to get the real auth token from the query

earnest phoenix
#

Its for myself to understand the discord api a bit better

mossy vine
#

or is that the access token

compact oriole
#

as that one is for retrieving refresh and auth tokens

earnest phoenix
#

@compact oriole the access token that i send to them is the final auth token

#

req.query["act"] = auth token

compact oriole
earnest phoenix
#

No, i guess i should have done that first oof

#

oh wait im dumb

#

yes i have

compact oriole
#

then idk

earnest phoenix
#

and i get basic info from the access token

#

Such as username, email and avatar

quartz kindle
#

@earnest phoenix console.log(f) in the foreach, see what comes in the console

warm marsh
#

Aren't you missing an await prior to the db.fetch?

earnest phoenix
#

.then(a => role.members.forEach(f => console.log(f)))

#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name}).then(a => role.members.forEach(f => console.log(f)))
}
})```
#

console blank @quartz kindle

warm marsh
#

Does anyone have the role prior to deleting it?

quartz kindle
#

@earnest phoenix that means the role members are empty

earnest phoenix
#

Two people had that role @quartz kindle

modest maple
#

can it even get the members with that role if its been deleted

#

cuz the users wont have the role anymore

quartz kindle
#

Yeah good question

empty hearth
#

my friend lend me a script and i wana know bcs his is diffrent where do i but the token of the bot

earnest phoenix
quartz kindle
#

console.log(role.members) at the beginning

#

Before db

empty hearth
#

thx

quartz kindle
#

That wasnt for you lol

empty hearth
#

rip

modest maple
#

F

empty hearth
#

F

modest maple
#

can u atleast send us all the code

#

not just

empty hearth
#

me?/

modest maple
#

the lil screenshot

#

yes

empty hearth
#

okay

fluid basin
#

token belongs at where it should belong

warm marsh
#

You're looking for something that says client.login

empty hearth
#

the script is 124

#

lines

modest maple
#

cuz btw its getting the token from the json file

#

and yes

quartz kindle
#

@empty hearth seems like the token should go into config.json

modest maple
#

that is what a pastebin / hastebin is for

empty hearth
#

ok

#

my brain is confused

#

..

modest maple
#

@empty hearth seems like the token should go into config.json

earnest phoenix
#

(node:2376) UnhandledPromiseRejectionWarning: TypeError: undefined is not a function

but the deleted role was in 2 people @quartz kindle

#
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name}).then(a => role.members.forEach(console.log(role.members)))
}
})```
knotty steeple
#

how do i get a mentioned user in eris

fluid basin
#

hmm is it on the docs?

quartz kindle
#

I said to put the console.log in the beginning of the code

#

Before db.

fluid basin
#

afaik idk if eris has helper functions for mentions

knotty steeple
#

either im blind but i couldnt find if it has

earnest phoenix
#

Collection [Map] {} @quartz kindle

quartz kindle
#

Yeah that means its empty

fluid basin
#

message.mentions @knotty steeple

quartz kindle
#

So deleted roles do not keep a copy of the members who had said role

knotty steeple
#

yea i just found it lul @fluid basin

empty hearth
#

Okay i put in the config.json

#

now the bot wont run

#

there is no errors

earnest phoenix
#

so it's impossible to give the role created to users with deleted roles

empty hearth
#

and the index is the full script

#

config is the second pic

quartz kindle
#

@earnest phoenix it could be possible if you modify the library, but generally no

frozen cedar
#

I got the majority of ur token @empty hearth

empty hearth
#

its not full token

frozen cedar
#

Now I just gotta guess the few I don't know

#

Lul

#

O

#

Fak

quartz kindle
#

Lul

frozen cedar
#

I tried

empty hearth
#

i need some help

wheat jolt
#

send the json

empty hearth
#

confing?

wheat jolt
#

yes

#

without the token

empty hearth
#

okay

wooden lance
amber fractal
#

Your break isnt technically in the for loop

#

it's in a .then

#

which is a different function

wooden lance
#

o

#

where would i put it then lel?

empty hearth
#

me help anyone 😦

wooden lance
#

doesnt seem possible to do it

amber fractal
#

Well, I would save isMalicious to a variable and check if it's true after the .then

modest maple
#

@empty hearth you legit jsut replace that token with your token

empty hearth
#

FUCK

wooden lance
#

aaaaa

empty hearth
#

Am dumb

wooden lance
#

lol

quartz kindle
#

@wooden lance there are two ways to do it,sequential or parallel

#

For sequential you need async, and then you simply await your promises ibside the for loop. Unlike forEach, for does respect await and will await the promises before continuing the next iteration. That way you can use break

knotty steeple
#

sequential >>>

quartz kindle
#

For parallel, you have to make use of new Promise() and Promise.all() which is a bit more complicated

#

Depending on the nature of your promises, one option is better than the other

#

Sequential is slower because it resolvea promises one by one, parallel resolves all promises at the same time, but depending of how many and what kind they are, it can slow down your code instead of making it faster

wooden lance
quartz kindle
#

In your case you can probably just go ahead and make it sequential

wooden lance
#

okay

knotty steeple
#

yes pls do sequential

quartz kindle
#

for(...) {
let something = await promise();
If(something) break;
}

wooden lance
#

simple enough

outer niche
#
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: AttributeError: 'VoiceClient' object has no attribute 'create_ytdl_player'``` is this not a thig
modest maple
#

apparently not

knotty steeple
#

its not a thing

slender thistle
#

rtfd

outer niche
#

what is it now

foggy musk
#

Hi there! I was wondering; what do you people use to host your bots? Currently I have it running on a free AWS ec2 instance, which seems to be working ok. Will I have scalability issues down the line, or am I good to go?

wooden lance
#

yes it worked thank you @quartz kindle @amber fractal

modest maple
#

@foggy musk either use a vps like contabo or do what i do and self host

outer niche
#

Will that command work to any extent

#
async def play(ctx, url):
    server = ctx.message.guild
    voice_client = server.voice_client
    player = await voice_client.create_ytdl_player(url)
    players[server.id] = player
    player.start()```
Will this even work anymore
foggy musk
#

@modest maple Thanks for the advice! My friend offered to host it on the server that he uses for his website, so I may take him up on the offer.

slate wave
#

TypeError: Cannot read property 'removeRole' of undefined

bot.setInterval(() => {
    for (let i in bot.mutes) {
      let time = bot.mutes[i].time;
      let guildId = bot.mutes[i].guild;
      let guild = bot.guilds.get(guildId);
      let member = guild.members.get(i);
      let mutedRole = guild.roles.find(r => r.name === "Muted");
      if (!mutedRole) continue;
      if (Date.now() > time) {
        member.removeRole(mutedRole);
        delete bot.mutes[i];
        fs.writeFile("./Cmds/Mutes.json", JSON.stringify(bot.mutes), err => {
          if (err) throw err;
        });
      }
    }
  }, 5000);
wet kite
#

Upvote Add a check to make sure they are still in the server.. mmLol

slate wave
#

so just return if there is no member?

#

Thanks

earnest phoenix
#

Should I make discord bots for people for $, but basicish ones though.

#

do whatever

modest maple
earnest phoenix
#

But I want to know

modest maple
#

do what ever

#

we dont rlly care, just do what ever you want ig

earnest phoenix
#

...

modest maple
stray wasp
#
  let repped = client.utils.repCheck(user.id, author.id);
  const donator = client.utils.donatorCheck(user.id);
  let title = client.utils.getTitle(user.id);
  let voted = client.utils.hasVoted(user.id);

  const data = await Promise.all([repped, donator, title, voted]);

I'm a little confused by this Promise.all() are the variables defined ontop aswell async or do I have to access the variables from the data variable for the variables too be async?

valid frigate
#

when all promises are resolved, each item in the array corresponds to its original promise

#

for example, if repped evaluates to true, data[0] is true because repped evaluated to that

#

and so on

#

and no you dont need async

stray wasp
#

so when I access the repped variable directly it is like accessing the variable through data[0]?

valid frigate
#

no

#

if you try to access repped directly it will return an unresolved promise

#

so just get the data from data[0]

stray wasp
#

oh ok thank u

valid frigate
#

np

cunning sedge
#

Does anyone know how to make a command to count how many invitations a user has? Type invite manager

summer torrent
#

fetch invites of guild

cunning sedge
#

?

stray wasp
#

if you use discordjs

cunning sedge
#

@stray wasp yes

stray wasp
#

Yes

cunning sedge
#

Yes

modest maple
#

read it

outer niche
#
async def yt(ctx, *, url)
        async with ctx.typing():
            player = await YTDLSource.from_url(url, loop=self.bot.loop)
            ctx.voice_client.play(player, after=lambda e: print('Player error: %s' % e) if e else None
        await ctx.send('Now playing: {}'.format(player.title))

```          ```
Traceback (most recent call last):
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\bot.py", line 863, in invoke
    await ctx.command.invoke(ctx)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 728, in invoke
    await injected(*ctx.args, **ctx.kwargs)
  File "C:\Users\culan\AppData\Local\Programs\Python\Python37-32\lib\site-packages\discord\ext\commands\core.py", line 88, in wrapped
    raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: NameError: name 'YTDLSource' is not defined```
stray wasp
#

Command raised an exception: NameError: name 'YTDLSource' is not defined

#

YTDLSource isn't defined

outer niche
#

Not that dumb I can see that I have no idea how to fix it

stray wasp
#

by defining YTDLSource

outer niche
#

Oml This was a waste of time

stable horizon
#

Lol

#

No one uses ytdl

outer niche
#

I do

stable horizon
#

So no one knows how to fix it

outer niche
#

Because I don't know anything else I can use

stable horizon
#

Lavalink

#

Looking to set up a Lavalink server?
It's pretty simple to do so, and I'll show you here.

Setup
Download the latest Lavalink.jar from https://github.com/Frederikam/Lavalink/releases here and place an application.yml file in the same directory. The file should look like https://github.com/Frederikam/Lavalink/blob/master/LavalinkServer/application.yml.example this.

Starting it
Cd into your lavalink directory: e.g cd <directory>
Run java -jar Lavalink.jar
Check that it started successfully.
You preferably, should use a process manager for this in the future

Using it!
See ?tag lavalink.py for more information on Lavalink.py, ?tag pylava for info on the Pylava library, or ?tag waterlink for more info on the Waterlink library.

#

And as for in your bot

outer niche
#

Never heard of it

stable horizon
#

Ok?

#

What's your point?

outer niche
#

I have no idea how to set any of that up I've already set up YouTube DL now I just need to figure out how to fix this issue

stable horizon
#

Well gl then

copper cradle
#

did u import YTDLSource?

outer niche
#

I did not know you needed to

#

But I will

modest maple
#

did you read any sort of documentation?

#

also LL is better than YTDL overall

copper cradle
#

whenever you install a module you have to import it

stable horizon
#

He imported ytdl

outer niche
#

I'm going to stick with YouTube DL for now

timber siren
#

HOW LONG IS AN APPROVAL FOR AN BOT?

stable horizon
#

Mate

knotty steeple
#

and wrong channel to ask

summer torrent
#

1 week or more

knotty steeple
#

pls redirect people to channels

modest maple
#

atm

knotty steeple
#

so they can read

#

how it is so hard to read some info

stable horizon
#

Anyhow, multiple people have advised you to not use ytdl, that may be an indication for you... But ytdlsource ain't just gonna appear out of the blue, cause this ain't cs

knotty steeple
#

what if you dont have somewhere to host lavalink nodes

#

if they want to use ytdl just let them use ytdl

timber siren
#

@modest maple WHAT DO YA MEAN?

stable horizon
#

Then you don't have somewhere to host your bot either...

knotty steeple
#

nothing is really wrong with it

#

u need multiple nodes for lavalink

#

for it to be optimal

modest maple
#

cuz it gets around the YT ban waves

#

when it gets banned ur screwed

timber siren
#

how does it get banned?

knotty steeple
#

if they want to use ytdl let them use ytdl

modest maple
#

YT bans IPs sending too many requests to often

timber siren
#

VPN

modest maple
#

not how it works when youre trying to stream alot of data over serveral IPs

knotty steeple
#

just use proxies lmao

modest maple
#

a VPN is not rlly the best solution

timber siren
#

itz

#

iz

stable horizon
#

Why use proxies when there's a much easier solution??

timber siren
#

VPN

copper cradle
#

l a v a l i n k

modest maple
#

lavalink works off having multiple nodes so you can switch when one IP gets banned

knotty steeple
#

did yall get sponsored by lavalink lmao

modest maple
#

no its just one of the best systrems for music

knotty steeple
#

yes

timber siren
#

its gobbllygated

knotty steeple
#

@sudden geyser

#

raid

stable horizon
#

We just realize that lavalink is better than ytdl

stray wasp
#

they forgot #ad i'ma sue them

copper cradle
#

But first a quick word from our sponsor, lavalink

timber siren
#

htmls is furcking auld

earnest phoenix
#

lavalink is bloated trash

knotty steeple
#

thank you

modest maple
#

and compared to YTDL

#

its fine

earnest phoenix
#

ytdl is a binary to parse and get youtube videos

stable horizon
#

Ytdl likes to leak too

modest maple
#

but then we have already had this discussion cry

earnest phoenix
#

you can't compare ytdl and LL

stable horizon
#

We just did

earnest phoenix
#

they're not the same thing

modest maple
#

you can when youre trying to use them for music bots aura_shrug

earnest phoenix
#

ytdl doesn't do any audio processing at all

#

you're probably thinking of ffmpeg

modest maple
#

theyre both being used trying to achieve the same thing

earnest phoenix
#

which yes

modest maple
#

and yh ik

earnest phoenix
#

using a new instance of ffmpeg for each YouTube audio stream is slow

stray wasp
#

unpopular opinion all music bots should be coded in java

earnest phoenix
#

yuck

stable horizon
modest maple
#

thats just no

knotty steeple
#

python >>>

earnest phoenix
#

no thanks i prefer to keep my ram usage under 80 percent

knotty steeple
#

just use js

stable horizon
#

Ew

#

Never

knotty steeple
#

lmao

modest maple
#

python inst necessarily 'bad' but people dont optimise stuff well

stable horizon
#

I shan't subject my eyes to the shitshow that is js

#

People are really bad at optimizing in py that is true lol

honest karma
#

I wouldn't touch java even if you put a gun to my head

knotty steeple
#

oh you code python yes

earnest phoenix
#

python is really simplistic and that's a huge advantage, but it's avoided when you target performance because it is an interpreted language

knotty steeple
#

java is a mess

modest maple
#

yh

knotty steeple
#

just like my coffee

#

java is coffee

modest maple
#

altho you can use somthing like Cpython to compile and improve it some what

earnest phoenix
#

every experience i had with java was bad tbh

knotty steeple
#

what about c langs

stable horizon
#

You mean cython?

knotty steeple
#

c++

#

c#

stable horizon
#

Not you

knotty steeple
#

c-- exists

#

yea im not talking to you specifically either lmao

modest maple
#

cpython, kivy both can help improve performance to an extent