#development
1 messages · Page 1751 of 1
Because I didn't update those docs yet
bruh moment
this thing doesn't work for some reason
I don't use python anyways so

even more of a bruh moment
teach me python then đ„ș

đ„ș
class Link:
def __init__(self, languages=None):
if languages == None:
languages = []
self.languages = languages
def know_language(self, language):
if language == 'python' and language not in self.languages:
print("shivaco teach me")
languages = ['js']
link = Link(languages)
yeah
Sure, iframe
and it will still run the JS code on my site?
they wont support it soon
And I assume you subclass commands.Bot, yeah?
u talking to me?

discord.py 1.5.1
the version
of d.py
ara ara
Ara ara~
just checked this thing wasn't there before updating
it seems like it does now
also its a bit annoying since I need more text
lol
Yeah because it didn't exist 
đ
nah Veld and Hope are much more pog /j
i want autograph
, Veld â yes, Hope 
ugh, the iframe is too short of text to be in long desc
Ah man, implementing a rest client that conforms to Discords rate limiting specs is a headache lol.
They help if you use an IDE
they also just make your code not look wack as hell
but yes thank you
you should still fill up the content of your iframe with text so you can be searched properly
if ur pro, just code in nano tho
@woeful pike Help
.........
look up how to embed link in html
what i mean is
<iframe src="https://sorinorpgbot.tk" title="SorinoRPG Discord Bot"></iframe>
this in itself is too small
Yup
yes, you should have content in your long description that should be searchable
you can fill it up with garbage if you want but that's not gonna help your seo
What do you recommend?
<iframe src="https://sorinorpgbot.tk" title="SorinoRPG Discord Bot">
Brief description here that will be visible if your iframe doesn't work on the user browser
</iframe>
thats great, thanks xetera
@woeful pike Hi How Do I Link My Stylesheet To The Html On The top.gg description??
Look It Up Dude You Dont Have To Ping Me For That
lmao the caps
One message removed from a suspended account.
One message removed from a suspended account.
2nd Ping lol
Are there any chances that <Message>.guild.shard can be undefined
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
One message removed from a suspended account.
@sage bobcat on one server of my Bot it is undefined
One message removed from a suspended account.
and someone said it shouldn't be undefined
slap a catch on it and call it a day
One message removed from a suspended account.
at least that's what I would do
Well I tried to force Reconnect on vc on that server got memory leaks + 429 from discord
So I don't really want to supress it anymore
Yeah
It is
It never occured to me before but from past few days it is occurring
Even if a bot doesnât have shards set up, it shouldnât return undefined. It would return 0 as in shard 0 
My Bot has 5 shards running on 2 clusters
Are you using Kurasuta for sharding or smth
Yeah Kurasuta
Hmm
If you try evaling, does message.guild.shard return undefined in other servers too?
Maybe itâs different for Kurasuta
Does the master process do things differently?
What do you mean by that?
Html and css
Yeah but what do I use to do so?
You need to use some CSS, though I havenât tried it myself yet. Maybe I should đ
Lazy though 
like, what are the classnames so I can change the colour
Node's clustering has a master process, and the child processes sit under the master.
I haven't looked into how kurasuta is implemented, so I'm just guessing :)
Maybe Ask Yukine he is here
ill figure it out when i get home from school ig
This is all I found https://css-tricks.com/snippets/css/a-guide-to-flexbox/
Couldnât really find a guide for a top.gg bot page
Our comprehensive guide to CSS flexbox layout. This complete guide explains everything about flexbox, focusing on all the different possible properties for the parent element (the flex container) and the child elements (the flex items). It also includes history, demos, patterns, and a browser support chart.
thanks
bye for now

