#development
1 messages · Page 760 of 1
yes
Also the custom settings LL has?
For example
that is audio manipulation, yes
i didn't need soundcloud in my case but i could implement it if i wanted to
playlist support is there
And how would you deal with YouTube now banning IPv4 and IPv6
don't know, i stopped working on the bot way long before the banning was implemented
though my guess would be ip proxying
I guess I could go on with this for a while, not sure if both of us want that lol
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
Would you like that I continue with things that LL has
Nice
Neither do i at this point
i implemented almost everything lavalink has and cut the resource usage in half
O
the code uses lavalink-styled objects though
u said lavalink is wack
But is the quality as good as LL
Ok
af
meanwhile in the non music bot area
i have completely forgotten the basics of async now F
Rip
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
Is it better to have a seperate bot for music only?
not rlly
or it dont matter?
no point
tbf, asyncing code is not a big deal
idk moderation and some utility commands
its in djs
can't speak for all
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
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
its not added yet
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
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
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?
are you using discord.js?
ohhh okay
wdym
in that case i would recommend you reading about enmap
enmap is a pretty easy to use database manager or smth
ok but as for to make it do what i need how would i set that up?
okay, so first of all you would need to install enmap through node, that would be npm install enmap in your project folder
im gonna need all the help i can get 😅
enmap is extremely limited
hm?
but for such a simple use its enough
isnt it that one "database" that can only store strings
sqlite?
no
wait so what should i use?
https://enmap.evie.dev/
@earnest phoenix i recommend you take a look at this
right its just a wrapper for sqlite3
yeah
for easier use
i cant stand working with sqlit3 directly
oh wait no i cant use enmap
whys that?
it says it doesnt work on heroku
oh youre on heroku
check out mongodb atlas
my bot is powered by heroku
essentially its a cloud hosted mongodb instance
in that case setting up a persistant database is gonna be hard
i got my stuff on github
i cant help you, idk shit about heroku
but heroku keeps it all online and whatnot
@errant swallow heroku cant write files iirc so its impossible
yeah, i read that
thank god im just hosting my bot on a pi
so i should use mongodb
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
it really depends on your preference mate
most DBs allow modifying of data
including sql lite
@earnest phoenix yes
most dbs allow modifying of data
isnt that.. the point of a database
yeah lmao
also it was just discussed that sqlite doesnt work on heroku
but are they all readable because i just opened a sqlite file and it was all weird
an sqlite file isnt a regular text file
@earnest phoenix if you have a credit card you could use the free amazon ec2 servers
well i could use one thats like a text file?
well its not recommended
text files are bad bad bad dbs
yeah
but then how would i change the data
on heroku you either need to keep everything in ram, or use a cloud database
not trying to attack or anything, but do you know how a database works
lol ram database
restart = bye data
you make a program to edit and interact with DBs
nope! 😅
okay then please read up on database basics, it will make bringing it into code much much easier
text files and JSONs as Db is a rlly bad practice
right, whats the difference between a json "db" and sqlite (which also writes to a file)
if you dont have enough patience for that you shouldnt be making a bot, honestly
sorry if this sounds rude
github doesnt offer cloud databases
hey ive spent good time on this bot 😦
it hosts your git repositories for you
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?
or enmap just uses database.set(key, value) and stuff
never really worked with sqlite directly
i have sqlite from a previous thing someone help me set up ages ago
can someone help me with this pls? 😅
as mentioned, jsons arent good for it so...
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
cry will come down and smite you for saying that against orm
mongo db is pretty easy to use
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}"]```
as i said, i mostly use enmap
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
cant help you with that mate idek what that language is and what 90% of that code means
is that not python
it is
correct me if wrong but python I think
tis python
nice
oh python
i should be ashamed for not recognizing that
yeah now i see them
the cursed structure
i've spent too much time writing my bot in js
anything other rhan js just looks like assembly to me now
why
wow, shame
assembly is 3 letters per command
theyre running on the same core
its a joke man... dont over analyze it...
wait oh no
if it should be unable to see it should of broken on a diffrent part
where they are multi process
what
@earnest phoenix lets not spam this in every chat ty
Ok
I host my bot on an old pc in a corner
i host my bot in a raspberry pi
same h3
not reliable but very controllable
that's off right now because a tree fell on the line :/
I can’t. PayPal hacked lmao......
the rpi4 is just godly for stuff like that
I host a gen bot
just use glitch
oh I have like the first pi XD
oh lmao
i have the rpi3b+ and the rpi4 4gb
It won’t upload. If anyone can help me, dm me
upload what?
woaaha
I've been using SSH to connect to it, stop the bot, SCP the file over, then turn it back on and disconnect
altho that server is running alot of Services
My bot won’t upload correctly to Heroku because of the type it is. Same w glitch.
I need a real 1,
@lethal stratus im using ssh and sftp
hmm
wdym what type it is
I have a 60 member server but can’t grow it when the bots online manual
no
Lmao I
hes not
he keeps asking people to join his server and apparently was sending that in all channels
so uh
yeah he is
oh then he finna get banned
What
yikes
hm
should i worry
I said I’m running it in a 60 member server, and if you can run it, u can be a co w me
before you were asking people to join.
or you were wording very poorly
@earnest phoenix should i send dm logs
Yes please
WE DONT NEED TO ARGUING OVER THIS JESUS
^
especially not here
what is the file formate ending of your bot @earnest phoenix
Lmao I just wanted help. I got some thanks to Space.
He’s helping me, he/she kindly dmed me.
alright that G
anyone got any idea why this global var / dict isnt acting global
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.
are you sure you are logging the error?
just try logging every single thing
works for me

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.
it could be anywhere in your code, but your app won't die for no reason (e.g. a call to process.exit somewhere).
Alright, but is it possible that it could be a firewall issue?
firewall issue would cause problems immediately, and definitely leave a noticable error @wicked badger
Oh
one question:
since the bots are tested using permissions=0 how are features that require higher permissions tested?
idk where else to ask this
Move the bot a little higher
what?
Or just join my server
{
_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?
Would something like this still work
^
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?
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
@green hornet py if ctx.message.author.id == "the_person_id"
@green hornet just execute the code after this if statement
ok thank u
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
@wicked badger use highestRole#position
got it, thank you so much!
equals works cuz its the same but u cant use less than because they aren't numbers
hm
its not # use highestRole.position lol
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"?
Are you fetching the deleted message straight from the audit log?
No, im using the "messageDelete" event
bot.on("messageDelete", async message => {
let deletedMessage = bot.events.get('DeletedMessage')
deletedMessage.run(bot, message)
});
@wicked badger
For me, I have it like this: client.on("messageDelete", async (messageDelete) => { so in the embed, it would be messageDelete.content
Mine is the same, but I use message instead of messageDelete
Also it still doesnt work when I have it so that the embed is just let embed = new Discord.RichEmbed().setTitle("Message Deleted!");
What error does it spring there?
DiscordAPIError: Cannot send an empty message
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
for my help command, it uses message.channel.send(embed); and it works
rich
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
well i guess I know what to do if I ever have the error again
Yeah
{
_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?
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
What exactly doesn't work
Im trying to make it work like
report "report_here"
and make that go in a json file
like this
send your report as text in a json format?
{
"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"
Why is reasonthere if you're taking user input as report
As it was from a different command
Well do you understand what you write at least?
To some degree, Yes
data['reports'][str(user.id)] = report if report else "No reason was specified."
So, that would work, yes?
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
That's ok
They used reason var that didn't exist in that scope
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
Its what my personal dev told me to use, for blacklistso
ill make it work with report
async def leave(ctx):
server = ctx.messge.guild
voice_bot = guild.voice_channel
await voice_client.disconnect()```
Would this work
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```
I don't know
time for research
I've already done that trust me
ok, I'll give it a try
Kk
ok so where is guild from?
server = ctx.messge.guild
voice_bot = guild.voice_channel
await voice_client.disconnect()
messge
is it not assigned to server?
That and spelling mistake in message
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()```
ok so correct me if I'm wrong:
server = ctx.message.guild
voice_bot = server.voice_channel
await voice_client.disconnect()

lol
I don't think it's server anymore
In other words, you are assigning the guild to your server variable while later using guild @outer niche
It should be guild
man idk python
It's you naming it server
wait so what I did was right?
So it should be server
Use your server variable
I'm confused
here
Do you know what a variable is
server = ctx.message.guild
voice_bot = server.voice_channel
await voice_client.disconnect()
Let's not spoonfeed
ok sorry
guild basically does not even exist in that piece of code, you're taking it out of no where
Ooo ok
server = ctx.message.guild
voice_bot = mygrandmaspantry.voice_channel
await voice_client.disconnect()
Yeah but then it gives me your voice_client is not defined
you want to get the voice channel in which the bot is connected right?
I think so
Well on basically trying to make a command that makes the bot leave the voice chat
and to do that you need certain information. You need to know where you want it to leave from
The voice chat
sounds about right
So is it not voice client would it be you voice channel
The Discord API still doesn't support setting/reading custom statuses, does it?
Ping with response, please.
depends on the info voice_client has
So I'm guessing it probably won't work
I'm reading the docs bc idk discord.py myself
@floral bloom yea the api does support reading custom status for most libs
Dang. Thanks.
@floral bloom discord.js has implemented I'm sure along with discord.py
async def leave(ctx):
server = ctx.message.guild
voice_bot = server.voice_client
await voice_client.disconnect()``` still cant figer this out
Does it work? Any errors?
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```
Are you even paying attention to your variable names
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
... Do you have voice_client defined?
Apparently not
"apparently"?
Well the error says it's not
Do you see yourself defining it in that code snippet?
Once I figure out how to define that sure
What is voice_bot
By that you're making me think it's not voice_bot
Why are you defining voice_bot while trying to use voice_client
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()
Yes
😡 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
Are you even checking if the bot is connected to a voice channel and if it has perms and such?
That means voice_client is a none type, suggesting it is not connected to voice
So idk
A simple if statement

I thought pass_context wasn't needed anymore? Just wondering :3
It's not I just haven't taken it out
gotcha
If you leave it in there it will just be ignored @dusky sundial
Cool cool
Pass context is needed in certain applications where it isn't automatically parsed
admin ? i need help
?
If you got questions for DBL/DSL related, read #502193464054644737 , otherwise ask someone who knows (non-mod is k if he knows).
I have like A Json Database(Curse me later) How Can I send It As A File On Discord?
d.js
Nvm

anyone know how to break a forEach in js?
or just error it out and force it to stop
either would do
hi does anyone know how to make a selfbot with discord.net? it keeps connecting me 2 times at login
no, selfbots are a bannable offence
- You'll get banned cuz of self botting
- against Tos
we do not indorse or help make selfbots here
onto Ollie's issue
i'm using a selfbot since one year now but in js
ye
@onyx patio are you using a self bot rn?
not on this account

@flat pelican thoughts?
Eri, you have the Power of the Ban Hammer.
how to make a dashboard xD
@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?
Google exits @prisma lion
@wooden lance back to you, yh you should be able to use break if im not mistaken give it a try
@modest maple ok
@earnest phoenix #development easier
No Google it
@prisma lion using js or some other language interacting with the bot and website
We ain't Google
I will not get reported
@earnest phoenix dm for a second
You will
how
we could just email support@discordapp.com quite simple really
-b @onyx patio
Banned Gachi#1337 (@onyx patio)
and now they cant delete the message amazing
Feel free to report the message above
Lmao
I can't rn
Have it done already @flat pelican
me too
Thank you Destiny
we're not gonna give you the code for it, mostly cuz i dont use a dashboard
Thanks
:D
The ban was for avoiding him to delete the message
arrogance didnt help himself
yep
Let's keep this channel on-topic now 
yes
1577738438.9034271 | 1577738438.9034271 these are the same numbers or am i missing somthing
because python is going what numbers?
Illegal lmao
Are you using Regex or?
me? eri or ollie
i have no clue what that is
Ollie
i be noob
Why do you have a pipe between both numbers
Using break in the wrong context/scope
Break should be used in a for loop

or while
What are you trying to do?
trying to break a forEach loop
You cant break a foreach loop
^
can u not?
Because foreach is like a for loop that fires functions
o
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
i have no clue how to do a for loop so...looks like im going to be reading some docs
IamLookingForAnUsersID = None
for user in guild.members:
if user.name == "Ollie":
IamLookingForAnUsersID = user.id
break
me too
Also, if youre looping over an array
i am
You can take advantage of the special loops, for in and for of
cool
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
Hey anyone can help me why my bot is not playing music
¯_(ツ)_/¯
Previously it joins the vc and stay there I generated a new YT API key then it says no results found
yes?
CF8 can you talk turkish?
i use galaxy gate
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
gg is really easy to use and decently priced
imma check it out
nice
@earnest phoenix how u couldnt install nodejs?
idk
what os?
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?
but why
role deletion protection
but why
that can potentially be abused massivley
- if people delete a role they probs dont want it comming back
- if you instantly give it to everyone
youre gonna be spamming the API
I'll set it to the cast at a interval of 1 or 2 seconds
yeah
i was talking about it in #general
u could theoreticaly remove others admin i think
adjustable, those who want the feature will be able to use
there's no need for it tho
client.on('roleDelete', async role => {
let a = db.fetch(`roledeletionprotection_${message.guild.id}`)
if(a === 'on') {
role.guild.createRole({name: role.name})
}
})
attack protection
what
I wonder if someone can help if they don't question it..
@knotty steeple I think they mean it as like a raid/nuke protection
also you could add it back to everyone 
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
let g = role.guild.roles.find('name', role.name).id
role.members.forEach(f => f.addRole(g))
?
that is gonna spam the API
something like that but rather set a timeout between each one

yeah, but it's going to be spam regardless. imagine deleting multiple roles
I'll make adjustments to make sure the api doesn't spam
true
id rather let the library ratelimit itself and handle it
that is
Yeah no
Just because the library handles 429s for you doesn't mean you should rely on that
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)
use this to mass add roles https://discord.js.org/#/docs/main/stable/class/GuildMember?scrollTo=addRoles
nevermind im blind
you could kinda use that
How to edit the code to work
Creating roles is async
Also createRole should return the created role
No need to find it again
I'm getting it found because a new role has been created with the deleted role name
But it's not happening.

createRole returns a promise with the new role
Just use it properly
await or .then
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)```
code?
my github
there is no code, only error 
@quartz kindle Can you do it like it's a code and throw it away? please
I think you have to do ./app, not /app
@earnest phoenix do you know what is a promise, what is async and how to use await/then?
@earnest phoenix erensi kod paylaşım atsana xd.
don't have / app
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?
quick db eww
@earnest phoenix try it
{
"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"
}
Why is there a "1main" ?
its supposed to be main isnt it
Yeah
Yeah but it should be "main" not "1main"
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

Did the role get created?
yes
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 /
we dont spoonfeed here...
im willing to pay anyone I just need a basic code that works with the prefix "/" and has command
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
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
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?
@earnest phoenix shouldnt authorization be the bearer token you get from the user authenticating?
why are you trying to use oauth2 to join a guild?
You also need to get the real auth token from the query
Its for myself to understand the discord api a bit better
or is that the access token
as that one is for retrieving refresh and auth tokens
@compact oriole the access token that i send to them is the final auth token
req.query["act"] = auth token
https://i-am.affax.dev/G0D0nSID.png
Did you run this
then idk
@earnest phoenix console.log(f) in the foreach, see what comes in the console
Aren't you missing an await prior to the db.fetch?
.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

Does anyone have the role prior to deleting it?
@earnest phoenix that means the role members are empty
Two people had that role @quartz kindle
can it even get the members with that role if its been deleted
cuz the users wont have the role anymore
Yeah good question
my friend lend me a script and i wana know bcs his is diffrent where do i but the token of the bot

thx
That wasnt for you lol
rip
F
F
me?/
okay
token belongs at where it should belong
You're looking for something that says client.login
@empty hearth seems like the token should go into config.json
that is what a pastebin / hastebin is for
@empty hearth seems like the token should go into config.json
(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)))
}
})```
how do i get a mentioned user in eris
hmm is it on the docs?
afaik idk if eris has helper functions for mentions
either im blind but i couldnt find if it has
Collection [Map] {} @quartz kindle
Yeah that means its empty
message.mentions @knotty steeple
So deleted roles do not keep a copy of the members who had said role
yea i just found it lul @fluid basin
so it's impossible to give the role created to users with deleted roles
@earnest phoenix it could be possible if you modify the library, but generally no
I got the majority of ur token @empty hearth
its not full token
Lul
I tried
send the json
confing?
I'm having some issues using for in js. I really have no clue what to say so here is the error and my code.
Error: https://pastebin.com/Ws1T3fhS
Code: https://pastebin.com/8wPzihd9
Any ideas?
Your break isnt technically in the for loop
it's in a .then
which is a different function
me help anyone 😦
doesnt seem possible to do it
Well, I would save isMalicious to a variable and check if it's true after the .then
@empty hearth you legit jsut replace that token with your token
FUCK
aaaaa
Am dumb
lol
@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
sequential >>>
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

In your case you can probably just go ahead and make it sequential
okay
yes pls do sequential
for(...) {
let something = await promise();
If(something) break;
}
simple enough
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
apparently not
its not a thing
rtfd
what is it now
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?
yes it worked thank you @quartz kindle @amber fractal
@foggy musk either use a vps like contabo or do what i do and self host
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
@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.
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);
Add a check to make sure they are still in the server.. 
Should I make discord bots for people for $, but basicish ones though.
do whatever

But I want to know
...

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?
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
so when I access the repped variable directly it is like accessing the variable through data[0]?
no
if you try to access repped directly it will return an unresolved promise
so just get the data from data[0]
oh ok thank u
np
Does anyone know how to make a command to count how many invitations a user has? Type invite manager
fetch invites of guild
?
if you use discordjs
@stray wasp yes
Yes
Yes
read it
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```
Command raised an exception: NameError: name 'YTDLSource' is not defined
YTDLSource isn't defined
Not that dumb I can see that I have no idea how to fix it
by defining YTDLSource
Oml This was a waste of time
I do
So no one knows how to fix it
Because I don't know anything else I can use
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
A robust and powerful Lavalink wrapper for discord.py. Featuring an easy to use high level interface, automatic and manual node balancing, and a simple to use events system.
Examples:
Basic - https://github.com/EvieePy/Wavelink/blob/master/examples/basic.py
A Lavalink library for Discord.py. Contribute to PythonistaGuild/Wavelink development by creating an account on GitHub.
Never heard of it
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
Well gl then
did u import YTDLSource?
whenever you install a module you have to import it
He imported ytdl
I'm going to stick with YouTube DL for now
HOW LONG IS AN APPROVAL FOR AN BOT?
Mate
1 week or more
pls redirect people to channels
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
what if you dont have somewhere to host lavalink nodes
if they want to use ytdl just let them use ytdl
@modest maple WHAT DO YA MEAN?
Then you don't have somewhere to host your bot either...
nothing is really wrong with it
u need multiple nodes for lavalink
for it to be optimal
how does it get banned?
if they want to use ytdl let them use ytdl
YT bans IPs sending too many requests to often
VPN
not how it works when youre trying to stream alot of data over serveral IPs
just use proxies lmao
a VPN is not rlly the best solution
Why use proxies when there's a much easier solution??
VPN
l a v a l i n k
lavalink works off having multiple nodes so you can switch when one IP gets banned
did yall get sponsored by lavalink lmao
no its just one of the best systrems for music
yes
its gobbllygated
We just realize that lavalink is better than ytdl
they forgot #ad i'ma sue them
But first a quick word from our sponsor, lavalink
htmls is furcking auld
lavalink is bloated trash
ytdl is a binary to parse and get youtube videos
Ytdl likes to leak too
but then we have already had this discussion cry
you can't compare ytdl and LL
We just did
they're not the same thing
you can when youre trying to use them for music bots 
theyre both being used trying to achieve the same thing
which yes
and yh ik
using a new instance of ffmpeg for each YouTube audio stream is slow
unpopular opinion all music bots should be coded in java
yuck

thats just no
python >>>
no thanks i prefer to keep my ram usage under 80 percent
lmao
python inst necessarily 'bad' but people dont optimise stuff well
I shan't subject my eyes to the shitshow that is js
People are really bad at optimizing in py that is true lol
I wouldn't touch java even if you put a gun to my head
oh you code python yes
python is really simplistic and that's a huge advantage, but it's avoided when you target performance because it is an interpreted language
java is a mess
yh
altho you can use somthing like Cpython to compile and improve it some what
every experience i had with java was bad tbh
what about c langs
You mean cython?
Not you
cpython, kivy both can help improve performance to an extent




