#development
1 messages Β· Page 1344 of 1
o..k
css is not a language
it is hell
where do I find twitter bots?
Programing language
straight from my keyboard

where do I find twitter bots?
@rapid shuttle we dunno where but you won't find any here
π
Does anyone know why my static files aren't showing in Django? I'm using django and apache2. For some reason when I go to the link, it shows the default apache2 ubuntu page. It's supposed to show the static files. I have my port as 443 in my .conf file. This started once I set my port to 443. I have port 80 before, but my new domain wouldn't work on it for some reason. I changed the port to 443 and it works, but it's not showing my static files.
apache setup i guess
bruh..
@earnest phoenix u ghosted a dude
in case anyone comes asking me :l
@earnest phoenix u ghosted a dude
@viscid gale those my friend
if(collection.count_documents({}) == 0):
user_info = {"_id": reporter, "coins":'0'}
collection.insert_one(user_info)
if(collection.count_documents(reporter) == 0):
user_info = {"_id": reporter, "coins":'0'}
collection.insert_one(user_info)
reportercoins = collection.find(reporter)
for reportercoins1 in reportercoins:
coins = reportercoins1["coins"]``` can any1 tell me whats the issue with this?
its giving me a huge error
the filter must be an object
oh... ok here's some more context
@fluid basin I have everything set up. Everything worked fine but my new domain wouldn't work for some reason. So I changed my port in the .conf file to 443 for https. And now it shows the default apache2 page instead of my static files.
make sure the apache server config for both default and ssl have your config inside
the error code info just got deleted owo
wait whats the error again @drifting wedge
make sure the apache server config for both default and ssl have your config inside
@fluid basin I only have 443
self.dblpy = dbl.DBLClient(self.bot, self.token, webhook_path='/dblwebhook', webhook_auth='password', webhook_port=5000)where we find the password and the dblwebhook?
@royal cove you decide the password
how do i select an element INSIDE a D3 selection?
did u google that exact phrase before u came herre?
no
because you guys are better than google
where we had to define the password?
should be under the webhook section in your bot edit page
ah okay
how do i select an element INSIDE a D3 selection?
@earnest phoenix why
and the dblwebhook? ?
why not just select under one selector
declarative does look mentally easier(since it's shorter) but in my opinion, imperative is more comprehensive than delclarative because it doesnt try as hard to determine what u wanna do off the bat
im gonna get knowlegded on d3 still tho
since i guess ppl might begin moving with d3.js
why not just select under one selector
@pale vessel wait sod3.select("<first selection> <second selection>")will work?
that works in CSS
yes
awesome
can you iterate over a D3 selection?
log it and see
betterdiscord detected
@pale vessel ran into a problem with your method
huh.. it will get tedious if u try to make more commands like that
so umm
<selection>.element()??
select what in what
what are you trying to do anyway
yea what r u trying to do
what are you trying to do anyway
@pale vessel my goals are beyond your understanding
welp
i bet u trying the d3 version of document.all
@viscid gale yeah
d3.select(".dropdown").selectChild
this exists yay
just use document.all
@viscid gale if it was that easy D3 wouldn't exist
what is the child called
now u understand y i wonder it does
karen
thats the mom
everything is possible, they just made it more declarative
CSS transitions are fucking easy with D3
literally turned the whole thing to three lines of code
just type faster 4head
is better discord allowed?
no
o ok
the thing is, i gonna try to explain the equivalent in real life model
if someone listens to less of what you say to do something, yes u dont have to waste your voice as much, BUT, if u have a tricky task, the dude who listens slowly and carefully with long sentences will be the winner
it's like if u had a pack of functions to do certain stuff(and u make em short and intuitive)
it will work for those specific situations, but when it comes down to real tricky stuff, the comprehensive thing that existed before would be better
*in my opinion
transition : .4s; 
it's not like i never use normal vanilla DOM stuff
i only use D3 to do stuff quicker
it literally adds no new features it's just to make things easier
var paragraphs = document.getElementsByTagName("p");
for (var i = 0; i < paragraphs.length; i++) {
var paragraph = paragraphs.item(i);
paragraph.style.setProperty("color", "blue", null);
}```
D3 employs a declarative approach, operating on arbitrary sets of nodes called selections. For example, you can rewrite the above loop as:
```js
d3.selectAll("p").style("color", "blue");```
that what u mean?
yes
p=document.getElementsByTagName("p")
Object.keys(p).forEach(a=>{p[a].color="blue"})
@viscid gale if you don't wanna use d3.js don't
im not telling u dont use it bruh im not fiting u down
im legit trying to see how short i can make imperative code
i gotta admit, it made the chit really short
im not telling u dont use it bruh im not fiting u down
@viscid gale then please explain the purpose of this unnecessary talk
:kthnxbai:
@earnest phoenix be naice to everybody instead of sending these weird emojis lol
totalid = makeid() make id is a function that returns an str
yeah?
why would it say NameError: name 'makeid' is not defined
in python
def makeid():
id1 = random.randint(1, 9)
id2 = random.randint(1, 9)
id3 = random.randint(1, 9)
id4 = random.randint(1, 9)
id5 = random.randint(1, 9)
id6 = random.randint(1, 9)
id7 = random.randint(1, 9)
id8 = random.randint(1, 9)
id9 = random.randint(1, 9)
totalid = f"{str(id1) + str(id2) + str(id3) + str(id4) + str(id5) + str(id6) + str(id7) + str(id8) + str(id9)}"
return totalid``` this is makeid
idk python bye
Python is read top-to-bottom.
Are you trying to call the function before it's been defined in the scope.
is it a question or a sentence
nothing xd
Are you trying to call the function before it's been defined in the scope.
@sudden geyser i define it v4
can you share your code via hastebin
in minecraft we can do /execute as <entity>
can you do the same in js?
you're comparing a game's scripting engine against a programming language? lmao
yeah bad comparison as wwell
you're comparing a game's scripting engine against a programming language? lmao
@quartz kindle not really a scripting engine more like a RAGE INITIATOR AAAAAAAAAAAAAAAAAAAA
why is bedrock's command system, redstone, EVERYTHING fucked
lmao
programming languages have no "can i do this in [insert language]"
they have "how can i do this in [insert language]"
lemme rephrase my question:
can you execute a function as a different object
even better example: this keyword is tied to that object and not the current
yes
sudo, the phrase you're looking for is sudo
sudo, the phrase you're looking for is sudo
@earnest phoenix all this time i thought it was just a phrase linux bash ripped off of sumo wrestlers...
thx
there are three methods that override this
call, apply and bind
@quartz kindle
callcalls a phone number through the specified telephone object
applyapplies a CSS style to that object
bindjoins together the bonds in a protein
yes
also you know what I'm gonna use the call thing for?
for (let ctn of d3.selectAll(".dropdown")) {
myfunc.call(ctn);
}
Meister is typing...
client.shard.broadcastEval(`this.channels.cache.has("${remind.bumpchannel}") ? this.channels.cache.get("${remind.bumpchannel}").send({
embed: ${JSON.stringify(remindmessage.toJSON())}}) : null`).then(console.log);
``` β€΄οΈ this code does not work error: [#development message](/guild/264445053596991498/channel/272764566411149314/) @quartz kindle do u know why? since your code was right
#development message @earnest phoenix xD
wrong
@tired panther idk looks right
try console.log the entire string to see if it looks right
console.log(`this.channels.cache.has("${remind.bumpchannel}") ? this.channels.cache.get("${remind.bumpchannel}").send({
embed: ${JSON.stringify(remindmessage.toJSON())}}) : null`)
okay
you can't iterate over a d3 selection and get selections
wait can you pass html object in d3.select?
like you use .call() in which the first argument will be the this value, so the parameter elm shouldn't have a value
:| ...why did i add .call anyways?
who knows
it doesn't look like you need to wrap it in a function to then call it in the first place
Uncaught TypeError: Cannot read property '#<HTMLPreElement>' of undefined
the file
[ elm.node() , elm.selectChild(".dropdown-content").node() ].forEach(...)










What would this error mean? (node:11996) UnhandledPromiseRejectionWarning: Error: connect ECONNREFUSED 192.168.0.8:1226 at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1142:16) Its for an overinternet database
could it be ratelimits?
@mystic violet congrats you just leaked your IP and port
if your internet database has an open port DEAD
lmao are you even gonna edit your message now mate
no
because its a local IP mate
π
DDoS it I dare you
just change the port to 80
and the 8 to a 1
the same line logging the element is the same line saying it can't read the property
if i remove the logging it becomes Uncaught TypeError: Cannot read property '#<HTMLPreElement>' of undefined
i got it
fixed

