#discord-bots
1 messages · Page 427 of 1
its not giving me that issue anymore im just getting yellow lines under words do i just pip
check bottom right to see if vscode is set on the right Python instance
python 3.14.4
and does pip surely install for 3.14? could be conflicting with another version maybe?
on ur machine
and make sure you installed primp if you haven't
i only have 3.14.4
so just pip install everything now?
yes
!intents
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. Various features of discord.py rely on having particular intents enabled, further detailed in its documentation. Since discord.py v2.0.0, it has become mandatory for developers to explicitly define the values of these intents in their code.
There are standard and privileged intents. To use privileged intents like Presences, Server Members, and Message Content, you have to first enable them in the Discord Developer Portal. In there, go to the Bot page of your application, scroll down to the Privileged Gateway Intents section, and enable the privileged intents that you need. Standard intents can be used without any changes in the developer portal.
Afterwards in your code, you need to set the intents you want to connect with in the bot's constructor using the intents keyword argument, like this:
from discord import Intents
from discord.ext import commands
# Enable all standard intents and message content
# (prefix commands generally require message content)
intents = Intents.default()
intents.message_content = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see discord.py's related guide, and for general information about them, see the Discord developer documentation on intents.
The startup ram went from 475 MB to 269 MB, safe enough for sharding right
When I start typing a slash command (for example,/warn @user reason) and then switch to another channel before finishing, the partially entered command gets lost when I return, so I have to start over. I tried the modal approach, but that’s not what I want.
If it's a discord limitation with how the client behaves, it's not like code you write can fix it. Why would you need to switch channels?
Sometimes we have to, but I see in some bots it doesn't happen without that modal approach.
I don't know what you're expecting here. There's not a "remember this parameter" flag when you declare a command
I often do that on this server when moderating, e.g. !ban <some ID> some reason with [context]( (then I switch to another channel to copy some ID) ).
Just testing on mobile my typed slash command stays after switching back and forth
Even when switching between servers entirely too
That makes sense, depending on what id you're copying ideally that would either be a param or a context menu in the case of slashes
User ID, yeah that could often work.
Mine are not staying.
Are you on mobile?
On PC.
Either way this sounds like a client issue and isn't a code/bot issue
Might be your client version or could just be an existing bug
Well mine stay, make sure your Discord is updated
So, I reviewed the code and updated Discord on PC & Mobile, but the issue persists.
Can you describe in detail what you're doing and seeing step by step?
Well, we can't help you here then
This isn't a code issue
Unless solstice wants to help you figure it out ofc ^^
Thanks, it got fixed. 
The bot was using global sync for slash commands, so I switched the bot to server-only sync after clearing the existing synced commands globally.
Hello
anyone alive here
No
Yo

