await wait_until_ready()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits until the clientβs internal cache is all ready.
Warning
Calling this inside [`setup_hook()`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.Bot.setup_hook "discord.ext.commands.Bot.setup_hook") can lead to a deadlock.
#discord-bots
1 messages Β· Page 1122 of 1
the method waits for the bots internal cache to be ready so when on_ready fires
its a folder with task and commands which has the Bot class which is a subclass of Client
how do you install the latest version of the discord.py API
Do I need to install it or does it come with discord.py
The latter
you mean the wrapper and its pip uninstall discord
it comes with the wrapper
so to put it in it'd just be pip install discord?
Ok so my afk file is causing problems, why is that here? If I do not load it the other files are fine
pip uninstall discord discord.py
pip install git+https://github.com/Rapptz/discord.py
if you're talking about latest latest
as in 2.0
yeah need the version that makes the gui work
you can just pip install -U <library> instead of uninstalling and reinstalling itπ’
how to remove a button when clicking it? maybe someone help me please?
what library
discord.py v2
i don't think dpy2.0 is on pypi
do you want to remove the specific button or the complete view?
doesn't matter you can still pip install -U git+...
class Button(discord.ui.Button):
async def callback(buttonSelf: "Button", interaction: discord.Interaction) -> Any:
if buttonSelf.label == 'Cancel':
for item in view.children:
if isinstance(item, discord.ui.Button):
view.remove_item(item)
else:
item.disabled = True
await view.message.edit(view=view)
else:
view.remove_item(buttonSelf) # <---
await view.message.edit(embed=embed, view=view)
i want to remove the button
but its not working
you can just self.children.pop( that button's index ) and edit the message with new view
why the f is list.pop not documented
;c
its list.pop im very sure
both XD
yeah both of them exist
from typing import Optional
@bot.command()
async def rmbr(ctx, arg: Optional[str etc]):
...
oh thank you!!
np
the view variable is not defined in this scope is it?
its not giving me an error but its just not working well
you can just ```py
class MyView(ui.View):
@ui.button(**kwargs)
async def button_callback(self, button: ui.Buttom, inter: Interaction):
self.children.pop(self.children.index(button))
# edit message to this view (self)
you probably have an error handler which is not allowing the error to raise
i think its because it cant remove buttonSelf from view while the code is running in buttonSelf class or something like that but not sure...
ty
class Button(discord.ui.Button):
async def callback(buttonSelf: "Button", interaction: discord.Interaction) -> Any:
if buttonSelf.label == 'Cancel':
for item in view.children:
if isinstance(item, discord.ui.Button):
view.remove_item(item)
else:
item.disabled = True
await view.message.edit(view=view)
else:
view.remove_item(buttonSelf)
await view.message.edit(embed=embed, view=view)
class Select(discord.ui.Select):
async def callback(selectSelf: "Select", interaction: discord.Interaction) -> Any:
if True not in map(lambda item: item.label == 'Return back to main command', filter(lambda item: isinstance(item, discord.ui.Button), view.children)):
view.add_item(Button(label='Return back to main command', style=discord.ButtonStyle.blurple))
await view.message.edit(view=view)
await interaction.response.send_message(selectSelf.values[0])
class View(discord.ui.View):
async def on_timeout(viewSelf: "View") -> None:
try:
await viewSelf.message.edit(view=None)
except: # msg got deleted
pass
def __init__(viewSelf: "View") -> None:
super().__init__()
viewSelf.add_item(
Select(
max_values=1, min_values=1, placeholder='Commands List',
options=[
discord.SelectOption(label=command.name) for command in group.walk_commands()
]))
viewSelf.add_item(Button(label='Cancel', style=discord.ButtonStyle.red))
view = View()
view.message = await self.context.reply(embed=embed, view=view)
thats the full code...
im new to discord.py...
str, etc
not that one xdd
.
I am just saying that u got a syntax error in that example
i didnt use that example but i gave it to someone π
Optional :drakeno: None | T :drakeyes:
view isn't defined
In the Button class
but its working well on "cancel" button, the problem is only with "Return back to main command" button
its giving me that
Do you have an error handler?
yea
@bot.event
async def on_command_error(ctx: commands.Context, error: Any) -> Optional[NoReturn]:
# cooldown error
if isinstance(error, commands.errors.CommandOnCooldown):
await on_cooldown(ctx)
return None
if not hasattr(ctx.command, 'on_error'):
raise error
return None
Instead of the second if statement, do:
else:
raise error
thx
Also
The return type is always None and error type is CommandInvokeError iirc
!d discord.ext.commands.Bot.on_command_error
await on_command_error(context, exception, /)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
The default command error handler provided by the bot.
By default this logs to the library logger, however it could be overridden to have a different implementation.
This only fires if you do not specify any listeners for command error.
Changed in version 2.0: `context` and `exception` parameters are now positional-only. Instead of writing to `sys.stderr` this now uses the library logger.
thxx
i did that but nothing get changed...
Ah I got the issue!
Hi
hi
U are adding the Button, but haven't defined any callback
The view.add_item
the Button class has already a callback
Oh nvm
xd
In the else statement of the call back method, where u r checking for button label
In the else, add a debug print statement to see if it's even triggering
okay 1sec
view.remove_item(buttonSelf)
await view.message.edit(embed=embed, view=view)
print('x')
its printing x
Weird
Oh wait wait wait
U ain't responding to the interaction
!d discord.Interaction.response
Returns an object responsible for handling responding to the interaction.
A response can only be done once. If secondary messages need to be sent, consider using followup instead.
OH
OMG
IT WORKED
YAY TYSM <333
i tried for more than 2 hours to fix that command π thx for help <333
It's fine
@still swan one thing I like to do whenever I work with buttons or context commands is that add an interaction.response to the function
So that u can remember that u gotta use that at least once in the code
you can just say "An interaction must always be responded to"
That can become confusing for a newbie since technically he's already using view.message.edit
well its not confusing as its just mainly how discord works with interactions
should i use await view.message.edit() or await interaction.response.edit_message()
Guys can anyone here help me at sqlite in #databases ?
Second one
thx
the first one is better imo as youre just saving the object over responding with the edit_message() which can raise an error that you already responded to the interaction and if you have a thumbail or an image in an embed which were set with a local file iirc they get removed
i need to use await view.message.edit()? π
Have u already used interaction.response once?
yes
Then u can go with the first one
ty
you can always use interaction.edit_original_message which uses a webhook but can raise an error and cause webhook 404 problems so the first option is better
ty
π
is it possible to run a python app using JS? i built my entire discord bot using discordjs and don't really want to rewrite it but it'd be cool to intertwine it with a python webscraper or whatever else
why do you want to use python, js provides you those features already?
just use that until you want to rewrite it completely
python app using JS
running a python file with js's interpreter thats like making @maiden fable understand me, it doesnt work

Uh?
Guys i am getting this error when i run my bot
Can anyone help fix it pls?
Pls help me this error is insane
@maiden fable can you help me?
Can u paste the error here?
Ok
__init__ missing one required positional argument: 'max_workers'
Like, the whole traceback
That's very huge
!paste
Pasting large amounts of code
If your code is too long to fit in a codeblock in discord, you can paste your code here:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the floppy disk icon in the top right, or by typing ctrl + S. After doing that, the URL should change. Copy the URL and post it here so others can see it.
And i cant copy on mobile
Nope
This error is insane
I dont even have max_workers thing in my discord bot
Yea
Should I ask in replit server ig?
Ig
Really a insane error
They told me Missing argument and module error
max_workers if i am not wrong is from concurrent.futures
Yea
Threadpoolexecutor needs max_wormers
workers*
!d concurrent.futures.ThreadPoolExecutor
class concurrent.futures.ThreadPoolExecutor(max_workers=None, thread_name_prefix='', initializer=None, initargs=())```
An [`Executor`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.Executor "concurrent.futures.Executor") subclass that uses a pool of at most *max\_workers* threads to execute calls asynchronously.
*initializer* is an optional callable that is called at the start of each worker thread; *initargs* is a tuple of arguments passed to the initializer. Should *initializer* raise an exception, all currently pending jobs will raise a [`BrokenThreadPool`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.thread.BrokenThreadPool "concurrent.futures.thread.BrokenThreadPool"), as well as any attempt to submit more jobs to the pool.
Changed in version 3.5: If *max\_workers* is `None` or not given, it will default to the number of processors on the machine, multiplied by `5`, assuming that [`ThreadPoolExecutor`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ThreadPoolExecutor "concurrent.futures.ThreadPoolExecutor") is often used to overlap I/O instead of CPU work and the number of workers should be higher than the number of workers for [`ProcessPoolExecutor`](https://docs.python.org/3/library/concurrent.futures.html#concurrent.futures.ProcessPoolExecutor "concurrent.futures.ProcessPoolExecutor").
π worst help
π€―
Ye first i always ask for help there but now i ask here cause they not even know how to talk and not help properly
check Google first smh
In which file?
They gave me a good help
They told Idk sorry
it's a kwarg
that's an asyncio error Asher
and iirc replit doesnt allow you to open files of default libraries
it says max_workers missingπ
....?
u have to change that somehow
What would I do now π
inbuilt libraries...deprecated? god or what?
are u using threadpoolexecutor executor in ur code?
inbuilt i didn't see the error lemme see
Do you expect this from me?
Asher read the tb
i just read missing arg
smh
where are u using asyncio in ur code? can u send that fragment which is causing error?
aiohttp is erroring, try updating it
Ok
just try to pip it for now
Ok
dosent repl auto updateπ
send code whenπ
^
I used in 3 files ig
It showing no file in error
btw i just remembered
aiohttp dosent work with replit
so π
so use requests + run_in_executor
Idk I havenβt used it in a long time
some other guy told me abt this
it didn't work for me when i tried it caused some bug or something
hm? why not
@shrewd apex but discord py not work without aiohttp
idk i asked regarding this b4 in help channel as well
if that was the case, discord.py would never work because its totally dependent on aiohttp
i tried using aiohttp get() it didn't work it probably was interfering with replit operation
it works with discord
Yes
but when i use aiohttp explicitly
I'll test
alr
Error says all
Idk it never came first
Missing argument
uh code pls
Then why it never came first?
it's a bug with the asyncio lib inbuilt which is misbehaving on using aiohttp with replit
On my GitHub
Oh π
@robust fulcrum sad
idk sarths testing
But me not using aiohttp
Only discord use it
ic
Me use requests
What
i don't have much experience with replit
Why this error not came first?
last time i use aiohttp with replit explicitly it gave me a few errors
Did it came cause of aiosqlite?
what changes have u made recently
I never used aiohttp π
I added a new command and package Pydictionary
!pip httpx
Β―\_(γ)_/Β―
Do Pydictionary have any problem with replit?
β¬ββ¬ γ( γ-γγ)
i don't think so, it shouldn't have any
idk
maybe replit has already a lot of people using google translate in their service
Nice
'n google ratelimits them
hmm strange didn't work for me
im not doing that in a bot but general program
This error really insane
whats the error?
Help!
CODE
Kn GitHub
Bro which part
In my profile
How do I copy bro?
I can't open github
Ok
And error pls
I already sent
That's not the full error
I can understand but...
@slate swan need my repl link?
What should I do now?
why not buy an actual VPS
For what?
can someone help me lol
how do i setup python discord bot?
like setup before coding
I am really in tension i worked on my discord bot for month .
π’
take a look at pinned messages
ok
no?
while inviting it asks for human verification, so most probably its not meant to be automated
@paper sluice i am having a very huge error which here nobody was able to solve
Can you try help me?
what error?
u should be able to select all and copy on mobile
I have dm you link
I'll change token lator
ur using python3.8
So?
upgrade to 3.10 try
Is it the error?
discord.py required atleast 3.9 iirc
How do I upgrade on replit?
https://github.com/Rapptz/discord.py/issues/7991 why isn't this closed ? 
idk π€·ββοΈ google it
3.8
and replit machines run 3.8.2 iirc
@slate swan want my repl link?
henlo
I'll dm you
hm
I did dm
henlo
Really?
I did a lot of hardwork to install 2.0
ya seems an internal error, should be fixed after a quick reinstall
i didnt say to use 1.7
use 2.0, just uninstall and install again
But i needed to overwrite the poetry
I forgot how to install using git link?
I reset.......
Lazy
hola
π
rewritting my dpy bot in hikari isnt as hard as i initially thought
hikari is better, using lightbulb?
ya
@robust fulcrum π why did you clear poetry.lock
cool
dude this popped up right now, wtf, i was trying to set it up yesterday to autocorrect my colors class. why does it activate when i dont need it π
co-pilot is shit
I tried it
and it just gave me wrong suggestions....every single time even after seeing the patterns for 6 hours
i always have it disabled, i hate it, its only good for writing docs and stuff that required a lot of copy pasting
maybe
Not me?
then?
ezz
Idk i don't even touch that
I'm good with intellisense ig Β―_(γ)_/Β―
Wtf man who cleared that π
some guy named samarth or something did it
i dont like using autocomplete software, i want it to point out errors and show function signature
mine is Ashley or smth
ya i saw his cursor on that file
Ashley02014 yeah
konichiwa
What's even happening here
u?
wtf π no
Never
I just invited @paper sluice and @slate swan
Should I make new repl?
And paste this code
π on phone
On mobile π?
there should be a panel to revoke access or something, do that first
^
?
then generate a new poetry thing, i dont use it so dont ask me
Idk how to do that
like u gave us access to ur replit, now revoke that access. There should be an option
I deleted join link
nice
same
resend the invite link smh π
Should i report about it in replit server?
That a unknown guy joined my repl
To you?
ofc
rip
This fucking replit can leak our information too
lmao just focus on fixing the issue for now
If unknown people join our repl this can destroy our hard work
probably has something to do with poetry.lock being cleared up
Yea
Me asking in replit server maybe they could help
I'm out, I'd rather make a new repl by now
I'd rather not use replit
phone...
pydroid..
my mind on another level....
pip install python
too smart for this shit
sed
how do u send ephem messages with miru.Context
My mind broken
mine too, im out
use flags=hikari.MessageFlags.EPHEMERAL in ur send method
aight thanks
just create another repl
and copy paste the code
^
copy pasting every single file on phone
so uwu
download the tar.gz file , unzip it, upload it, ez.
I can't upload folder on replit π’
upload files one by one
Replit people said to type poetry update in shell
try it and see, I'll blame replit's outdated python version for every issue
Yes true
It says NotExistenKey
yeah then just create another repl
whats the equivalent a PageSource in miru
Guys
A guy on replit server gave me a template of python 3.10
And i can get all 3.10 features
Should I use it?
sure
outdated? 3.8.2 isnt outdated, it's pretty much usable
hi
hi@slate swan
@slate swan should i upgrade to 3.9?
With replit using nix now you should be ezily able to update python by editing the replit.nix file
Replit people told me to do this
outdated and usable are not related,
3.8 was released back in 2019 won't you call it outdated in 2022?
pretty sure discord.py 1.5.x still works, that doesn't means its not outdated
yeah cool, every version of python should work
@slate swan good news
I got a solution
I can restore my repl
I edited it lat yesterday
And i am restoring it now
Whats this thing
I'm blind, it's too small to see
No you're not, you literally need a magnifying glass to see it 
mhm
I am gona make a new repl
package = []
[metadata]
lock-version = "1.1"
python-versions = ">=3.8.0,<3.9"
content-hash = "..."
[metadata.files]
@robust fulcrumWait are you really in the process of coding a bot using your phone ?
Yes
@slate swan
How can we remove the default help comamnd?
help_command = None```
in the Bot constructor
subclass the help command class or set the help_command to none when declaring the bot instance
bot.remove_command("help")
no
it works too but help_command = None is better
Ok mr.Henderson
copy commands.Bot code and remove all help-command related lines
Making new repl is a head ache
Copying everything and pasting
Yeees π my bot is backN
class MyUwUHelpCommand(commands.HelpCommand):
pass
bot = commands.Bot(help_command=MyUwUHelpCommand())
π
Replit wasted my half day on my bot
replied
I was thinking to work on sqlite today
But i was not knowing this replit is ready to stop me
Can I ask one thing @slate swan
uh?
Why this thing is coming
It never came before
it's in the new update
Oh
a default logger is automatically set when you use the run method
Is it helpful?
kinda
Actually I overwrited the poetry to install 2.0
If we not overwrite poetry installs 1.7
@slate swan holy shit man
I am really sorry to you
I found the thing which was creating problem in our repl
The PyDictionary module
only if it is related to discord bots in python else claim a help channel (see #βο½how-to-get-help )
sorry?
Sorry Ashley for wasting your time ? π
print(not hello world)
it's okay
it's okay
name error
But this was a lesson for all
ahem
LOL
Btw i helped you all in a way @slate swan
π
that is?
u sure about that
I helped that never use PyDictionary
I'm sure I'm not dumb enough to use a blocking lib
pydictionary?
extensions/Misc.py lines 35 to 39
resp = await misc.bot.http.get(f"https://api.dictionaryapi.dev/api/v2/entries/en/{word_to_search}")
if resp.status != 200:
return await ctx.respond("Could not find that word!")
content = await resp.json()
data = content[0]```
that's how I create my dictionary command
For definition and synonym and antonyms of words
use the api I use with aiohttp
my bot just went fstring error for no reason and im raged cuz there is 1000 files that i need to copy pasta
maybe thats a bit exaggerating
imagine not using cm
π that thing happened again with PyDictionary i need to make repl again now
π«
thats what i need to do also
I hate you PyDictionary
ikr
what is the best way of getting a bot onto a vps?
PyDictionary is kutta
me not even using http π
PyDictionary kutta
copy pasta everything
2 hard when i wanna update
oof
oo
i want to use github and pull and request everything but idk how to set that up in my bot 
this is how i do it:
vps for main bot
and a replit beta bot
everytime i finish an update with my beta bot
i update the code to main bot
ew
easiest solution
just make a beta cog
at least i get myself vps alright
wait no
i dont have any ;-;
im using doube replit π₯²
u use ur hand
ποΈ push
π€ pull
Really Helpful Thanks
np
Imagine making repl 3rd time .. || π ||
you are doing it, why imagine
how would i do it tho
Β―_(γ)_/Β―
It took me half to do first
i wanna use github but how would i do that
usually you can ssh into your vps and git clone your repo and run
github education exusts
I'll never use PyDictionary now
literally gives you digital ocean free for 1 year bro
yeahh i could
pull should be enough
powershell π³
- I don't code bots
and websites are good enough for heroku
heroku sucks ass too
mostly yes
still better than ur ass
ok REPLIT user
LOL ikr
whose?
invalid-user's for sure
what an implicit argument
I'm out
yayaya blablabla
id rather not make a bot π
I mean, imagine still making bots, totally you
*overrated
good enough for learner
replit surely is underrated, it just isn't meant to host discord bots
umm guess discord now officially promotes using heroku as host
^
But for interaction commnand bots
interaction command?
I mean the new slash command thing
hm
Never used them but I think now you just need to make a webserver like flask and make your bot on it? Heroku is pretty decent for this usecase
step 1. grab ur moms cc
step 2. buy VPS
step 3. host discord bot
step 4. get grounded
ez hosting method free 2022
imagine shitposting
is there any way of listening to user audio with the python version of the discord api?
like saving it to a file each time someone goes green in the call or something like that
Python, no I guess. Still a pr
voice receive isn't supported by discord.py
it is by js rip
"python version of the discord api" isnt a thing, discord api is written in js
how do you know
I'm too godly
There are experimental forks which you can use, or implement it yourself
yeah, theres the python one, and the js one, etc
what-
link?
If you know enough python, you can just copy the code from pending PR and fix and use it.
they are discord api "wrappers"
are you secretly a discord employee
!pip py-cord
yea aka versions
Don't use that
well
thats not what i was asking for a link of
i, uh, don't think you know what API and API wrappers mean
what now
It supports voice receive so
But don't use it for other reasons
just experimental purposes
ok whats the good one
yeah make sure to use TypeScript
dude if you aint gonna help stop interrupting
Are there some official discord docs for voice receive or it's all just reverse engineered?
well, I don't really help here anyways, I just interrupt everyday every moment
it's all reverse engineered pretty sure.
took you a few min to type that, sad that you crossed out your hard work
can you link one?
No.
Hm. Discord surely is weird to keep endpoints open and still not give docs for it like its a school test or what π
ok lol
you want voice receive feature?
.....?
yes
pycord and nextcord supports that, totally not taken from the discord.py prs
whats "prs"?
The pycord people did take permission from the pr author though, it wasn't blatantly stolen
which is better?
im not a fork person, personally dont like any
but you can go for pycord since nextcord is being re-written and there will be breaking changes
will/may
lolw
i'm not a fork person either, I prefer spoons
https://github.com/imayhaveborkedit/discord.py was the one which had a lot of discussion around it
i prefer light ( hikari )
chopsticks ftw
just use your hands
wash ur hands first
just don't eat
Lmao. If sanitized properly why not π
I still dont like dirtying my hands while eating
dont some races use their hands to eat
π
use this thing
you in prison?
that's not even a proper spork.....
Spork supremacy
I'm sure I'm not one of them
i use telekinesis to eat
spork conversation
NO OT
don't gotta be that strict
don't shout Sparky
@slate swan i made a new repl and my bot working fine
And i found the problem
The PyDictionary module was the problem and never use it
s- sparky stop shouting π₯Ί π π this isn't youuuu ππ
anybody left to ping?
No
sure?
Nice
it's me Sparky#3940
Or 779990652149825537
that doesn't mean you shouldn't use the pydictionary module
So much off topic chat going on nobody cares but I do :)
it's just a replit-related problem
Im using the discord.py before rewrite, is there anything compatible that I can use to create modals?
why are you using before rewrite π
made the bot before rewrite 
pretty old bot then
use discord.py master branch, or hikari
join the hikari cult family
is the rewrite for dpy much different to before
yeah, its really breaking
yup, biggest change is "Models Are Stateful"
client.say/send_message etc are removed
for example you do channel.send instead of bot.send_message(channel, ...)
yep
Right well
So is hikari superior? I know there will be a little bias here
or did you just switch before Danny announced his return
i have been using it before discord.py was well and fine
Any clear benefits?
i really like hikari's ASCII art when you start bot :P
mhm you can edit it to your own custom banner too
show me it i haven't gotten to use hikari yet
oh thats sick
i was gonna be first >:(
lmao, I remember seeing that shit for 3 days straight
then I got so sick of it, that I removed it π
π you can make ur own too
ooo thats cool
Hey add the Gentoo logo there
change it to Uwu
lemme try doing that
wait how?
there's a banner argument in GatewayBot
but uhhh I'll have to reinstall lightbulb so meh
thats not lightbulb specific anyways
πΏ i still cant read it properly tho, it says crescent
uhh whatever
I read it as "Groot" π
im not surprised, if your read it after zooming out you can read it properly
hm yeah
guys py @bot.command() async def stock(ctx): stockmenu = discord.Embed(title="Account Stock", description="") for filename in os.listdir("Accounts"): with open("Accounts\\" + filename) as f: ammount = len(f.read().splitlines()) name = (filename[0].upper() + filename[1:].lower()).replace( ".txt", "") stockmenu.description += f"*{name}* - {ammount}\n" await ctx.send(embed=stockmenu) why doesnt this send the list
(im using replit to keep it alive)
it works without replit and not with
any errors? keep in mind that replit often deletes the content of your extra files
ill use my own now
where can i see errors perticuarally
^^ idk how to spell that word sry im not english
im new with using replti
its fine i understand, do you see a "console" option?
just in console?
yes
mhm these are not errors
mmm anyway how to fix?
let me send my files n shi
this
@slate swan can u do more with this^^
aren't these the uptimerobot pings
yep
yeah it's not errors
anyhow to fix it?
i don't think u can
!rule 5
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Selling/giving away (stolen) accounts is against Discord's Terms of Service. It can get your bot and your account terminated/banned.
Just i needed some texts
the eye π Krypton pro took me some time to figure out
how do you want to fix it?
that it sends it
and that it works that it sends the amount of lines
^
idc
<@&831776746206265384> they will care
lmfao what this guy
lol
appreciate LX for being fastest mod
Krypton is probs the kid in class that says they didnt gave homework
no?
you probably do have homework rn and you forgot to do it
idk why but if I run my whole discord.py code in VScode I get an error but not in pycharm π
no, they're both different things
theyre just different forks of discord.py
they are both dpy forks
No need to insult the other person while I investigate.
How do I get a list of all the messages that has been sent in a channel? And then how do I delete them?
ty
why would they have the same code, different forks, different ways of doing things
@severe bone What does your code do?
is there a way to like get like the userID of a person who invited a bot?
not anymore
restarted ages ago
YES!
send people dms from txt files
anyone know a way to like get the userID of a person who invited a bot?
!warn 452717596341567488 Do not ask for help with malicious projects.
:incoming_envelope: :ok_hand: applied warning to @severe bone.
I dont think so unless checking audit logs
hmmm, how about:
can a discord bot even listen to a vc? idk if this is legal or no
like voice recognition?
it technically can but its not documented anywhere-
the Discord API has voice receiving support, but it's undocumented
voice recognition is not as easy as it seems?
speechrecognition module?
isn't that the slow ahh library
yes, but I think it could help π
I think discord.on_integration_create is fired when Bots are added since they also are an integration after all.
It's payload contains info about the user who added the bot so I guess you can use it.
If you want to know who added "your" bot, then I dont think this will work
just needed to like know who invited a bot in a server
yes it is
!d discord.BotIntegration
class discord.BotIntegration```
Represents a bot integration on discord.
New in version 2.0.
A bot means your own bot or any other bot in the server same as your bot?
same server as the bot
that's when it starts tracking the integrations
Yeah then it sure will work.
like for example:
my bot is in the server
then a user invited mee6
then the bot will then send a dm to me: mee6 - (userID)
async for i in message.channel.history():
await i.delete()
``` Why is this so slow?
It takes ages to delete the messages
because ratelimits
just purge the messages, dpy will handle that by itself
you can also use textchannel.purge instead
!d discord.TextChannel.purge
await purge(*, limit=100, check=..., before=None, after=None, around=None, oldest_first=None, bulk=True, reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Purges a list of messages that meet the criteria given by the predicate `check`. If a `check` is not provided then all messages are deleted without discrimination.
You must have the [`manage_messages`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.manage_messages "discord.Permissions.manage_messages") permission to delete messages even if they are your own. The [`read_message_history`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Permissions.read_message_history "discord.Permissions.read_message_history") permission is also needed to retrieve message history.
Changed in version 2.0: The `reason` keyword-only parameter was added.
Examples
Deleting botβs messages...
what does the bulk do?
:incoming_envelope: :ok_hand: applied mute to @cerulean folio until <t:1656325586:f> (9 minutes and 59 seconds) (reason: mentions rule: sent 7 mentions in 10s).
oopsis
!unmute 508106724075634709
:incoming_envelope: :ok_hand: pardoned infraction mute for @cerulean folio.
Oh thank you ! I really want ot write this message of thanks please, where am I allowed to? @velvet compass
Don't have so many mentions π
but I wrote a thanks message to all people that helped me and I'm not allowed to dm them
I need to express my gratitude since those helped me achieve a thing that was very important to me 
Don't tell me I got mentioned cz I got a ghost ping
How do I go about structuring a discord bot? Like whats the best way to design it
if u got a ghost ping, u got mentioned......
nah I was helping somebody so maybe it
this will use following endpoint: POST/channels/{channel.id}/messages/bulk-delete
and can only be used on guild channels
- minimal imports
- use Bot
- sub-classing the Bot class
- logging
- up-to-date features
- hybrid commands
Today i finally deployed my bot and it's now being actively used by 8k+ people !
I have always been told that I'm talented, and I always believed in my capacities ngl but, there was one thing I always struggled with:
Instead of getting things done, I'm more likely to try deepen my knowledge and improve what I do before I release it (and that's not only for coding, but anything I do in my life, even when I organise a party at my house for ex.), and often get overwhelmed and feel like i'll never achieve it the way it should be which is a very wrong belief !
Through this project I kept the focus on the practical aspect. I wanted to release a bot that could solve a problem, no matter if it's not perfect or could be improve or could solve more problems.
And I did it ! And it was very tough, because I was clueless and was using discord.py for the first time !
So since I really am gratefull to all the people that helped me on #discord-bots, I wanted to adress special thanks and love to @Ashley V#0871 , @sz_skill#5551 , @sarth#0460 , @Sparky#3940, @Ryuga#1114 , @greyblue92#0001 , and @Robin J#2415
Love you guys β₯οΈ
I hope they'll all read it 
I SAW IT ||and i liked it
||
I have a question, am I allowed to like ask help about anti-nuke bot? is it legal?
oh send me that bot invite
yes.
yea
am I the only one who read the last 2 lines and replied π
um it's specific to a server, but indeed I can send you the server link and you can see the bot functionning :D
love you too uwu
grateful* btw
What is bot? Is discord.clientnot the right way to do it? wdym by subclassing the bot class? What should I be logging?
so is there a way to like make a discordBot know if the bot is a nukeBot or a moderationBot, cause in my idea is: if the bot is deleting a trap channel then it will automatically get banned and the user that invited that nuke bot will also get banned, is this accurate π
me back after years:
i literally saw you chat today
the bot class has a couple a more features
i mean back with building my bot
yea yea ok
because replit trashed me
can a nukebot even ignore to delete a channel
commands.Bot is a subclass of discord.Client with extra features (proper commands (prefix and arg parsing, help command), extensions)
you dont need to subclass commands.Bot but it can make things easier
Bot is a sub-classed version of Client, so it has a lot more features
i will pretend i didnt see minimal imports
minimal π
from abc import ABC
from functools import partial
import re
from textwrap import shorten, wrap
from typing import Optional, Pattern
from aiohttp import ClientSession
from async_lru import alru_cache
from bs4 import BeautifulSoup
import discord
from discord import app_commands, Embed, SelectOption
from discord.ext import commands
from discord.ext.menus import ListPageSource
from wikipediaapi import Wikipedia
from ryubot import RyuBot
from utils.abstract import check_author
from utils.paginator import Paginator
from utils.utilz import color
is this minimal?
hows that supposed to work lol- no ones gonna say their bot is for nuking
I wanna cry already
Could you send me a link to the docs? I can't find it
I need ideas 
!d discord.ext.commands.bot
Fat chance.
No documentation found for the requested symbol.
idk how to use this bot
!d discord.ext.commands.Bot
class discord.ext.commands.Bot(command_prefix, *, help_command=<default-help-command>, tree_cls=<class 'discord.app_commands.tree.CommandTree'>, description=None, intents, **options)```
Represents a Discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/latest/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
Unlike [`discord.Client`](https://discordpy.readthedocs.io/en/latest/api.html#discord.Client "discord.Client"), this class does not require manually setting a [`CommandTree`](https://discordpy.readthedocs.io/en/latest/interactions/api.html#discord.app_commands.CommandTree "discord.app_commands.CommandTree") and is automatically set upon instantiating the class.
async with x Asynchronously initialises the bot and automatically cleans up.
New in version 2.0.
have to mention the proper path
oh my god its case sensitive
the thing that's killing me the most
why?
wanna know something? all that for just one command
hikari π
maybe mine is very minimised π€£
im using buttons, thats just a class with some attrs i use to run my paginator. INstead of indexing a list of embeds
A professional Java developer would say yes
beautifulsoup 
first is necessary then minimal comes to play
better fit those imports into one line instead π
pep gonna kill u
wikipediaapi doesn't do it all
79...
i mean yes
π
glad that i could be helpful, btw add me to the bot's server too if you don't mind
rewrite that command in Rust so you only have to import subprocess π
uh... have you moved parts of your code into individual files?
its for scraping the table, ik pandas does it as well but that will mean i have to learn it first and its sync. the wikiapi is sync so minimizing the use
cogs xd
uh yeah, add me too if you could
Hi guys, how can i create the new "Slash Commands" ?
library?
i didnt even get a mentionπ₯²
UwU
indeed
3hr exam
i read this https://stackoverflow.com/questions/71165431/how-do-i-make-a-working-slash-command-in-discord-py
but i can't know what is "guild_ids" ?
Stack Overflow
I am trying to make a slash command with discord.py I have tried a lot of stuff it doesn't seem to be working. Help would be appreciated.
yeah
yes
online?
yeah
that code is messy, really messy
and dunno what do you mean by guild_ids, there's nothing such as guild_ids
which one?
practice test fom tution
oh ok
thanks !
THIS IS A THIRD PARTY LIBRARY π
How do I instantiate it and make it run using my token?
when u realize dpy is not builtin
from discord.ext import commands
bot = commands.Bot(...)
bot.run("token")
oh god
yeah