[you] congrats you just leaked your IP and port
@mystic violethe doesn't know
imagine removing the ping in the quote but forgetting to remove the ping below the quote
Hello
imagine removing the ping in the quote but forgetting to remove the ping below the quote
@earnest phoenix was on purpose
But this kid thought it was his IP
DDoS it

haha

imagine DDoSing a local IP
200 IQ
Making a DDoS website which kids will search, but instead of DDoSing the filled in IP it will DDoS the IP it came from (yourself)
if (args[2].toLowerCase() == "upper") var greaterorless = ">"
if (args[2].toLowerCase() == "lower") var greaterorless = "<"
if (10 greaterorless 5) {console.log("true")}``` anyone know how to solve this stupidity
do i still need to improve the CSS on this: https://discord-webhook.code913.repl.co/
@errant perch because you use <> as a string

brhudude
if (args[2].toLowerCase() == "upper") var greaterorless = ">"
if (args[2].toLowerCase() == "lower") var greaterorless = "<"
if (10 greaterorless 5) {console.log("true")}
anyone know how to solve this stupidity
if (args[2].toLowerCase() == "upper" && 10 > 5) console.log("true")
if (args[2].toLowerCase() == "lower" && 10 < 5) console.log("true")
i solved it
give me my prize
That's one way of doing it
πͺ
if (args[2].toLowerCase() == "upper" && 10 > 5 || args[2].toLowerCase() == "lower" && 10 < 5) console.log("true")```
that ought to work lmao
too unreadable tho
Is the api having trouble? My bot is timing out when connecting to shards
ye
Why the 10 > 5 in the first place
if I have an unhandledRejection, the bot stops and restarts, because of my .sh script. How can I say, that the bot doesn't stop?
Why the 10 > 5 in the first place
@slender thistle dont question the ways of Woogie
lol
thanks im glad i can make you feel that way
This server makes me want to cry my soul out.
@slender thistle not only this server
@errant perch
if (args[2].toLowerCase() == "upper") var greaterorless = ">"
if (args[2].toLowerCase() == "lower") var greaterorless = "<"
eval(`if (10 ${greaterorless} 5) {console.log("true")}`)
for js
@errant perch just make it all a single line statement
@errant perch yea man wtf
you don't need to use eval wtf
bro its a joke