oke how do i get rid of default help cmd in d.py?
self.bot.remove_command("help")
i did this thing but still it doesn't work
@odd stratus@prime mistI just found the server id where <Message>.guild.shard is undefined that server is not even part of any <Client>.shard
bot = commands.Bot(command_prefix=(get_prefix), help_command=None)
Tried
but didn't work
idk what to tell you, that's how you do it
this is highly unfortunate
what was the error?
So it's in some kind of REST API only mode?
So is this still an issue for you? Don't really.know enough about your environment to comment further.
It's not even in my cache I wonder how am I able listen to the messages of that server
It was working all good before I updated to d.py to 1.7 or changed the help cmd
even after removing cmd it sucks
does type predicate in ts, works for getters?
why wouldn't it
Hello
I assume your class looks like this
class MyBot(commands.Bot):
wonky
i heard Heroku provides 512 mb ram, is it correct???
do you have 2 instances running at the same time?
Who want to make a bot with me? Im 13 years old child
probably on their website
the isForb works, but isForbidden doesn't
no
oke so i'mma change the bot token
lmao don't think that'll work
cuz shit got fixed automatically
well then it doesn't
wait really
why not just return boolean?
so i doubt if anyone else has got my token
then this will remain parent class of Forbidden
Did it fix it? also how are you passing intents through?
yeah it fixed
lmao wack
intents.members = True
intents.presences = True
intents.guilds = True```
case_insensitive=True, strip_after_prefix=True)
I meant are you passing it to def __init__(self, ...)
yes
why do you have to manually switch those 3 intents?
isnt .all() supposed to include them?
dunno it wasn't working with all
lol
it sounds like there are a lot of wack issues with your bot
yeah u right bro
not ur fault as far as I can see, but still wack
wack wack

package com.example.myapplication;
import android.os.Bundle;
import androidx.appcompat.app.ActionBar;
import androidx.appcompat.app.AppCompatActivity;
import androidx.preference.PreferenceFragmentCompat;
public class SettingsActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.settings_activity);
if (savedInstanceState == null) {
getSupportFragmentManager()
.beginTransaction()
.replace(R.id.settings, new SettingsFragment())
.commit();
}
ActionBar actionBar = getSupportActionBar();
if (actionBar != null) {
actionBar.setDisplayHomeAsUpEnabled(true);
}
}
public static class SettingsFragment extends PreferenceFragmentCompat {
@Override
public void onCreatePreferences(Bundle savedInstanceState, String rootKey) {
setPreferencesFromResource(R.xml.root_preferences, rootKey);
}
}
}
Working on a calculator be like
How do I define
client.giveawaysManager.start
@frigid mountain I think you should look at the discord.js documentation to see what properties and methods exist within the client object. giveawaysManager is not a thing by default and you will have to develop such a thing yourself. Here the documentation for discord.js: https://discord.js.org/#/docs/main/stable/general/welcome
could you log out client.giveawaysManager
do client.giveawaysManager = your_giveaway_manager
K
@frigid mountain Are you trying to use this package? https://www.npmjs.com/package/discord-giveaways
I have used that before
i cud give code
you need to store the data somewhere
mongodb is not the only option
there are hundreds of storage solutions and databases out there
sql pog
Time to.store in json
Na use excel file format.
use discord messages
thats actually a thing
Tim you use js right?
ah you probably can't help me with Advanced Python Scheduler then
Hmm surely that would be eventual consistency right? That seems like it would be slow hah
ye xd
Better than a SOAP API I guess.
anything is better than soap at this point
I vote for storing in JSON lol. Google sheets seems like opting in for an extremely painful experience.
I use google sheets to store data, but solely for humans to read it, not bots
Yeah Google sheets is great at what it does, much better than the Microsoft stuff :)
google shit sucks if the file is too large
for example i tried printing an excel file to a pdf file that would result in about 900 pages
tried in multiple browers, it would always get stuck and fail
i tried doing it on sheets because the fonts were weird in the actual excel
in that particular case, web fonts were doing a better job than system fonts
the same way as you use normal emojis
bots dont care about nitro
Like this :emojiname:
<:emojiname:emojiID>
Oh ty
the bot must be in the server where the emoji comes from tho
and must have external emojis permission to use it in other servers
How do I get emoji ID
â
are u on a mobile phone?
Mobile
yea u will need a pc
Oh
mobile should still be the same
:ytho:
naa it doesn't give code on mobile
try using it in chrome using desktop site
ohk
btw
is there a way we can fetch a number of messages in channel without a time limit
like I want to wait till I get 20 messages, then do a particular funtion
like the bot waits until it gets 20 msgs
you wouldbt be fetching tho, you would be waiting
no timeout
yeaa mb
but how do we wait for msgs
yes
but the number of msgs to wait for wont be the same everytime
read that
yea but theres a timout right
all the options are optional
np
@earnest phoenix
how can we check if a message contains a user tag?
Which language you are using?
js
You can use message.author.tag

i am not asking that
I want to check if theres a tag in any message a user sends
and the tag could be anyone from the server , not just the author
So you wanna know from which server and who sent the message?
Ah
wait i'll give an eg
ok
i wanna check if the messages sent in a particular channel has tagged someone
Oh wait a sec lemme try
yeah mentions
try this then
yeah but if i do something like this
const filter = m => m.content.includes(message.mentions.users);
will it work?
no
thats what i wanna check
message.mentions.users is collection of mentioned users
you can check it with message.mentions.users.size
so i can get the mentioned users using that ri8
ohkk cool
What are the difference between rich embed and a normal embed
nothing
Hmm
normal embeds cannot have fields iirc
isn't it same thing
Nah. It will have
RichEmbed got renamed to MessageEmbed in discord.js
Oh
"normal" embeds are considered rich embeds
the messed up with names
File "c:\Users\pc\projeler\bot\bot.py", line 540, in <module>
async def _redd_t(ctx, subreddit):
File "c:\Users\pc\python\lib\site-packages\discord_slash\client.py", line 570, in wrapper
obj = self.add_slash_command(cmd, name, description, guild_ids, options, connector)
File "c:\Users\pc\python\lib\site-packages\discord_slash\client.py", line 403, in add_slash_command
options = manage_commands.generate_options(cmd, description, connector)
File "c:\Users\pc\python\lib\site-packages\discord_slash\utils\manage_commands.py", line 219, in generate_options
option_type = SlashCommandOptionType.from_type(param.annotation) or SlashCommandOptionType.STRING
File "c:\Users\pc\python\lib\site-packages\discord_slash\model.py", line 281, in from_type
if issubclass(t, discord.abc.User): return cls.USER
File "c:\Users\pc\python\lib\abc.py", line 102, in __subclasscheck__
return _abc_subclasscheck(cls, subclass)
File "c:\Users\pc\python\lib\typing.py", line 1171, in _proto_hook
raise TypeError("Protocols with non-method members")
error
i can't help you without the code ._.
@quartz kindle i blame u for this
why did nobody tell me presences WILL absolutely destroy your soul?
presence it's so expensive, that's known ;-;
like wtf
im gaping rn with the sheer amount of load it put on the cpu
no wonder my bot was using 120% cpu all the time
i have a 8GB ram 2 core 3.77GH/z
with presence it use like 40% of cpu
without presence, 2-12%
lmao
äœ
im legit getting 70-100k ish depending on hour, per minute
i've seen it spike to 150k per minute before
i'll have to process the presences somewhere
can that work ?â
asking a friend some help about it
cuz worker_threads is not my area
speaking of help
@quartz kindle wanna help me figure out worker threads and perhaps spam discord like i did with twitch?
we all know what happens when i touch things that CAN break
murphy's law loves me
wut u wanna do
i wanna start new clients in worker_threads and then reemit the ones that have been processed back to the main thing
same deal from last time we chatted
basically using worker_threads as filter
to not clutter the main thread
how do you wanna do it?
one worker for all shards, or multiple workers with a few shards each?
one worker would be easier to start with i guess, and see how it goes
what
guys, any cool idea for currency system?
one worker per shard
reading the docs for worker_threads already
make your users trade real money for virtual currency
one worker per shard is too much
totally a good idea âąïž
i doubt it tbh
NOICE
32 cores
unless you do some stupidly heavy processing in a single thread
which i kinda am

one thread is already capping at 120%
having a thread handle a whole shard doesnt seem too bad
@opal plank how u did your bot appear in your account?
a what
Integrate your service with Discord â whether it's a bot or a game or whatever your wildest imagination can come up with.
what im confused is to why its not updating
So, what that code thing using args thats like:
.disable *something here*
Then its like if('message', args[1])
or something. I am so tired lol, 7am and no sleep.
Let's just define it as a command inside a command.
.disable mod/tickets
How would I make the start of it?
like the
}```
Portion
Everyone probably like tHiS gUy MaKeS nO sEnSe 
I Need the bot ti be verificated?
no
just compile in c#
the stuff they got there is basically copy paste
Imagine someone answers my question 
what u want
Scroll^^^
oh for js or py
js
That's fine.
help
I will customize it and make it suitable to my needs.
(node:103) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 26 unhandledRejection listeners added to [process]. Use emitter.setMaxListeners() to increase limit
what is this
error
@earnest phoenix are you asking, like, how to create a per-server database system?
Noo, like args
It means you created 26 unhandledRejection listeners, probably inside a loop or another event
oh, uhm, just split the message into arguments, then
People use .help <command>
Thats what im asking how 
cn we fix it
yes you cn
omg, I am so tired đ€Ł
remove it from the loop or event
pls help
I can't do it for you.
Start by locating where that handler is
looks like process.on('unhandledRejection', ...
c#, works Only with the desktop version?
i believe so, cuz it has to detect discord running
I cant lol, I dont want my Intel Pentium to Explode lol
you like brother and sister pls help me my bot in 200 servers in crash pls help me plssss
đ
read this
and the message after
stop acting like a petulant child in the middle of a meltdown, and use your brain
i ma only 14 so i am a kid
đ i got lots of dm
complain
ok well
as long as you're freaking out and flailing your arms around nothing's going to happen
w
I'm literally trying to help you
i cnt under stand
Start by locating where that handler is
looks likeprocess.on('unhandledRejection', ...
use the search feature in your code
... do you not, like, understand what I'm saying?
if you can't grasp the simplest of concept I can't help you
Does }).listen(8080); look even CLOSE to being process.on('unhandledRejection', ... ????
XD
no
I cannot help you if you do not have a basic grasp of the english language, or are unable to follow simple instructions
So stop pinging me unless you intend to start listening to me.
ok bhie
hmm
im learning from observing performance stats of triviabot, that economy bots are somewhat responsible for most of the abusive spam against bots on discord
seems they bring out the worst in idiots who like to spam commands several times a second in hope of getting more coinage
if(message.content === message.content){
if(message.channel.type === 'dm'){
if(message.author.bot) return
const uuid = 0101
const input = message.content
fetch(
`https://api.monkedev.com/fun/chat?msg=${encodeURIComponent(
input
)}&uid=${uuid}`
)
.then((res) => res.json())
.then(async (json) => {
return message.channel.send(json.response);
})
}
}
})
Error
wtf is that
if(message.content === message.content)
the indentation
the fact there theres no .id there
I mean, you have to make sure 1 equals 1 right
what am i looking at
you have to prove that