yes
I made a discord bot
huge
Wanna test? 💖
If test here means functional testing to see if the bot does what you think it should, that's something you can very quickly do yourself.
If test here means using it as intended and giving feedback, you will get better feedback from targetting communities who would actually use your bot more than the collection of random developers (who probably wouldn't actually use your bot)
Hey can someone help me with making a Discord Seller bot
Selling what, exactly?
why are old slash commands not being removed from my test guild?
they still persist even though they don't exist anymore
What library are you using?
If it's discord.py, the library won't update commands for you. You have to sync, and it's quite possible you synced guild-scoped commands but did not sync on that guild again later once you had removed them from your code
yeah discord.py
Then yeah, you'll want to try syncing on that guild again
dm me
no that does not work. i fixed it but through app command management in the code
Look in my bio 🫣
Nah im good
You don't have a bio
Anyone know why i get this error when my bot joins a voice channel? The bot will reconnect over and over.
what version of discord.py did you install?
!pip discord.py
yikes
The latest is 2.7.1
Thank you, thats 100% something i shouldve checked lol. Sorry!
sometimes its not just updating the version. It might be something else like permissions or something. So what I did was I googled for that last error message traceback "discord.errors.ConnectionClosed: Shard ID None WebSocket closed with 4006" and it led me to the Github repo for discord.py's issues. Someone with the same discord.py version as you also had this problem. They fixed it in 2.6.0
Yes, the version was the issue.
No. The version was not the issue. The issue was in the old version, it was a bug. They have fixed it and released it in the later version
I know, thats what i mean lol.
I was running the version that had the issue, upgrading my version fixed it.
There was not a bug, discordpy 2.7 added support for dave which discord enforced
Hey dm me
dude it does select application commands
otherwise get better latency
💀
what on earth are you talking about? look how many people have reacted with a question mark
bros on to nothing
who is good at coding and making stuff
You, with enough effort and resources 🙂
Hey, me. Do you need someone to work for you?
could you teach me some basics?
!res
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Hey, contact me in dm.
Don't trust randos herding you into dms when they can very well answer questions where everyone else can chime in
Bro hey
Why would i use the public chat?
He wants to learn python
Or coding something
Because others can correct you if/when you're wrong
Believe me, I have several discord bots etc. I'm not going to be wrong
Right, the "just trust me bro" approach
I've seen the creators of discord libraries get things wrong from time to time. You're human
So? I made discord bots for several bigger and smaller Mc servers. They was all good with it and happy. I don't think I would fail doing a discord bot / teaching how to do.
You're welcome to think you're infallible and never wrong but that's just not realistic. They also lose absolutely nothing from asking questions in a public forum that encourages them to do so
I didn't said I could be never wrong, just don't think I would be wrong after doing discord bots for 9 years now.
The implication was "never wrong in the topic you're claiming to never be wrong in"
How long did you work in python?
Just gonna point out, kinda weird your account is only 4 years old
Because I didn't had discord when I started learning m
This isn't about me, I'm not claiming to be a sole source of truth
I get things wrong and like having people to fact check me so both me and the person I'm helping can learn
ye
any trick to align this in container v2?
cv2 doesnt have justification. You either have to live with that, make v1 embeds, or generate an image
If you’re running multiple Discord bots, is it better to containerize each bot in its own Docker container and manage them with Docker Compose?
It depends on what purposes those individual bots serve
They serve different purposes, such as moderation, utilities, and study for the same server.
Docker is fine but might be overkill for what you're doing. Containerization is a good skill to learn but not strictly necessary for what you're doing
#tools-and-devops might be a better place for more nuanced opinions, as the fact you're running a discord bot inside of a container doesnt really impact the nature of the container or orchestration layer
My goal is to learn and write code that will be easy for someone else to understand and work on easily in the future.
Tysm, for opinion, though!
If the bots are truly independent you could just make dockerfiles for each of them
Yeah, they’re.
Looking for experienced and motivated bot developers to help contribute with a project
!rule 9
he never sad paid
Hy, is the discord "apply to join" feature supported by discord.py?
It's not supported by the api at all, it's specifically meant for human moderators afaik
Hmm ok thank you
It's undocumented so it won't be supported by most libraries. But you get an event containing the submission info when the user submits. However approval/denial is still locked to non bot users
ok ty
I need an opinion on whether this would be sufficient for running three bots.
It really depends on what the bots do, how many servers they are in, and how well you have optimized their performance (in terms of events and caching)
Only one server, for context, moderation, tickets/modmail, and study-related. I know it's quite vague as I didn't say what features the bots have.
TBH that should be enough for one server, but you could profile them to be sure, and start with that and upgrade if needed
Tysm, Ice. That would be an ideal approach I feel like.
should be plenty. If you want to, you could cut down on CPU core count due to the nature of discord bots
hai!! wanna share my bot and maybe get some recommendations or smth idk
https://github.com/MagM1go/marionette/tree/main
Definitely do not need to request every intent, for starters. It's hard to do a full code review with the readme not in english and the project structure a bit sprawling
Here's English readme link on top
Seems pretty well structured though. Any particular reason for using redis and postgres instead of just a sqlite db?
that's my comfort stack and postgresql just better—for me this is a good reason to not use sqlits 
"better" how?
If it's one process running on one machine, a distributed cache (redis) and a client-server db (postgres) are pretty unnecessary
I think "comfort stack" is enough to chose, someone suggested me to use cockroach db and that's overkill on overkill.
Redis never used here, I removed part where redis was used, but I have some ideas where redis probably needed.
Well you asked for feedback so there it is 😂 . Worth considering tools better suited for the specific problem over things you're comfortable with when you solved different problems
Tools partially explained in README, I just went with my comfort stack. And the feedback I'm looking for isn't only about tooling, more about code review, architecture, anything you noticed
I mean if you're going to brush off legitimate feedback as just saying you prefer something else, I'm not sure what other feedback is going to be fruitful
Sorry if that came off rude, my english isn't great so sometimes it lands worse than I mean.
I don't mean sqlite is worse or smth, but postgres has more to work with
More isn't the same as better when you don't need those features to solve the problem at hand. But I think the db choice has been discussed enough
I understand that
there's a lot of verbosity
any specific spots?
from marionette.application.usecases.onboarding.onboarding_base_usecase import BaseOnboardingUseCase
https://github.com/MagM1go/marionette/blob/main/src/marionette/application/usecases/onboarding/move_onboarding_to_intro_usecase.py#L2
the filenames are in general pretty long
that's a DDD habit, filenames should be structured to reflect "ubiquitous language"
!paste
So that everyone can easily read your code, you can paste it in this website:
https://paste.pythondiscord.com/
After pasting your code, save it by clicking the Paste! button in the bottom left, or by pressing CTRL + S. After doing that, you will be navigated to the new paste's page. Copy the URL and post it here so others can see it.
Nested folders of doom
I'm sure it's possible to really minimize that
And why is there a whole file just for a base ✌🏻
looks like normal java codebase to me
You're not exactly doing clean architecture as your readme says. Your entities/domain is filled with persistence concerns. You look like you're going in the right direction but to be blunt it feels like you're forcing a file structure with it. Should you really have to go to a separate file just to update the fields of a result object?
You're running the risk of structuring your project not what is best to navigate for other developers but based on rigid rules of an architecture.
https://github.com/MagM1go/marionette/tree/main/src/marionette/application/dto
yeah, readme says it's not "100% clean arch", it explicitly mentions where it steps aside, mostly to avoid boilerplate from mapping orm models to domain models and back.
and fair point on the DTOs, they're probably taking up more space than they deserve. each one is used by a single usecase and not shared, so moving them next to the usecase that returns them makes sense (if I understand you correctly)
I can't follow the code that is there or get an idea of what is going on or being dealt with very easily but for development and working with it even though it has some violations I think you structured application and domain (directory structure and filename wise really well).
The infrastructure directory is more scattered than necessary imo. And the protocols directory under application isn't intuitive. If character protocol is actually a character repository and the other thing is a manager it would be better to name them that because that'll be what's being looked for, i.e. if you know almost any of these architectures is being used, look for the repositories.
The infrastructure directory has a directory for the repositories, which transactions go with, but transactions are in a different directory. It would probably make more sense to just have the repository files at the root of the database directory.
Would you mind if I reply with AI translation? My English is not good in writing
You should also consider taking more advantage of the use case pattern. You get to do what you normally don't, name classes with verbs, representing an action a user can do or be taken for them. EntranceUseCase is vague imo. In general you wouldn't be able to do a class like BuyItem (different domain obviously) but you add BuyDomainUseCase you get a noun. Also consider adding more descriptive methods than just execute.
https://github.com/MagM1go/marionette/blob/main/src/marionette/application/usecases/entrance_usecase.py
Go for it
Yeah, I get that following the code without documentation and context is hard. That's the real cost of layering is tracing one feature jumps across multiple files. And thanks for the kind words on the structure :)
Layering doesn't cause that. You could have everything in a single file and have logical layers so that stuff can change independently, but with any project you break it down to make it easier to deal with. In your case the database/entities/business logic is independent of presentation logic and to a limited but probably more complicated to change extent your use cases independent of the database (you could technically remove all the database code from the entities and use something different in the future). Context is hard when you structure around technical concerns rather than developer experience. Some of your project structure I think is really good and your effort is better than MANY others. But you sound like you're making the mistake of letting the architecture dictate your project structure, which that probably is best in some places but not others, you have to be pragmatic about it.
Maybe a bit scattered, true. Historical context: there used to be a redis repository alongside the sql ones, that's why repositories/ was a separate sibling to database/. Redis is gone for now (probably will come back later for some cases), so right now the split is harder to justify. Either flatten now and re-split when other repo types come back, or keep it anticipating that. Leaning towards flattening for now actually.
About protocols — yeah, I've been told this before. Ironic since I argued ubiquitous language to snipy earlier in this thread, and character_protocol.py is exactly what that argument is supposed to prevent. Naming after the role (repository, manager) makes more sense.
That's fair. I'd aim to flatten though as well though. Or you could put everything for sqlalchemy in one package and redis in another and respective repositories and stuff in each. Whatever you feel is best to work with is what is important.
ah yeah, that makes sense. as a non-native speaker it wasn't entirely obvious how that's supposed to sound. will definitely fix it, thanks.
agreed in principle, but i'll leave it as is for now. I actually have a doc with planned places where redis will come back, so the split will make sense again soon. if those plans don't materialize, flattening would be the right call
Right now it's more hard to find stuff than it is easy, imo
Yeah to be honest I found it hard to really get into reviewing this. It feels very overengineered for a single dev on a single server, like following design patterns dogmatically when you aren't even running into the problems those patterns were made to address
I am beginner
cool
cool, what wloud you like to learn?
Hey guys, I created my own script that retrieves device data and displays it to the user. I'd like to send this collected data to a Discord webhook. Is that possible? In python
Yup
webhooks are just a rest endpoint you can post whatever data you want to (in the right format). There's also a bunch of libraries that make that easier
I should probably get better at pinging people when it's an hour later 
Cooldowns can be used in discord.py to rate-limit. In this example, we're using it in an on_message.
from discord.ext import commands
message_cooldown = commands.CooldownMapping.from_cooldown(1.0, 60.0, commands.BucketType.user)
@bot.event
async def on_message(message):
bucket = message_cooldown.get_bucket(message)
retry_after = bucket.update_rate_limit()
if retry_after:
await message.channel.send(f"Slow down! Try again in {retry_after} seconds.")
else:
await message.channel.send("Not ratelimited!")
from_cooldown takes the amount of update_rate_limit()s needed to trigger the cooldown, the time in which the cooldown is triggered, and a BucketType.
Making my own API spec unpacker cuz I'm bored
Nice
THIS channel has a slowmode?????
How would I make a bot that spams messages?
why would you want to do that
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
!rule 5
5. Do not provide or request help on projects that may violate terms of service, or that may be deemed inappropriate, malicious, or illegal.
Could y'all not, please? One invocation is enough
My bad
any guides I could find to learn coding a discord bot?
Use only guides that are officially recommended by the library you use. 3rd party guides are generally poor quality.
Pick one of these or ask in the library you use support server.
Pycord: https://guide.pycord.dev/introduction
Disnake: https://guide.disnake.dev/
Nextcord: https://docs.nextcord.dev/en/stable/#getting-started and disnakes guide has portions for nextcord as well I think
Discord.py: https://discordpy.readthedocs.io/en/stable/#getting-started or this one that some people like some people don't https://fallendeity.github.io/discord.py-masterclass/
Hikari: https://docs.hikari-py.dev/en/stable/ not sure if they have more of a guide
Hata: https://github.com/HuyaneMatsu/hata not really sure the best place to start for this
@fading oracle This is not a meme channel.
Sorry 😔
Where is meme channel
There is no meme channel. But for off-topic chat go to #ot0-psvm’s-eternal-disapproval, #ot1-perplexing-regexing, or #ot2-never-nester’s-nightmare.
I have a question about whether it is more practical to store a bot token in a .env file or in Docker Secrets with Swarm. 
Probably more of a question for #tools-and-devops , secrets aren't a bot specific concept
Hi all! I’m interested in making my own bot but I’m a total beginner.Does anyone have experience in this and feel like mentoring/walking me through the initial setup? Any help would be awesome! 🙏
The first step is to ensure that you have a basic understanding of python fundamentals including classes/objects.
The next step is to choose a library (or use the raw API but that is not recommended for beginners). There is a list of popular libraries on this site: https://libs.advaith.io/#python
Additionally, dont use youtube tutorials or random 3rd party tutorials online. They are often outdated and use bad practices.
!e
code
I mean, you don't need to know classes, it's just more useful
Classes are pretty essential if you are using a discord bot library.
Almost all data that you get from the library will be an object of a class
Everything is an object of a class 
Fair enough! I believe I’ve done it before without a class but doing it with is probably better 🙂
The joke is that you're using classes whether or not you yourself are making new ones
what is the most popular library that is not based off discord.py?
hikari probably
none that are popular
Hata
Compares Discord libraries and their support of new API features
Whats the problem with discord.py
Everything
Disnake was good
not based off of discord.py
I can now mention one - cache control
If you could either have more control over cache or be able to use the library at its "core" level that would be nice
yeah thats tru
What layer of control do you feel would be useful that you don't have?
I suggest using docs.python.org. It is well reputed and As @stark ingot suggested libs.advaith.io/#python. Also I suggest using the official documentation of libraries. I think that a code editor like VS code can help.
Also install the official Python app for windows or Linux
I'd start by being able to disable more cache because why is a bot with no intents/chunking taking 80mb to begin with
Lemme check again without modules tho
The smallest it gets (requires using only necessary libraries and modules) is 60 MB
But it's not only about the bot process - looks like the library itself weighs a bunch (pre and post import in image)
But for this I cannot blame them at all, that's just usual Python stuff
What in the cache do you want to disable? Intents let you control a good bit of it
Well now I'm unsure as I see most of the weight is the whole library
!clban 1489292592301609096 some kind of scam
:incoming_envelope: :ok_hand: applied ban to @edgy wraith permanently.
What are possible options for storing ModMail/Tickets’ transcripts besides saving them as HTML files, and plain texts? For context, the bot isn't large or used across multiple servers.
Just use threads in discord
or forum channels
Forums are just threads under the hood, and they're forced to all be public threads. They're great and easy to use though if you're fine with things being public
If you use mod mail the transcript is saved automatically within discord because it is in the DM channel
Serenity is a Rust library for the Discord API.
sad this channel died i use to ask for help all the time now i understand py a lot more
AI ruined it
People can still ask questions if they have them though 
@oak blade helloooo
why ru tagging me everywhere
Ok
i made a discord auto server maker bot who wanna buy it
Might want to double check the rules here
fr💀
Just casually promoting a tool that breaks the tos and exactly why the endpoint was restricted
What would be the best approach to track voice channel status changes?
Run a task that fetches audit logs every now and then or is there a better way?
iirc they're phasing out that feature anyways, nobody really uses it
Until they do, is there a recommended way to do it?
on_guild_channel_update
It was for some time not documented due to its future not being known, got documented now that it's staying
oh good to know 
Voice status doesn’t seem to be part of the channel updates 
The doc linked by krypton lists the gateway events
ah there's a separate event yeah
Do you need to send a request every time to see the changes?
They send you the data
It's an event, just like on_member_update when someone updates their profile, or other events
How do I catch them? I'm using discord.py
might not be implemented in dpy
Not at all
But some guy made a server cloner tool plugin in vencord for free
Another tos breaking tool!
True but that doesn't mean you shouldn't
Yeah exactly and it works also
Why would it not work
Idk i just have noticed a lot of tools just break or not work
This is the first time seeing it work
It working doesn't means you aren't risking your account by breaking the tos
Oh lmao
Yeah
Nah like it uses ai to make dc server based on what u tell it then the bot does everything perms roles channels
Readily available llms made by billion dollar corporations can't tell you how many r's are in the word strawberry. Interpreting human language to do something as complex as design a server is laughable
Oh alright can i be a tester?
dm
Okay
.w
yo can someone help me on how to code something
What are you having trouble with?
can you check the forum i just made
what endpoint
there used to be a supported endpoint for bots to make guilds
Hello
Hey
Bye
channel made specifically to discuss that
oh lol
Is someone considered a chef if they only order takeout?
Mehh
jhkjh
Uh py don't allows emojies in footer right?
get 200$ just to turn off websites
depends on the maintainer, no one can say for sure
discord.js Danny credits to having implemented slash commands. But who knows about the maintainer
@stark bobcat go ahead
I'm sure they all talk and Danny taking the first step will lead to others
Hmm
wtf is Heck?
ok 4chan
Hack
discord js isn't handled by only one person
so probably not
Oh, its Hack mispelled?
ah. Ok. That totally doesn't make sense
i just hope discord dont end up removing access to message_content just for the sake of slash commands
Sadness
But you can't make a simple help command?
so anyways, back to my question, how do I get my bot to do something at a specific time during a specific day
Seems like a skid to me.
Yes
Discord is either bound by some lind of regulation, or they are really trying to get ahead of the Privacy thing
either way, they aren't going to divert
If they do, I'll be shocked
I know one guy who has already made his own discord.py fork awhile ago so yeah
true, regular commands extension is enough for me tbh
i
Won't discord do anything about discord.py?
im guessing d,py will likely just become decentralized
probaly not tbh
No. We are a drop in the bucket my friend
Oof
but I am trying right now

Why would they?

it wont be easy
Cause discord bots are a big part of discord
A big part of why discord.py is no longer going to be a thing is because discord didnt care about discord.py's dev
idk how much discord gets out of their bots
Or any lib dev for that
true
jda is java right
idk why they are updated with java
yes
Serenity
I know but we can do it, and that I will never give up on discord.py
good luck
i'd much rather learn rust from 0 than use the small java knowledge i have
Java lmao
i'm not sure serenity is reliable regardless
Learn rust def, very amazing documentation
yeah i'm willing to learn rust
idm learning kotlin 👀 planning to get into android dev anyways
Prolly move on to discord.js
whats serenity?
looks like a Rust framework
Its a discord API wrapper made in rust
And iirc they have a commands extension as well
await message.channel.send('Pls stop')
await client.process_commands(message)```
whats the correct indentation for this
this is overwriting the on_message event handler right
if message.content.startswith('no thanks'):
await message.channel.send('Pls stop')
await client.process_commands(message)```
oh i see
the only thing i was good at was d.py 😂
thanks
await message.channel.send('Pls stop')
^
SyntaxError: 'await' outside function
```
error
@commands.Cog.listener()
async def on_member_join(member):
if '🔪' not in member.nick:
member.nick=member.nick+'🔪'
i m getting an error
well I wanted to see how discord.py was being talked about here, I am going to leave here now, but if someone is interesting in my search DM me
JDJG
Even their error and exception are very well designed
alrighty
damn this guy left
Is golang worth learning for discord bots?
Same
soo... dpy will be gone forever?
sadly 😭
how to make restricted emojis :/
what should i code now then 
me too
same feeling
not custom like any emoji which i don't want in my server if someone will use it my bot will delete it :/
it's... the same thing
it won't be compatible with discord in the future right?
In the future discord could drop support for api version
would be vunlerable for hack right?
dropping support wouldn't mean you can't use it still
:/ any answer?
idk if its worth making bots again
yes, but give it a half a year or so and it will be as good as gone
true
like if someone use this 🍬 then my bot should delete it :/
so we just wait :/
Wouldn't be suprised with how discord treats developers
i always thought discord would treat them good
(-_-)
ig add a if statement
async def on_message(message):
if message.content.startswith('no thanks'):
await message.channel.send('Pls stop')
await client.process_commands(message)```
if i will write :joy: it will take it like string only not like -> 😂
someone tell me why this doesn't work
try it once
whats the error?
r u sure
try once :/
still no
async def on_message(message):
if message.content == "cookie":
await message.channel.send("🍪")
await client.process_commands(message)```
i have this command, which works
it works^^
@client.event
async def on_message(message):
if message.content.find("cookie") != -1:
await message.channel.send("🍪")
await client.process_commands(message)```
try this
which one ?
he told this one code is working
:/
this one is working
i was giving an example
i think u should have @client.event only in on_ready()
what u want then ?
@prisma wedge try changing that to @client.listen() once :/
i did
it works now
i also got same issue one time
^^
:/
lol
np
(:
oops
@bot.listen()
async def on_message(message):
if ":joy:" in message.content.lower():
await message.delete()
await message.channel.send(f":exclamation: The Emoji you are using is Not Allowed, {message.author.mention}")
```not working :/
error?
u there
yes
error?
no
hm
ok emoji isnt coming?
coming
huh
So the project is dead?
there i wrote :joy:
why not u print message.content when u send a emoji
Rip
except if you rewrite the lib 
I had so many memories with discord.py and it was truly something, RIP


So dpy is going to end right?
!d any
any(iterable)```
Return `True` if any element of the *iterable* is true. If the iterable is empty, return `False`. Equivalent to:
```py
def any(iterable):
for element in iterable:
if element:
return True
return False
Ig I'll have to write my own one like I did to sqlalchemy
I'll most probably try serenity again
Yes it is, sadly
:(
can someone pin it
will this channel be deleted?
no, this is a generic channel, believe it or not
I don't want dpy to be closed 😭😭
Yup
@lament mesa u making a discord lib in Python or something?

This ^
Hey guys im using the dagpi api , image filters but it aint working! ```py
Code:
@client.command()
async def pixel(ctx):
async with aiohttp.ClientSession() as cs:
headers={"Authorization": "mykey"}
async with cs.get(f'https://api.dagpi.xyz/image/pixel/?url={ctx.author.avatar_url}', headers=headers) as r:
res = io.BytesIO(r.read()) # returns dict
await ctx.send(res)
#Error:
raise CommandInvokeError(exc) from exc
discord.ext.commands.errors.CommandInvokeError: Command raised an exception: TypeError: a bytes-like object is required, not 'coroutine'
Ping me
Well... this is sad. Really sad. There goes my main project.
Hopefully Matrix has a library similar to Discord.py
We need discord.py back
This really just goes to show that Discord is really anti-consumer.
Wdym?
Same
By that I mean, yeah they have a popular service, but where will that go if they don't listen to their users or provide their users a good service?
We have to resort to using client mods to add features that have been demanded for a long time to Discord, which breaks the ToS, for example.
R.I.P
😭
discord.py is dead now
WDYM
Hey hey hey @neat salmon please don't talk about breaking ToS here
yes
SO THERE IS NO DPY ANYMORE?!
there will be no updates
Except the 2.0 one
my goal wasn't to talk about breaking the tos, rather how users break it for completely moral reasons
yall still sad bruh, yk you can always make your own wacky wrapper to fit your needs
which one can you show?
pretty much a lot of client mod users
Uhh, well even if I want to make one, I wont be able to
why
discordpy and disco are both dead now?
coz we're beginners. 🙂
discord.py dead
Reason- There are many wrappers like snekcord and hikari which already have a good name in the community
hmm
that doesnt respond to "i wont be able to make one" but i guess they will take dpys place
i am moving to discord.cpp anyways ig
Indeed. I meant, I can't make one for the community or something
or whatever that is called
Ah, good for u
im also moving, maybe discordgo
yea?
yes I have to say it from my bottom of my heart 😢
yes
so can i still use
good luck to yall
it
Till April next year, yes
Same to you!
what will happen to the bots
wdym
Message Intents will release by then
like if any bots which used to work on dpy
oh no
hek
Yup
then which wrapper or module should we use to make discord bots in python.
!pypi snekcord
!pypi hikari
I WORKED FOR MONTHS ON MY DPY BOT 😭
Same
snekcord, but im not sure if its complete
was any very famous or verified bots made in dpy?
ME TOO 😿
carl-bot
Carl
covid-bot
mayb
carl-bot is in 3.6m servers and is written in discord.py
I wouldn't exactly be surprised if it wouldn't work anymore.
😭
Nah, they will possibly move to another wrapper
anyone got the link to hikari
hikari sucks
discord.py is maintained by 1 person and he isn't even a full-time programmer, he just works on discord.py in his free time
yep
if i were you i'd probably just move on to matrix
it blows but.. it's the only idea i have in my mind
well python's bot here will likely go down but
!pypi matrix
It's a website
this is sad
if python's guild here doesn't want to well to make a fork
😭
!pypi hikari
I will gladly make a project in order to make one
it sucks
Where is the d.js server
man they'd make thier own API wrapper those people are boss
now i gotta re-make my entire verified bot in another language
discord.py was even better than that
Thanks
WAIT
YOU HAVE A VERIFIED BOT?!
wtf
if python's guild went through the work they could understand Danny's code and update it
do you?
no
yes...?
im still making it
whats it called
I have one that uses discord.py as well with full intents lol
i will invite to my server
really?!
yussssss python community is strong asf
I don't how to verify my one tho
yes
you guys are LEGENDS!
I feel like the fact I help my own communtity of programmers with discord's api
is more impresssive lol
Aw, well what's the bot about?
WOag
it used to be for simple utilities since i was lazy to manage and create a bunch of roles for my server but now its multi-purpose
someone discord.py from Rapptz and update it please 😢
hopefully someone takes over discord.py
Ah, well if you want, I can help u convert it from discord.py to hikari or something? (I code in my free time so don't be dependent on me or something)
I want too bro or sis
verified bots are bae 😄
well Dutchy has enchanced disocrd.py fork
i might re-make it in another language if discord.py has no activity in the next few weeks
Ok well imma make the most of dpy
WHO?
there will be someone
OMG , NO WAY
UR A VERIFIED BOT DEVELOPER!!!!!!
chill

Hm?
can someone take the ownership of discord.py
does sending an ephemeral message counts as 1 API call?
try this:
https://github.com/iDutchy/discord.py
It should
can u?
unforatetnly only danny can but someone can make a good fork
does anyone know
Kylee is a master code and he can fork and maintain it :D
if this person is willing
and knows what they are doing
I will gladly check it out if they do something(anyway I am going to check out my programming guild)
py or discord.py
py
transfer the ownership
🤔 the owners of the python guild hopefully will think about it
like they would know how to handle it very well right
@visual island u r in demand 
danny is unlike to
No 🤦
someone ping them
No don't
why did you ping them? tha's not a good idea

Cz he didn't see the message 
:sigh: I hope they don't blame me for the ping
sad

Nah
I hate u 
lol
I love you (:
got burned @maiden fable
@bot.command()
@commands.is_nsfw()
async def anal(ctx):
async with aiohttp.ClientSession() as session:
request = await session.get('https://nekos.life/api/v2/img/anal')
anal = await request.json()
embed = discord.Embed(color=0xf6dbd8)
embed.set_image(url=anal['url'])
await ctx.send(embed=embed)
else:
await ctx.reply("`Critical Error` - Channel Is Not Marked As `NSFW`")``` im getting an indentation error at "else", i know its simple and basic, but i cant figure it out

Anyways, @visual island what do u think u r gonna do now tho? Switch to another lib?
@bot.command()
@commands.is_nsfw()
async def anal(ctx):
try:
async with aiohttp.ClientSession() as session:
request = await session.get('https://nekos.life/api/v2/img/anal')
anal = await request.json()
embed = discord.Embed(color=0xf6dbd8)
embed.set_image(url=anal['url'])
await ctx.send(embed=embed)
except:
await ctx.reply("`Critical Error` - Channel Is Not Marked As `NSFW`")``` Try that
yeah js
thanks
anyways how to pick a random element from json list?
Ah, so u gonna use d.js now?
except:
^
IndentationError: unindent does not match any outer indentation level
random.choice(list)?
Hm one esc
empty except 
yeah ofc ethen what to do?
code please?
@bot.command()
@commands.is_nsfw()
async def anal(ctx):
try:
async with aiohttp.ClientSession() as session:
request = await session.get('https://nekos.life/api/v2/img/anal')
anal = await request.json()
embed = discord.Embed(color=0xf6dbd8)
embed.set_image(url=anal['url'])
await ctx.send(embed=embed)
except:
await ctx.reply("`Critical Error` - Channel Is Not Marked As `NSFW`")```
Eh, well it that's the case, I can always use hikari or something
yeah
request = await session.get('https://nekos.life/api/v2/img/anal')
^
IndentationError: expected an indented block
import random
array = ["hello", "world", "ok"]
randomItem = random.choice(array)
ufhaopwjfkapl kill me I'm using a code editor one sec xd
Isn't it sent through the web socket
not sure if thats what u want
@bot.command()
@commands.is_nsfw()
async def anal(ctx):
try:
async with aiohttp.ClientSession() as session:
request = await session.get('https://nekos.life/api/v2/img/anal')
anal = await request.json()
embed = discord.Embed(color=0xf6dbd8)
embed.set_image(url=anal['url'])
await ctx.send(embed=embed)
except:
await ctx.reply("`Critical Error` - Channel Is Not Marked As `NSFW`")``` This must work, I swear...
from json list dude
Bro, u gotta do that yourself
request = await session.get('https://nekos.life/api/v2/img/anal')
^
IndentationError: expected an indented block
He just gave u a raw example
Bruv what
!d json.load use this
w d y m "json list"
json.load(fp, *, cls=None, object_hook=None, parse_float=None, parse_int=None, parse_constant=None, object_pairs_hook=None, **kw)```
Deserialize *fp* (a `.read()`-supporting [text file](https://docs.python.org/3.10/glossary.html#term-text-file) or [binary file](https://docs.python.org/3.10/glossary.html#term-binary-file) containing a JSON document) to a Python object using this [conversion table](https://docs.python.org/3.10/library/json.html#json-to-py-table).
*object\_hook* is an optional function that will be called with the result of any object literal decoded (a [`dict`](https://docs.python.org/3.10/library/stdtypes.html#dict "dict")). The return value of *object\_hook* will be used instead of the [`dict`](https://docs.python.org/3.10/library/stdtypes.html#dict "dict"). This feature can be used to implement custom decoders (e.g. [JSON-RPC](http://www.jsonrpc.org) class hinting).
*object\_pairs\_hook* is an optional function that will be called with the result of any object literal decoded with an ordered list of pairs. The return value of *object\_pairs\_hook* will be used instead of the [`dict`](https://docs.python.org/3.10/library/stdtypes.html#dict "dict"). This feature can be used to implement custom decoders. If *object\_hook* is also defined, the *object\_pairs\_hook* takes priority.
oh
hbu?
@bot.command()
@commands.is_nsfw()
async def anal(ctx):
try:
async with aiohttp.ClientSession() as session:
request = await session.get('https://nekos.life/api/v2/img/anal')
anal = await request.json()
embed = discord.Embed(color=0xf6dbd8)
embed.set_image(url=anal['url'])
await ctx.send(embed=embed)
except:
await ctx.reply("`Critical Error` - Channel Is Not Marked As `NSFW`")``` Didn't see the : on line 5
no errors, works, ty lol
xd np, sorry that took a while... I'm just stupid
Eh, idk. I still gotta think about what to do of my AI Bot (most probably I'mma shut it down)... And I'mma just find some other python libs to master... I got a friend who does various random projects for real life people and I can just help him finish/code them
btw, wanna make our own lib?
And thinking of opening the AI API to everyone
Sure. But I don't really know the whole thing, just parts of it (but I would love doing that)
I was planning on making my own as well
Ah, cool
ah, i'll contribute there for sure
Well I gotta see how cool down and stuff work, read discord docs and stuff 
cooldowns aren't a part of the API
Ah
that was all done on discord.py's end
Oh
Hmm, gotta see how they implemented it
The API Part should be easy
Send requests using aiohttp and read the response
it's just seeing the last message sent by a specific bucketType in the cache then compare it to datetime.now() i believe
I don't know if I should just create a new wrapper since I don't really like how cluttered discord.py internals are
Or if I should just keep editting my fork
either way I don't think it would need immediate action
you can, but surely took a long work
Hmm
Well, I do have some sort of base as I have a private wrapper I made for testing
Since discord.py is gone, I can bet this channel would be dead most of the time, like other channels (cz mostly everyone used it and I don't think anyone would want to switch over to any other wrapper)
ded channel
The private one I made was only for testing
damn u made a wrapper ! awesome
make it public 
So, have people talked about this and what does it mean for bots?
https://gist.github.com/Rapptz/4a2f62751b9600a31a0d3c78100287f1
no updates will come
Either switch over or kill your bot
the discord.py library will be gone, but a fork could save old bot code in discord.py
Hopefully someone picks up the code
Yes
Isn't discord.js now the only way to code your bot?
there jda php
But tbh, the discord.py was is a huge part of my life and that's the place from where I learnt Python from the very start
more
!pypi hikari also
same
snekcord also
i agree
Everyone will
There's C and Rust too
damn i thought discord was good
Aren't those all tiny though
Doubt if anyone will a fully switch
idk if this will reduce discord's popularity
Yeah not big communities
It's gonna kill a lot of bots
Userbase? No
Programmer base? Yes
Bot devs specifically
yes
userbase, yes
cause not everyone likes slash command
This... I just learnt how to use the Discord.py for my both :T
discord - ded
I have experienced that... My brother (he's 11) joined discord and I wrote a complaint to discord regarding that... But, the response from discord was This isn't the correct complaint topic to report here. please submit a complaint again after changing the category of the complaint 
crap
Happened around last October or something
lol sadness
I mean, large bot devs will most probably port to d.js or something so that they're not affected, to the unsuspecting average Discord user this isn't even a big change
^
Like me
its much easier to collectively fork d.py than port huge codebases to another library in another language
Cz I don't have the time, resources to port to another language also I don't get anything from rewriting my bot as I do it for fun only
alright i have exam rn
Best of Luck!
Or me 
Although my bot is used in like 2/3 servers of 5k+ people, but still I'm alone and don't have time xD
Yeah true
Same
thanks :)
My friend has a bot that's used in like 1k servers it's going to be a huge blow for him
So... We should all start preparing and moving over to d.js?
Yup sad for him
He's been hosting it for two years now
djs isn't the only option
Eh, idk. Message Intents is also a problem
could i still ask for help for dpy bots tho
Sure
yes, why not
What's the option that won't be killed tomorrow? XD
Till April 2022, dpy would work
Oh nice
d.js if you wanna be safe
d.js has its quirks
try:
if channel == ctx.channel:
await ctx.message.delete()
await ctx.send(embed=main_embed)
else:
await ctx.reply(embed=main_embed)
except ctx.subcommand_passed:
error_embed = discord.Embed(title="Command Error!", description="The subcommand you requested for does not exist!")
message = await ctx.reply(embed=error_embed)
await asyncio.sleep(1)
await ctx.message.delete()
await message.delete()
return
```so i have this but it doesnt work. no errors logged.
That's not how u do a try except
what i want is when the subcommand doesnt exist, it sends error_embed
U need an error in except
True, but that's the only viable option rn?
i tried if and else but it doesnt work then someone told me to use try and except
oh
rip 8k+ lines :)
look at the list of libraries discord gives on their documentation
Hikari, Snekcord
Yea true. I also have a ton of discord.py bot files (different bots) and now, they all are a waste (great)
Is there an on_command_error for NoneType?
Cool
if error is None 
Are they removing py from discord api or something?
How to get content of an embed?
.to_dict()
What're you going to do now, I've seen you here often and you seem like you're always putting in a lot of work
no, its a third party library anyways, theres lots of other python libraries out there
Well its the one that connects discord bots no?
Discord.py is dead :((
Well, yea. Discord.py was the motivation I learnt Python and stuff. For now, I will be thinking to either delete my bot or rewrite it (I am more inclined towards deleting), and just making my AI API open to everyone so that anyone can use it. As for the future, I am thinking to either learn a new library in Python itself, or just help my friend who codes many different random projects
Is there any idea of switching to a whole another language
no i meanr python discord libraries
@maiden fable
Nope, not for now. I want to master Python cz it has been the best thing that has happened to me in my life. This community has given me soo much, has inspired me too much, and I can't leave it just cz discord.py got shut. I just want to learn more of it and new libs in it (:
Yup
I hope someone will try to maintain the Library
But I don't think it will happen :(
they can't, it's archived now
same
Fork
danny explicitly said there will be no maintainer
best one can do is fork
Ik
but there will be lots of forks
Yea
Yeah
It would be a different Library then tho
Breh, the messages ain't editing 
depends on how many old stuff the fork owner changes
@slate swan what about u tho?
That's truly awesome don't lose hope <3
My bot reached over 75 guilds, turned out around 40 of them were bot farms, i had to remove it from all of them, it was just recovering but meh
wait how do u remove a bot from a server?
Indeed
also how did u know they were bot farms
Bot.leave_guild, i forgot what was it
U gotta use an eval
More bots, less people (:
!d discord.Guild.leave
await leave()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Leaves the guild.
Note
You cannot leave the guild that you own, you must delete it instead via [`delete()`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild.delete "discord.Guild.delete").
Uhm I didn't have much to lose tbh, I've been hosting my bot for only 6 or so months and it's only been in like 100 servers
Oh yeah
oh
also is it possible for a bot to own a server?
oh
Yes
Dang, my AI Chatbot is in 55 but I think I'mma delete it
!d discord.Guild.create
wait nvm you can transfer ownership, yeah
yea
I coded this bot to learn Python and now I know a decent bit so I think I'll just switch to a more advanced langauge because I'll be needing it for uni
!d discord.ext.commands.Bot.create_guild
await create_guild(name, region=None, icon=None, *, code=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`Guild`](https://discordpy.readthedocs.io/en/stable/api.html#discord.Guild "discord.Guild").
Bot accounts in more than 10 guilds are not allowed to create guilds.
There
oh
Bots can create guilds? W h a t
Ah cool. Best of luck!
Trust me, as a person who dove a bit into AI, I have mad respect for you 😭
Bots in less than 10 guilds
Oh
Thanks Hunter and you too ♥️
Everytime i feel like i have learnt enough something new comes up
Haha I can always allow u access to the API if u want :D
Breh my net :c
Thanks :D
I eventually ended up dropping the whole project for another topic :c
hey, is it possible to add another tag to this string for "link in soup.find_all('a'):"
Neural networking was really tough and I didn't have the time to
i built a chatbot using pytorch but i have no idea wtf is going on
Ah I know that. U lose motivation, u drop that project. It has happened with me 316461949404 times (that's totally not a random number)
the api is public but without rate limiting, surprisingly no one DDOSed it yet
Hmm, I used AIML (u can search it up, it's sort of pattern matchmaking)
I got about 65k AIML lines of code for the AI
Wow
Yea but it's all a waste cz I can't think of something to do with it
It's a general chatbot (it can also remember name, age and stuff)
it didnt remembered my birthday 
But it did remember yr name
Never said it can remember your birthday haha. I had to add it in a few days, but no use now
And u also made it say things against me 
lol
Phew I can't even imagine how manu hours you spent coding
Uhh, I started coding just like in September-end last year
So not even one year since I have been coding
The fact that Discord doesn't even acknowledge this just shows peak arrogance
Yes
Yet you've managed to do so much
Eh, I haven't done so much. Just some basic projects 
"Just some basic projects"
Proceeds to create an AI API
As I said it's just pattern matching. Also, I lose interest/inspiration very easily
I mean when there's no obvious reward it's natural
The teeny euphoria you get when your code runs is all that you can live for
Yup haha
I was too excited when I made my first bot with discord.py . It was my first day and I used discord.Client and on_message (the example in the docs). I just removed one line if message.author == client.user: return and the bot replied to itself. 😂🤣 I was so fucking happy that I know how to code now
So yea discord.py has given me too much haha
I get euphoria when pyright doesn't scream at me
if not link.startswith("https://discord.com/channels/") or not link.startswith("http://discord.com/channels/"):
http_embed = discord.Embed(title="Command Error!", description="your link needs to begin with `https://discord.com/channels/` or `http://discord.com/channels`!")
await ctx.reply(embed=http_embed)
```this `link.startswith` caused an error
what is link?
What are some beginner commands to add to my discord bot to help me learn
an arg
ban, kick, meme, rank, user info, server info etc
@client.command(aliases=['jtl', 'jumplink', 'jump', 'j'])
async def jumptolink(ctx, link=None, *, message = None):
you sure you are passing the arg?