the code is obviously a joke
Meh
π
ok NitRo BoOstEr
args[2].toLowerCase() == "upper" ? greaterorlower = ">" : greaterorlower = "<"
donr
duh
@fluid basin ??? think of it as a challenge then
like i say let me be dumb in peace
no one was asking for help when we were talking anyway
That's not the same @earnest phoenix
@errant perch dont be salty, admit i beat u with the eval
ποΈ
that eye isnt symmetrical
neither is yours
of course
so I'm trying to add mongodb to my bot
and I'm not really sure how it works, do I need to install mongodb from the mongodb website? i have the npm installed
ping with answer
I'm not sure but I do have a link on setting up mongodb
First of all, are you planning to use mongodb or mongoose
Both are wrappers around mongodb API
I thought I had the link saved, But I don't, sorry.
Nevermind, I found it in search history, https://glitch.com/edit/#!/mongodb
Check the documentation on NPM
ok
I'm using django and I'm trying to look at the static folder in filezilla but it doesn't show because of permissions
When I go to my website, it shows the html code but it doesn't show the css
I think the html folder can't access the css files (which is in the static folder) because of permissions
does anyone know how to fix this?
does anyone know if i'd be able to use https://dual.pw for my radio command (d.js)? what i'm doing is;
execute(message, args) {
const broadcast = client.voice.createBroadcast();
const dispatcher = broadcast.play('https://www.radio-uk.co.uk/au/totally-radio-hits ');``` but i dont think my bot could play it because there is a 'click to listen' when you load the page
def makeid(self):
id1 = random.randint(1, 9)
id2 = random.randint(1, 9)
id3 = random.randint(1, 9)
id4 = random.randint(1, 9)
id5 = random.randint(1, 9)
id6 = random.randint(1, 9)
id7 = random.randint(1, 9)
id8 = random.randint(1, 9)
id9 = random.randint(1, 9)
totalid = f"{str(id1) + str(id2) + str(id3) + str(id4) + str(id5) + str(id6) + str(id7) + str(id8) + str(id9)}"
return totalid``` i have this function and it makes a str of 7 integers, ```py
totalid = self.makeid()
isused2 = collection.find(totalid)
for isused1 in isused2:
isused = isused1["_id"]``` and i have this which basically looks in the mongo db for the id, and it should make the var the _id of it and it returns ``` raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: filter must be an instance of dict, bson.son.SON, or any other type that inherits from collections.Mapping```
@still merlin https://radio.dual.pw/stream.mp3
so I'm using lavalink and i ran into a small issue and was wondering if there a way to prevent the song from stopping midway through? I mean it doesn't stop it just not playing through the bot.
Thanks
can someone personally help on making pages of embeds?
a lot of people suggested using from discord.ext import menus, but I don't understand how to use it
im looking for a vps, which one do you recommend?
which provider? check the pins, there's a few good ones
but on the visual studio code when i insert import discord
from discord import *
@bot.event
async def on_ready():
print("Bot Online.")
@bot.command()
async def Hi(ctx):
await ctx.send(f"Hello {ctx.author}")
bot.run("||YOUR BOTS TOKEN HERE||") this then i insert then how it come online
@drifting wedge make {"_id": totalid} the search filter
aye noice
see im learning
but on the visual studio code when i insert import discord
from discord import *@bot.event
async def on_ready():
print("Bot Online.")@bot.command()
async def Hi(ctx):
await ctx.send(f"Hello {ctx.author}")bot.run("||YOUR BOTS TOKEN HERE||") this then i insert then how it come online
@midnight quarry
?
@midnight quarry dear lord please don't do from x import *
from discord.ext import commands
bot = commands.Bot
P.S. you are using bot when it's a file and not the bot class
@bot.command()
async def se(ctx, emoji: discord.Emoji):
em = discord.Embed(title="", description="", colour=ctx.author.colour)
em.set_image(url=f"https://cdn.discordapp.com/emojis/{emoji.id}.png")
await ctx.send(embed=em)```
how can i get this to pull other Emotes? it keeps saying
```fix
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 892, in invoke
await ctx.command.invoke(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 790, in invoke
await self.prepare(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 751, in prepare
await self._parse_arguments(ctx)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 670, in _parse_arguments
transformed = await self.transform(ctx, param)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 526, in transform
return await self.do_conversion(ctx, converter, argument, param)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 479, in do_conversion
return await self._actual_conversion(ctx, converter, argument, param)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/core.py", line 425, in _actual_conversion
ret = await instance.convert(ctx, argument)
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages/discord/ext/commands/converter.py", line 444, in convert
raise BadArgument('Emoji "{}" not found.'.format(argument))
discord.ext.commands.errors.BadArgument: Emoji ":Cute_Heart:" not found.```
@midnight quarry bro..that's a .cs (C#) file not a .py (Python) file
Also thats not VS Code
How to create my bot for my server
thats VS
How to create my bot for my server
@merry spruce plz tell
yes
yes
@midnight quarry change it to a .py file and download VS Code: https://code.visualstudio.com/
Plz tell anyone
@merry spruce plz tell
@merry spruce plzzzzzzz telll
How to make my bot for my server
How to make my bot for my server
@merry spruce plzzzzz tellllllll
@slender thistle halp
user = get_user
user.send
Plzz
How to get my bot for my server plz tell
How to get my bot for my server plz tell
@merry spruce plzzzzzzz
the command invoker? ctx.author.send
Omg
one of this
o ok ty tho
Can someone address this guy
do ppl like dms?
How to set uo welcome bot
rn im making a bug system for bug reports
like would ppl prefer msg in server or dm?
do ppl like dms?
@drifting wedge if I remember correctly, you have to ask if they are ok with it before dming them
I am leaving
but on resonse?
one of this
@midnight quarry ??
DΒ₯/$
How to set uo welcome bot
@prime frost any one tell
Mc
@midnight quarry ??
@midnight quarry yes
M c
-wrongserver @prime frost
@prime frost
Hey! We think you have our server mistaken. We do not provide support, help, or advice for any bot. You need to click on the "Support Server" button on the bot's page, not the "Join Discord" button at the top of our website. If there isn't a button that says Join Support Server, then we can't help you. Sorry :(
Can someone mute this guy
Mute me
You're just spamming
Anyone is not helping me
Because you asked such a general question
Ok
Ok
@midnight quarry yes
@hollow sedge but who of this
@hollow sedge but who of this
@midnight quarry any of them
@merry spruce making a discord bot requires knowledge of programming and coding
Do you have any knowledge about programming?
now?
That's a rip
@hollow sedge lmao
now?
@midnight quarry ?
@midnight quarry https://docs.microsoft.com/en-us/windows/python/beginners
yes but in the powershell
user = get_user(int(reporter))
would this work?
it said get_user not defined
reoorter is a str passed in the command
but its a number
aka the user id
?
Read the fucking docs
me? alr
which provider? check the pins, there's a few good ones
@earnest phoenix sorry for not answering i was looking at the pins and i think im good with that but thanks
yes but in the powershell
@midnight quarry
- Open Command Prompt
- Type
python path_to_pyfile
oh lmao ok ty
Amen
π
can i search mongo with a int?
yes ok but it come > python path_to_pyfile
File "<stdin>", line 1
python path_to_pyfile
^
SyntaxError: invalid syntax
python path_to_pyfile
File "<stdin>", line 1
python path_to_pyfile
^
SyntaxError: invalid syntax
or just str?
amen
search? what do you mean
spooxico why are you trying to create a Discord bot without knowledge of a programming language
Depends on what your field is set to
if it's integer in the database, search with int
Though
However
hmm
spooxico why are you trying to create a Discord bot without knowledge of a programming language
@slender thistle @midnight quarry
For IDs PLEASE use strings in the database
oks oks
And convert them to int in the code when you need it
o ok
wait so i could have done get_user(int(var))?
if var is a int str
its a int as a str
is it a str or an int in the code
var is something like '123'?
yes
Then yeah using int() on it makes sense
For IDs PLEASE use strings in the database
@slender thistle I know this is late, but why?
async def ba(self, ctx, bugid:str, reporter:int, approvedarg:bool, *,reason:str): would this work? like they are all one arg each
but reason is multiple args
IDs go past 53 bit integer
would this work?
OR int64, I'm very unsure
I'm storing it as a int in mongo, it's working fine
in any case I had issues manually entering IDs into my databases
Sure, code-wise it's fine but you'll be unable to edit it manually properly
I see
I think you need to declare the members intent
Could you clarify a bit please
aye
OK I am under big pressure. My teacher has asked me to write a code (in any language) such that there a bunch of colors that come together and form a painting. It can be pretty simple. What language should I use and how should i do it?
if your bot is verified, it needs to be whitelisted for it
if your bot is verified, it needs to be whitelisted for it
@pale vessel for intents?
surely you can query members without being whitelisted? (I am whitelisted by the way)
for the guild members and member presences intent
only query
you can't fetch them all in one call without it
so if your bot doesnt need that then its fine
my bot needs to grab member ids unfortunately for a given channel
The problem stems from
redirects[cmdObj.category]
which has this error
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ misc: string; }'.
,
I wanted to add types to the values in the obj cmdObj is referring to
I thought that it was by using an interface
so I reconstructed the obj in an interface but the obj has a require() inside of it
I dont know the type for that
im using typescript
https://ramen.is-inside.me/X0RB6Vsp.png
OK I am under big pressure. My teacher has asked me to write a code (in any language) such that there a bunch of colors that come together and form a painting. It can be pretty simple. What language should I use and how should i do it?
@earnest phoenix not sure if that's relevant to this channel..but you could use a canvas (HTML, JS)
why are they making this api so damn convoluted
yes
discord's entire development team is a mess
@earnest phoenix PascalABC
a side effect is that the public api suffers from bad design
its just pretty stupid that you are limiting peoples uses that aren't in 75 or more servers, but the people who don't have that are limited with what the API can actually do possibly making their bots useless
it was put in place because there were a fuckton of bots scraping and stealing data in a huge amount of guilds
user = get_user(reporterid)``` this is what i do to get the "reporter" user object?
reporter is intially a str
they also plan on integrating bots with slash commands in the client so they're putting restrictions in place
that is passed on in the cmd
it was put in place because there were a fuckton of bots scraping and stealing data in a huge amount of guilds
@earnest phoenix yeah, as your bot becomes bigger, there's more regulation. that's just how the world works, not even just discord lol
Can I configure nginx to have separate domains go to different site on the same IP?
yes ^
Then hOw
Ah
I still can't manager to get the members in a given channel using channel.members
even with the intent or whatever
are you using djs?
intents = discord.Intents.default()
intents.members = True
cheers
hello i have a problem with my python bot if there is anyone can help me about how to send photo logs at a specific channel after message deleted i will appreciate it (pm me for help ) π
@storm knot i'm pretty sure you need to call this https://discordpy.readthedocs.io/en/latest/api.html#discord.Guild.fetch_members
then you can access all members
I need to fetch them for a specific channel
yeah i'm aware
members are in a guild, the property on the channel just filters out members that can't view the channel
okk I'll have a look
cheers
members are in a guild, the property on the channel just filters out members that can't view the channel
@earnest phoenix Sorry mate I am still confused - in my function I call the specific channel and loop through gathering the member.ids so I know who can view that channel - what do I need to do for that to work again as all I can see in the channel.members is the bot
await guild.fetch_members()
' now you do your channel code here
this should work
note that there's a default limit of 1000
any no limit methods?
await guild.fetch_members(limit=None)
to get all members in a guild
π
await guild.fetch_members(limit=None)to get all members in a guild
@earnest phoenix For the life of me I cannot get this to work - this is my code that I had prior to the channel:
channel = ctx.channel
for member in channel.members:
print(channel.members)
memberIDs.append(member.id)

you just put the line i sent above that snippet
your function need to be async ofc
I have a problem that stems from
redirects[cmdObj.category]
which has this error
Element implicitly has an 'any' type because expression of type 'any' can't be used to index type '{ misc: string; }'.
,
I wanted to add types to the values in the obj cmdObj is referring to
I thought that it was by using an interface
so I reconstructed the obj in an interface but the obj has a require() inside of it
I dont know the type for that
https://ramen.is-inside.me/X0RB6Vsp.png
Does anyone know the type for that
@boreal iron @quartz kindle @earnest phoenix (sorry if I pinged in a weird time for u) but if u wanna continue the competition @ me
I wonder what would be the easiest way to apply syntax highlighting on some kind of code on a image made from canvas
wait so u wanna highlight code on a picture?
Yea like i got a codequiz command but people cheat by evaluating it easily and answering by copying so i want to put the code on a image so they can't easily copy and but i need to highlight it's syntax as well
If we don't apply syntax highlighting to code in the image it will appear like this
let bruh = "moment";```
But if we apply syntax highlighting to it, it should appear like this as an example
```js
let bruh = "moment";```
ytdl is gone 
What happened to ytdl-core?
can anyone help about how to take the bot image attachment and log it in discord.py ??
What is the bot image attachment? What do you want to log about it (metadata, url, buffer, etc.)? Can you be more clear?
i made a bot that reupload users image that send i a specific channel and the bot delete their message and reupload the content as the bot
but i want to make logs for it
whats the point in saving the attachment?
basically because the bot delete the message and reuplod it i want to log what users send the photo or the message
Around where you create a discord.File instance, you probably want to log there (e.g. print(...)). If you want to get the user, message.author may interest you, which is user in your case.
yes, but you do not need to save the attachment as a file on your computer or vps
how do
And like Cloud said, you shouldn't need to save it as a local file. You should be able to load it in-memory.
does anyone know where i can find a pyline for a command to restart a bot from a channel
i was told i needed heroku
to do that
the thing is that i want the attachment url
@earnest phoenix what is a pyline?
pyline like grep?
"Pyline is a grep-like, sed-like, awk-like command-line tool for line-based text processing in Python."
guess you're right
i want to delete the authors message get the url and upload it again as bot and log it on the discord
if i save it on the memory it will not appear correct
use the requests module to get the file from the url
file_request = requests.get(attachment_url)```
actually idk if that'll work
something like that
..where is it breaking?
You'll also have the attachments object you have in-memory, so I don't see what won't work about it. You save it in-memory so you have the image without saving it to a local file via fetching the image (something like aiohttp since discord.py recommends it for async work).
As for your error, see the documentation on how to create a file object out of a binary: https://discordpy.readthedocs.io/en/latest/api.html#discord.File
^ that sounds more like it mb
wut can i use as a replacement for ytdl core?
discord-player relies on discord-ytdl-core, which relies on ytdl-core
^
but does it work?
?
are you able to play music
can someone explain how ytdl-core is illegal but lavalink isnt
Something something lisence something
Ytdl downloads from YouTube
For free
Normally you need to pay
lavalink has nothing to do with youtube
its a music player
Can someone tell me how to create giveaway command with requirements?
I use Discord.JS
I am first time making gw command so idk how to do it.
that's normal
@split hazel Wait speedy ur here?
K making sure
Didnt realize
hey guys this is the first time of me scraping a website using request-promise and cheerio. I have looked at examples, docs etc. None of them tell how to actually enter the data you want to scrape
i want to scrape those 'eggs'
how would i know what they are named to eventually scrape them?
Im having issues with my chrome extension Could I get some help with an error that not even vltrex can do :pog:
@eternal osprey try using xpath to select your elements
user.send(`You cannot start another game while you have one going!`).catch(err => console.log(err))
This should work to catch if it can't dm a user right?
Yes
You shouldn't log those errors though, because you already know what the errors will be 
catch(console.log)
Uh no that catches no matter what
just .catch(() => undefined)
What?
Just
mans coulds I gets help lmao
Promise.prototype.catch(() => {})```
@solemn leaf I made a chrome extension a couple months ago. What's your question?
Command = Auto Message
Database = MongoDB
Discord.JS = v12
There are no errors in the lines. The problem does not appear. But every time I run the command the database is rebooted and the bot restarts at the same time.
Command (auto-message.js): https://hasteb.in/ayugahex.js
Command (auto-message-remove.js): https://hasteb.in/ogequsul.js
Models/TimeCommand.js = https://hasteb.in/hirimoni.js
Events/Client/Ready.js = https://hasteb.in/aqaqejih.js
@proven lantern
Unchecked runtime.lastError: Could not establish connection. Receiving end does not exist.
what the fuck is this ^^^ above my message
I've never seen an error like that with my chrome extension
Can I screen share in dms
br
let port = chrome.runtime.connect(null, {
name: "mychannel"
});
document.addEventListener('DOMContentLoaded', function() {
document.getElementById('button').addEventListener('click', onclick, false)
const evalText = document.getElementById('evalText');
const div = document.createElement('div')
div.textContent = evalText.value
document.body.appendChild(div);
function onclick() {
chrome.tabs.query({
currentWindow: true,
active: true
}, tabs => chrome.tabs.sendMessage(tabs[0].id, evalText.value, sendCode));
}
function sendCode(code) {
evalText.value = code;
}
}, false);
let _port;
function testConnect() {
_port.postMessage({
msg: "hello from popup"
});
}
chrome.runtime.onConnect.addListener(port => {
console.log("connected to: ", port.name);
_port = port;
_port.onMessage.addListener(processMessages);
_port.postMessage({
msg: "hello from popup"
});
});
(() => {
document.addEventListener("DOMContentLoaded", () => document.querySelector("#testConnect").addEventListener("click", testConnect));
})();
chrome.runtime.onConnect.addListener(port => chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
let evaled = eval(request.toString());
if (evaled instanceof Promise) evaled = await evaled;
return sendResponse({
code: evaled
});
}));
chrome.runtime.connect();
@proven lantern there
hey guys
why does my code refuse to work?
const request = require('request-promise');
const Discord = require("discord.js");
const cheerio = require('cheerio');
(async () => {
const url = 'https://nycpokemap.com/gym.html';
const response = await request(url);
const $ = cheerio.load(response);
let title = $('div[class="leaflet-popup-content"] > b').text();
console.log(title);
})```
it does not when i debugg it.
it just quits seconds after.
bcs yur formattingis trash
thnx
np
could you maybe rather be a bit more helpful?
why you async nothing
i saw in the docs that cheerio needed async functions
and the async wraps the whole function
and i am using await
which can only be used in async function
@earnest phoenix I may be dumb, but is it because you're doing client.emit("ready", client); at the top of auto-message.js?
could I get sme help
@solemn leaf what does the manifest.json look like?
{
"name": "Test",
"version": "1.0",
"description": "h",
"manifest_version": 2,
"content_scripts": [
{
"matches": ["http://*/*", "https://*/*"],
"js": ["content.js"]
}
],
"browser_action": {
"default_popup": "popup.html",
"default_title": "Testing"
},
"background": {
"scripts": ["background.js"]
}
}
is background.js the script using chrome.runtime.connect?
chrome.runtime.onConnect.addListener(port => chrome.runtime.onMessage.addListener(async (request, sender, sendResponse) => {
let evaled = eval(request.toString());
if (evaled instanceof Promise) evaled = await evaled;
return sendResponse({
code: evaled
});
}));
chrome.runtime.connect();
i think only background scripts have access to chrome.runtime
I wouldnt know
@solemn leaf this answer might help
https://stackoverflow.com/questions/54619817/how-to-fix-unchecked-runtime-lasterror-could-not-establish-connection-receivi#answer-60323713
Wow
client.on(`messageReactionAdd`, async (reaction, user) => {
user.id is undefined?
When I react
He's trying to help you and you say "stop trying"?
Partials are enabled
lol
Maybe because you need to get the reaction and the user?
Nvm
That's weird
Why is it a string tho
wtf
The ID is too large for JS to accurately represent as a number btw.
I console log at the top
That is weird
The ID is too large for JS to accurately represent as a number btw.
@sudden geyser ah I see
and it outputs the ID
The scopes aren't messed up
I literally console.log the line above and it works
hmm
When you do console.log(user.id), is that's whats undefined? Could you reiterate your situation
Cannot read property 'id' of undefined
I console.log(user.id) right above that line and it outputs the ID correctly.
change to arrow function
Same thing
dang
Not the problem
did you change the function that is passed to the first connection.query?
Yes
@blissful coral could it be coming from reaction.message.id or reaction.guild.id?
I checked lines
It is the line I showed you
It isn't a partials error
hmm
Weirdest error I have ever had ngl
If you were able to log the user ID at the top, it's not coming from user.id where you're pointing at.
Look at line # s
That is the whole event
Top to the error
I found it
wtf
is this
error handler cough cough
if (error) {
error.fix()
}.catch((error) => {
error.fixHarder()
});
you promise you changed the function on line 82 to an arrow function?
@blissful coral boom error fix
ben keep giving me links I already looked at 5 hours ago

Wow you treat the people who try to help you very nicely
Who tf asked you
People are not obligated to help you
ik they arent
So be thankful that someone wanted to help you
Who tf asked you
@solemn leaf wow I haven't heard that one before
@blissful coral was the error reaction.guild.id
how do i send 2 embeds as one message? dpy?
Why is it that when I create a new column in my better-sqlite3 table
stmt.run();
The value can be changed to integer or a string
0Exe I don't think you can do that unless you're using a webhook.
How do I remove a reaction from a certain user in the reaction event
reaction.remove(user.id)```
is not correct
its in docs
I couldn't find the correct one
await it?
it tells you properties in a reaction
That removed all reactions.
its in docs
Link
Yeah ik
.>
you use discordpy?
client.on(`messageReactionAdd`, async (reaction, user) => {
await reaction.remove(user)
}```
No
Djs
reaction.users.remove
How do I make an array to ban the ids?
Add each ID to the array, then iterate over every element banning the list of users you want.
how were they doing xd? @sudden geyser
wot
As arrays are created, never use .-.
So any answers to this?
#development message
take highlightjs code and adapt it to image generation
How's that gonna be converted into an image so it can be highlighted
i
i didnt mean that lol
i said adapt it for a reason
take the logic that recognises language syntax and adapt the coloring to be done in image generation instead of html elements
there's also the lazy way of just screenshotting a page that has hljs with puppeteer
Well puppeteer doesn't work on my host
Well lemme try something
Hi
Does anyone else immediately decode any base64 hashes they run into
My bot's presence has disappeared (e.g. "Playing on X servers"). Any ideas why this happens and how i can fix this? I use discord.js and set the presence every time the bot joins a new guild. Also, is it not recommended to update the presence on every guild join?
@karmic arrow I just do a setInterval every 4 hours once the bot gets the Ready event
My bot just hit 75 guilds, I submitted the application for verification. Now it's already at 79. What if it hits 100 before it gets approved?
Will it be able to join more servers?
@faint prism ok thank you, i was thinking of doing something similar. Does the status disappear if not regularly updated after 4 hours, or is there another specified time limit?
I just found that 4 hrs seemed to be a good amount of arbitrary time. Since my status would disappear sometimes twice a day
@earnest phoenix idk if you found an answer yet but you may be able to use highlight.js
its a huge stretch
but you can go here: https://github.com/highlightjs/highlight.js/blob/master/src/styles/default.css
- Make a dict of styles (colors) to replace the highlight.js stuff with
- Highlight code with highlight.js
- Replace what highlight.js added with your matched styles
idk that might be a terrible way of doing it
I just found that 4 hrs seemed to be a good amount of arbitrary time. Since my status would disappear sometimes twice a day
@faint prism Just to show u a different way...
Iβm using a timer every 60s calling my updatePresence function.
Instead of updating the presence every 60s the function compares the current amount of guilds to a var.
This var got itβs initial value in the READY event (guilds.length)
If current amount of guilds = my var the function just returns.
Only two events will change the value of my var:
GUILD_CREATED (var++), GUILD_DELETED (var- -)
At the end the timer will update the bots presence every 60s only if the amount of guilds has changed (after the ready event)
My bot hasnβt lost his presence ever, not within a few hours or days/weeks of runtime
(Watching XXX server)
Or I do it every four hours. It's just a help prefix for mine, so eh
Sure itβs just a different way to keep the status up to date just in time.
if your looking for something free
..
No
Its not good
Heroku is horrible
Use galaxy gate cheapest vps
this isnt among us-
Ofc not?
It is not
Lol
you are right
Use galaxy gate cheapest vps
@blissful coral Are you talking to me?
No
Use galaxy gate cheapest vps
@blissful coral wtf is that
mmm ok
The best vps
.
o.O
Free ban
mhmmmmmm
No you didnβt
you sure?
Your trying to cover it up
π ive seen 8 year olds on here its not as bad
Im allowed to ping staff for this right?
Thats what I meant lol
@lilac gorge bruh do u even know what it is
@loud geyser can u stfu thanks
Stop toxicity
Time to waiot for mods Ig
soryyyyyyyy
Should follow tos :)
..
is python the best coding language
ok
ease of use is python
wAlP
There's no one best programming language.
i got tomato juice on me nooooooooo
A language has its pros and cons.
doesnt yag bot use python
yag.xyz? or whatever it is
ye
rip
Not on top gg
okay i shall finish coding and my tomatos
hm
they took it off i think
Yes it is python

yag isnt on top gg because it has its own website π
@lilac gorge it could still be on top.gg
Ik
As in they could still list it with their website connected to their bot's page
Ik but, they didnt want it on the website
Where did they say that
Are you in the support server π
Nope
YAGPDB.xyz is not built with Python. It's built with Go.
@tame kestrel instanceof lol
wot
@tame kestrel https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/instanceof
like what I'm trying to do is compare two objects and get the differences in properties
// input
const a = { prop1: 2, prop2: 2 };
const b = { prop1: 3, prop2: 2 };
// output
// {prop1: [2, 3]}```
hmm
At the moment I can just loop and manually check, which I guess is the best way
well yeah @solemn leaf
ye
function deepDif(first: Role, second: Role) {
Object.keys(second).filter((roleProp: string) => {
return !isDeepStrictEqual((first as any)[roleProp], (second as any)[roleProp]);
});
}```
cool
Let me strip it of ts real quick
lmao
function deepDif(first, second) {
Object.keys(second).filter((property) => {
return !isDeepStrictEqual(first[property], second[property]);
});
}```
is there any better way of doing this?
did you..even look at the link i sent?
I was getting around to it
yeah do
The idea behind it is similar, looking for the intersection of keys
it basically follows that I wrote, so I guess what I have is about as good as it gets
gl
you may want to checkout the newest answer to that: https://stackoverflow.com/a/64344583/14056792
seems to be different from the other ones
I think the efficiency comes from doing the list with the least amount of properties, but because I am not using intersecting keys, I have to do every property
If anything, both objects are expected to have the same amount of properties, just changed values
For dpy on member leave or on member remove, what difference
?
For member leaving
the guild member leaving via Leave Guild vs. being removed via kick/ban/etc.
I donβt think so
Not In my experience
Itβs just been on member remove
But my logs broke
there's no on_member_leave
Yes
Mhm
@sudden geyser on_guild_remove is when you are removed from the server
Safe I don't think trying to pick the one with the least amount of properties will help as it should short-circuit as soon as one field isn't equal
To check that
You cannot specifically determine if a user left or was kicked via the event alone
Sadly
Thats one way to do it
A bit
I run a flask app
@hollow sedge there's only on_guild_join and on_guild_leave and those only apply to the client, not a user.
IMO python is the best, its ez to get a hang but can go a long way
@sudden geyser no? there is on_guild_remove
Safe I don't think trying to pick the one with the least amount of properties will help as it should short-circuit as soon as one field isn't equal
@sudden geyser The goal is to weed out objects with non equal properties
Yes but no on guild leave
bad wording of mine 
bad Lite
Why isnβt this server partnered?
Huh
O ok
When using this command I get an error like this but the command works
send is undefined
understood thanks
Haha
hi I'm trying to think of a place where I can host a webhook server for free in order to receive webhooks from the dbl api
does anyone have any suggestions?
right now I'm thinking of using an ngrok server on heroku, where my bot is currently hosted
I am not sure if that would work though
if you haven't registered for AWS before you can run that for free for a year. if you use the free tier ec2 instance
hm okay


he doesn't know