dont you dare bring logic into here feud
you're right sorry
they just posted that and ditched

i wonder if people are actually looking for help or just to troll
that indentation tho
I dunno I don't think their troll was very successful
Hmm
everything about that is cursed
sort of code that the more you look at it the more you need eye bleach
this ^^
That was chat bot code
lol
wait, you somehow managed to run a bot with that?
.then(async =>
that was chat bot code that would get you fired as a developer, were you paid for it.
Its working but sends error too
every line of that code deserves a written warning
the errors isnt even coming from there
you do know that right?
.id of null, theres nothing in the snippet you provided with .id in it
if you wondering why we are surprised at wtf that is
to be fair I'd be triggered even if this was the code that caused the error
im triggered by the fact that this somehow ran
lel
what do you need
yes
how to get the detritus-gateway to be spawned inside worker_threads and reemit the events that have been filtered back to the main thread
i got half of it
idk anything about detritus gateway
but i assume it has a way to set shard id and total shard count?
gonna use this, per recommendation https://nodejs.org/dist/latest-v16.x/docs/api/worker_threads.html
yeah
so, the way evan told me to do it is to basically spawn a worker threat with that gateway client in each of them
and pass in the shardId + shardCount
yes
so basically spawn a worker_thread for each shard i got
yes
and then the rest looks something i already done with fork
with process.message()
actually
no
this doesnt use process to send messages
yes, with threads its thread.postMessage() and parentPort.postMessage()
MessageChannel() seems to be what i'd want
and use setEnvironmetalVariable?
im not sure how i'd be passing arguments to them
you can use env to pass the shard data

hmmm
thats new to me
when you create a worker, you can give it a workerData object in the options
both 2 things im stuck at:
it seems that worker threads also runs off a file
this obj will be available inside the thread under worker_threads.workerData
and the second thing im stuck at is how to send it stuff that i can pull from the file its spawning
oh
oh so this is what that was
i've read it, but didnt understand jack shit
yes
i thought you needed to create a MessageChannel for that
the example above is using the same file for master and worker
you can use isMainThread for that
but if you use a separate file for the workers, you dont need any of that
in my case i'd be using another file, for organization sake, but that bit is fine
okay, so worker data is figured out
now how to run them with ts is another issue
with fork i had custom arguments
so in the second file, you do ```js
const { parentPort, workerData } = require('worker_threads');
console.log(workerData);
parentPort.postMessage("im alive")
yes, you dont need args
everything you need to send to the worker at launch, you put it in the workerData object
aight thats fine
so
do i need them to be assigned to a variable like i did with twitch?
the way i see u posted there is that it always will have access to teh parent
since im just emitting everything into the parent
instead of
the main process needs to store a reference for each worker yes
to run with ts, apparently you can do this ```js
// worker.js
const path = require('path');
require('ts-node').register();
require(path.resolve(__dirname, './worker.ts'));
// worker.ts
import { workerData } from "worker_threads"
...
// main.js
new Worker("./worker.js", {workerData: ...})
const {Worker} = require('worker_threads')
for(let i, i > 4, i++) {
const worker = new Worker('', {data:shardId});
worker.on('message', (data) => {client.emit('MyCustomEvent', data)});
}
//i can do
const {ParentPort, Worker} = require('worker_threads');
for(let i, i > 4, i++) new Worker('', {data:shardId});
ParentPort.on('message', (data) => {client.emit('MyCustomEvent', data)});
so i could do this instead?
would they all be emitted under ParentPort?
the second part makes no sense
rather than having to assign each worker
you are creating workers inside workers
if i create a MessageChannel does it not get automatically assigned to the main thread?
rather than having to register an event for each worker?
// main
const { Worker } = require("worker_threads");
for(...) {
const worker = new Worker(...)
worker.on("message", data => client.emit(...))
}
// worker
const { parentPort, workerData } = require("worker_threads");
shard.on("raw", data => parentPort.postMessage(data));
okay that makes sense
let me try that rq
also, worker threads exit when main thread closes right?
yes
so i dont need to map them somewhere to close em on exit
they dont "exit", they die
i see
like pulling the plug
yes
welcome to the OG way of naming your workers
oh makes sense
master/slave terminology
i couldnt give 2 shits about people who bring potilical arguments to nomenclature that has been this way for years

its programming naming either way
cant even make a good argument
20 years ago we were setting old IDE hard disks to master mode or slave mode by placing a jumper switch
One message removed from a suspended account.
you need to store a reference to them if you ever want to send a message to them, or do any sort of eval function

do i need that tho? they basically only exist to give me presences
no you dont need it
otherwise i could make a controller like i did in the example above
would you happen to know how reliable mongodb is? and if it's not would you know a db to use or learn in order to store data easily but efficient?
mongo is really good and reliable
all dbs are reliable if used correctly
there you go
alright
oho
theres an eval on workers?

let me go with ur route to pull them tho
cuz .ts
no there isnt built in eval
is there an easier database to use or are they all equally tough?
they are all different, some simpler, others more complex
i personally find SQLite to be very simple
agreed
ill work with that then thank you
haha very funny
lel
json database has joined the chat
json database has been banned

2/10
What I need for invite tracker?
from random import randint
flips = int(input("Flips: "))
h = 0; t = 0
for i in range(1, flips):
if randint(0,1) == 0 :
h+= 1
else:
t+= 1
print("======")
print(f"H: {h}")
print(f"T: {t}")
print(f"P: {round(flips/(h if h > t else t), 4)}% to land on {'h' if h > t else 't'}")
print("======")``` code review time
7.8/10 too many print statements
you need to give a js file to the worker
it wont run ts files
the trick is to give it a js file that runs a ts file
that's a bit confusing
i did this
wont this resolve it?
Could form one f-string
Multiline string even
h = sum(randint(0, 1) for _ in range(flips))
t = flips - h
:mmulu:
lmao would there be a significant performance change though?
Dunno lulw, haven't tested it
Well, import timeit here I go
I'm curious 
Printing the results was a bad idea
Lmao, how many iteration was it
The default value is like a million iirc https://puu.sh/HHmcG/0557ac7ed7.mp4
show worker.js
even when i put .ts in the worker file path it legit doesnt output anything
right here
thats ts
then you need to create one
it needs to get compiled before with ts-node
i thought ts-node would transpile first
and then it'd have a worker.js in there
that'd fit more for bennett
try the trick i showed you before
thats what im doing
h o w
1 server, sole user
have you not updated your client?
its the bot's api thats in maintenence
that's old blurple
and have the js file load the ts file
correct
so thats a js file, that when executed by the worker, will require a ts file with ts-node
what im confused is that im getting no errors nor messages
absolutely nothing in console
even though it should be looping
NOOOW we getting errors
exdee
implicit any 
looks like it's from another file cause line 18 doesn't have packet
its probably compiled
then i've got no clue
it says its from _worker.ts
im at _worker.ts
and it has types
and i even slapped a //@ts-nocheck above
@earnest phoenix lol this is rather interesting
>>> timeit.timeit("flips = 100\nh = sum(randint(0, 1) for _ in range(flips))\nt = flips - h", setup="from random import randint")
128.98641730000003
>>> timeit.timeit("flips = 100\nt = 0\nh = 0\nfor _ in range(flips):\n if randint(0, 1): t += 1\n else: h += 1", setup="from random import randint")
103.92398380000009
Built-in fuction sucks 
Probably because sum iterates over the generator after you create it
And Exe's method iterates once and works with that
lmao
I'm not sure how Python generators work though so I'm not the one to make definitive statements here KEKW
What if it was a list instead of a generator, ah either way, it'll have a small overhead
You know what
Million iterations takes too much time
I'll reduce it to like 10k
>>> timeit("flips = 100\nt = 0\nh = 0\nfor _ in range(flips):\n if randint(0, 1): t += 1\n else: h += 1", setup="from random import randint", number=100000)
9.653332100000004
>>> timeit("flips = 100\nh = sum([randint(0, 1) for _ in range(flips)])\nt = flips - h", setup="from random import randint", number=100000)
10.0970954
>>> timeit("flips = 100\nh = sum(randint(0, 1) for _ in range(flips))\nt = flips - h", setup="from random import randint", number=100000)
12.006130599999999
Yeah, a list seems to make it faster
Interestingly enough, doing sum(tuple(...)) in 100k iterations did better than the generator
>>> timeit("flips = 100\nh = sum(tuple(randint(0, 1) for _ in range(flips)))\nt = flips - h", setup="from random import randint", number=100000)
11.21687700000001
Hello, I come to you because for a few days now, an error appears on my bot and its causes a reboot of the bot, I do not know how to fix this despite some research on the web. Can anyone help me?
Error: read ECONNRESET
at TCP.onStreamRead (internal/stream_base_commons.js:209:20)
Emitted 'error' event on Connection instance at:
at Connection._notifyError (/moon/node_modules/mysql2/lib/connection.js:225:12)
at Connection._handleFatalError (/moon/node_modules/mysql2/lib/connection.js:156:10)
at Connection._handleNetworkError (/moon/node_modules/mysql2/lib/connection.js:169:10)
at Socket.emit (events.js:376:20)
at emitErrorNT (internal/streams/destroy.js:106:8)
at emitErrorCloseNT (internal/streams/destroy.js:74:3)
at processTicksAndRejections (internal/process/task_queues.js:82:21) {
errno: -104,
code: 'ECONNRESET',
syscall: 'read',
fatal: true
}
So to make sure no data is cloned
My dumb ass decided to work with __dict__ in dunder methods
cant help you with ts
@opal planklel
wtf is this
sorcery
const workerTs = (file: string, wkOpts: WorkerOptions) => {
wkOpts.eval = true;
if (!wkOpts.workerData) {
wkOpts.workerData = {};
}
wkOpts.workerData.__filename = file;
return new Worker(`
const wk = require('worker_threads');
require('ts-node').register();
let file = wk.workerData.__filename;
delete wk.workerData.__filename;
require(file);
`,
wkOpts
);
}
Exdee, if you've assigned the dict to its __dict__, you're already working with __dict__ in most dunder methods, indirectly 
sankyu
Are slash commands possible with discord.py?
they should be
ok thanks
Do anyone know how can I extract rhx_gis
For Instagram
I'm using python
it's a known issue
I checked it but..
I'm amazed that's still open
i kinda don't get how to implement it
what should i pass in html parameter
def _extract_rhx_gis(html):
I have absolutely zero fucking clue what to do so yeah
same here
i tried each of the fix from there
but apparently i don't know wtf is happening
import string
import hashlib
import random
class MyClient(Client):
@staticmethod
def _extract_rhx_gis(html):
options = string.ascii_lowercase + string.digits
text = ''.join([random.choice(options) for _ in range(8)])
return hashlib.md5(text.encode())
``` I guess
I'm not sure what to do from there
Try that I guess
umm.. so what i did now is commented the part in lib from where it was raising the error
hey, i need some help regarding discord.py bot
ask
i just hosted a bot on heroku this morning and i made changes to the code now, how do i update it on heroku?
What did you comment out lol
deploy the bot again
ah alr so i override the function
with this thing
and it worked
ah no
At some point I wonder if you're just better off writing your own wrapper
lol no, i just comment the codes or override them in libs
FUCKING
@quartz kindle
check this shit out
this somehow works
even though ts-node compiles all those files
and brings them to the outDir
just like the fs module it uses the root folder as base
instead of where its called
absolutely retarded
so now i gotta add another retard to the mix that acts different from everyone else
require() uses its own file as base
fs uses main root folder
and Worker uses workspace

fuck this
im done coding for today
and yes, i did get it to work
yeah ty
hey
client.on("presenceUpdate", async(client, oldPresence, newPresence) => {
const soutiens = client.guild.roles.cache.find(role => role.id === "839894783928696893");
if (newPresence.activities[0] && newPresence.activities[0].state.includes(".gg/candys")) {
newPresence.roles.add(soutiens)
} else {
newPresence.roles.remove(soutiens)
}
});
activities is undefined
:/
Ive visited a website, and I want to download all its images and svg files.
How do I do that
I'm in the network panel in chrome dev tools.
and can see all the images.
activities is, or activities[0] is?
users dont always have an activity.
activities can never be null
yes but, how to detect user statut?
like my statut
You could go to the network tab and download all images / svg files there or you could write a script which does it for you
nooo, detect if he has a discord.gg in his statut, like me
If the site is static you could make a HTTP request to get the body and then extract all img tags via cheerio or htmldom#
also here
how, to, where to start? There is an option to export .har file also. what is that
thats what i just linked to. status's.
activities is like "listening to spotify"
oh, but how can I detect so?
Do you want to write a script to do it or are you doing it manually?
use status, linked above
yeah, i want the script, for sure
status is for online, idle, etc...
What's the site if you don't mind sharing?
https://www.chess.com/variants/chaturanga Iwant to download all the pieces. which are encoded in base64 svg files
Play Chaturanga online at Chess.com! The Indian game that evolved into chess, with elephants and ministers. Ready to try our new chess variant for free? Come on!
I'm assuming you want to get the chess pieces?
yes
those are dynamically generated so you'll have to use something like puppeteer
All chess pieces have a pc class
I tried this too, it worked.
But there are alot of them
https://i.callumdev.xyz/ekwaw.gif
https://i.callumdev.xyz/48kha.png
Why doesn't it stay, im crap with css LOL
That snippet doesn't tell me anything
use a div as mouseover listener
like, same size as the profile button but grows to full size on mouseover
One message removed from a suspended account.
One message removed from a suspended account.
How can I send the message of a command in 1 specific Channel?
for example, I want that my currency system works Only in a Channel
it makes it easier for everyone if you would provide the language you use. or the next time i give examples in languages you maybe not use.
discord.js
store the channel id, when you run the command check if the command channel id == stored channel id
you also could make an array of channel ids and use includes
essage.channel.send(`Confirming report...`)
const confirmationMsgEmbed = new Discord.MessageEmbed()
.setColor("ORANGE")
.setTitle("Confirming Report...")
.setDescription(`Do you want to report this user? (${target.toString}). Sending in false reports will result in a warn.`)
const confirmationMsg = await message.channel.send(confirmationMsg)
confirmationMsg.react(':3419_added:').then(() => message.react(':Removed:'));
const filter = (reaction, user) => {
return [':3419_added:', ':Removed:'].includes(reaction.emoji.name) && user.id === message.author.id;
};``` why doesn't this work
(node:6909) UnhandledPromiseRejectionWarning: ReferenceError: Cannot access 'confirmationMsg' before initialization
you call something before the ready event fires
my bot isnt coming online and it is showing this
i need it to be online for verification
:/
how can i fix that
wrong units? or did you do calculations? if yes remember that js is dumb and will make 2+2=22
send the stuff after the event fires
bruh
i did 2000 ms = 2 seconds
pls ping me if somebody can help
when did you send the message
Before it reacts to it
code snippet?
which one?
this doesnt really help
you probably send some stuff wrong
no (?)
show your command handler, where you apply the cooldown
here
How can I send directly to the Channel?
that just loads the commands, doesnt apply any cooldown
@lusty quest here
use the stored channel id, when you want to send stuff in there use the id to get the channel, store the channel you get to a variable and after this you can call channelvar.send() on it
console.log(client.timeout.get()) and see what it returns
Why do people even use table logs for loading commands? Doesnât make any sense
undefinied
there is your issue then
oh ok
i wish someone would make a guide in how to debug code.
its too complicated for a guide
just do cat pls debug kthx
basic debugging, would help already a lot
right clicking and clicking there is too hard
well people cant manage to do this
so is clicking the red button there
press f5 => click red button on left side
boom, you are now debugging
though, truth to be told
there is already a guide
now make this a fancy website and pin the link for it here.
its just not the pre-digested baby soup shit they give to discord.js users
or add a bot that got some trigger phrases that sends the link ins as soon as someone asks why it doesnt work
how to tell a bot to use an animated emoji without nitro
for example i have a custom welcome message but i have to tell the bot to use the emoji in the chat, but it just appears as : :
holy
pee
use scratch for discord its easier
let's not tell peeps to switch their programming language, yeah?
no its not my bot
use <:emoji_name:emojiId:>
wat is dat
how to find the ID
ok i just recomended its easy
type the emote, and put a \ before
scratch is never a good recommendation to someone who's having a simple issue with a real programming language.
o lol for me kinda works
so like /piglinvibe
not /
or like /:piglinvibe;
this \
oh
not this /
\piglinvibe
:mmulu:
imagine not having a gif of it lol
it disappears as soon as i send it
ig i have to send it in a diff server
which doesnt have it










