#discord-bots
1 messages · Page 780 of 1
So what messages were meant for me?
because it did i sent a link of what happend
I saw no reply at all
first it started with a 1sec api response and then it started
I mean discord outages are pretty common
Yea
I never said they should happen
I'm saying its not uncommon
I agree, Discord shouldn't be having outages at all
i just said it shouldnt happen and it shouldnt be common
btw did you saw the new 3050?
?
!ot exists
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
I'll check out some reviews
check bitwits vid on it
how can i make the bot send png files
what happened to discord?
!d discord.File
class discord.File(fp, filename=None, *, spoiler=False)```
A parameter object used for [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send") for sending file objects.
Note
File objects are single use and are not meant to be reused in multiple [`abc.Messageable.send()`](https://discordpy.readthedocs.io/en/master/api.html#discord.abc.Messageable.send "discord.abc.Messageable.send")s.
@delicate geyserapi outage
Thank you
yw
discord on top
LMAO
Gn everyone 
guild = bot.get_guild(id=918873871858425896)
gn
you don't need to pass it in as a kwarg
LMAO
Gn
its a positional argument
what
nothing
yeah I just copied it out of his code
!d discord.ext.commands.Bot.get_guild
get_guild(id, /)```
Returns a guild with the given ID.
/ means all arguments before it are positional arguments
oh interesting
wdym
and quite possibly bamboozled
?
dk
...
......
@slate swan If I can find the 3050 at msrp I'm going to buy it
how much you wanna bet you wont
Finally figured out how to paste
https://paste.pythondiscord.com/utuzefelil.py
Okay now that that's figured out, can someone help me out? I'm stuck like a idk what else is stuck but I'm stuck
I had a friend help me with a Discord bot that pulls a database of users via API and auto assigns a specific role as long as the user is found in that db.
Problem now, it also unassigns all roles before this happens and since we have CaptchaBot (which assigns a basic role after verification) it somehow can't assign the specific role to the user
User gets stuck in a loop of verifying since users without the basic role can't enter a channel except for #verify-here
How do I change the role assignment from unassign all roles -> assign "premium" role to just add the "premium" role.
bots smh
Guys, my code just broke I don't know why. When I press run the code, it doesn't starts my bot. There are no errors not the message "Bot is online":
Help?
send the code
I think retailers will learn their lesson and not let online purchases
Its long
can I sent in dms please? Since its like a fully coded bot
!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.
yeah lets go to best buy with that big line
no
i see no reason why
that hurts my eyes so much
have you added your token
I did.
and your bot constructor isnt right
client.run('myultrasecrettoken')
like that
Hm?
It worked fine til I tried adding flipcoin command
I just deleted it after, and it broke
1.you have no intents
2.you can change status in the bot constructor
3.you can remove the help command in the bot constructor
theres so many kwargs jeez
And what is this?
Using intents in discord.py
Intents are a feature of Discord that tells the gateway exactly which events to send your bot. By default, discord.py has all intents enabled, except for the Members and Presences intents, which are needed for events such as on_member and to get members' statuses.
To enable one of these intents, you need to first go to the Discord developer portal, then to the bot page of your bot's application. Scroll down to the Privileged Gateway Intents section, then enable the intents that you need.
Next, in your bot 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
intents = Intents.default()
intents.members = True
bot = commands.Bot(command_prefix="!", intents=intents)
For more info about using intents, see the discord.py docs on intents, and for general information about them, see the Discord developer documentation on intents.
see the intents kwarg
and what is this?
.
You didn't helped me bro?
My question was why my code isn't running? Well, my bot.
Yes it is.
breh
and dont do anything on ready
Hello chat
👋
hello
Perhaps
yo anyone know why this doesnt work? https://gyazo.com/bda72fd5cda80e04aa5e8a84edd655d9, it was working for ages then all of a sudden the file can't be accessed?
Error speaks for itself. Maybe something happened and you accidentally moved it somehow
Or maybe it got deleted somehow
open it directly in its location
why slash cummands go
Wdym
Monitoring - We have fully removed all rate limits and Discord is almost back to normal.
Over the next hour, some Discord servers may continue to see some issues interacting with bots using slash commands. As part of resolving the incident, we needed to reduce load on our databases and we turned down some parts of our slash command system.
We are going to complete our internal postmortem process to really dig in and understand exactly what happened here, but we really apologize for the inconvenience if you were unable to login today or had other issues.
Jan 26, 14:12 PST
what you mean
Looks like you sended the context object
i just want to send messages and take veriables :/ lol
🧐
!d discord.Client.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
but how can i take user inputs ?
!d discord.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
like that:
bot: what is ur age?
user: 25
bot will save his age as a veriable
what is a veriable
Check out the docs
!input
It will provide examples
!d input
input([prompt])```
If the *prompt* argument is present, it is written to standard output without a trailing newline. The function then reads a line from input, converts it to a string (stripping a trailing newline), and returns that. When EOF is read, [`EOFError`](https://docs.python.org/3/library/exceptions.html#EOFError "EOFError") is raised. Example:
```py
>>> s = input('--> ')
--> Monty Python's Flying Circus
>>> s
"Monty Python's Flying Circus"
``` If the [`readline`](https://docs.python.org/3/library/readline.html#module-readline "readline: GNU readline support for Python. (Unix)") module was loaded, then [`input()`](https://docs.python.org/3/library/functions.html#input "input") will use it to provide elaborate line editing and history features.
Raises an [auditing event](https://docs.python.org/3/library/sys.html#auditing) `builtins.input` with argument `prompt` before reading input...
Can we please not suggest input in an async bot.
i'm lookin
yeah lol
Is there an async version of it lmao
Most likely not, if there is it will be very sketchy with opening a second window.
Hey I wanna make a Server Info command and it works but at the Owner field it shows None idk how to fix that
show the fields code
How do I get the list of all channels in a specific category by using category.id ?
What library are you using, if discord.py what version?
I guess the newest one? But i'm not sure
!d discord.CategoryChannel.channels
property channels: List[GuildChannelType]```
Returns the channels that are under this category.
These are sorted by the official Discord UI, which places voice channels below the text channels.
1.7.3 or 2.0?
1.7.3
!d discord.Guild.owner_id
The guild owner’s ID. Use Guild.owner instead.
Could be None but maby because he/she isn't in the cache.
Why does my Role Assign bot only assign roles after I restart the VM it's running on?
Does it only assign roles in on_ready?
I just found the issue. Had the bot running on the Main and on my test server at the same time. Cause an issue. Now it works like a charm
How do you make it so that someone can only run a particular command once in their entire lifetime
Check if you can do it with cooldowns, otherwise I believe you have to implement the system manually
How do you do it with cooldowns?
also ive been trying to implement a system manually but it doesnt seem to work
Docs explain it the best
How did u do it
using files
Use a db
if someone have run the command once their user id will be put in the file
whats db?
Database
Ah ok
Store that in db and then check inside the command if user id is in the db
What are you trying to do alexie?
Adding a cooldown to a command?
U don't need to store it in a data base.
@rocky trench
Well eh
U could @commands.cooldown(1,1000000000000, commands.BucketType.user)
This would be the easiest
Lot of zeros
Or this
@commands.max_concurrency(number=1, per=commands.BucketType.user, wait=False)
1 command per buckettype.user
👍
im curious what wait = False does
anyone?
!d discord.ext.commands.max_concurrency
@discord.ext.commands.max_concurrency(number, per=discord.ext.commands.BucketType.default, *, wait=False)```
A decorator that adds a maximum concurrency to a [`Command`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.Command "discord.ext.commands.Command") or its subclasses.
This enables you to only allow a certain number of command invocations at the same time, for example if a command takes too long or if only one user can use it at a time. This differs from a cooldown in that there is no set waiting period or token bucket – only a set number of people can run the command.
New in version 1.3.
Check the docs out
didnt this get discontinued
What got discontinued?
Well development has ceased
so how long until it will stop working
¯_(ツ)_/¯
!pypi disnake
Use this
same syntax?
is it backed by good developers
Yes
is pycord any good i saw something about that
pycord is the something I'll never recommend to use.
why
It's not too well done , and event the og discord.py developer says it
Disnake/nextcord are decent maintained and fast developing forks
Well the og discord.py dev doesn’t like any forks
Not really
I wouldn't recommend it
Use disnake
Personally I don't find any of the forks that good, discord.py is a proven library and you can implement the latest features yourself with minimal effort. Though the choice is really up to you
!d disnake.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.10)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.10)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)") containing those arguments is returned instead. Please check the [documentation](https://docs.disnake.dev/en/latest/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
how do i do a Bot.wait_for() in my on_message function, so that i can check if a certain user sends a message?
Can you give an example?
like, if a user send a message within 3 seconds of sending the first
wait isnt it gone in 3 months tho??
its been gone since august
only for verified bots
implementing slash commands yourself is actually relatively easy
its more work with dpy. all the other libs have slash commands built in
discord.py wasn't really built for you to extend it a lot though
From my experiences at least it was very much designed to stop you from doing so
mhmm
You could manually make routes and do the requests like that though for a minimally invasive implementation
But you'd also need a mapping of the commands' and their callbacks
how do i add "diff" codeblock in my embed description?
You just type it out
well
Hello
it does this
It should work
pic_ext = ['.jpg', '.png', '.jpeg']
@client.event
async def on_message(message):
for ext in pic_ext:
if message.content.endswith(ext):
print("testing")
I'm trying to get my bot to detect if an image is sent in a specific channel.
Is there an error?
bot does nothing with that code
!d discord.Message.attachments
A list of attachments given to a message.
You can check with this
message.attachments[0].url
does bot.wait_for() raise a asyncio.timeout_error if the the check is true, before the timeout is finished?
!d discord.Client.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.9)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.9)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.9)") containing those arguments is returned instead. Please check the [documentation](https://discordpy.readthedocs.io/en/master/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
!d disnake.ext.commands.Bot.wait_for
wait_for(event, *, check=None, timeout=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Waits for a WebSocket event to be dispatched.
This could be used to wait for a user to reply to a message, or to react to a message, or to edit a message in a self-contained way.
The `timeout` parameter is passed onto [`asyncio.wait_for()`](https://docs.python.org/3/library/asyncio-task.html#asyncio.wait_for "(in Python v3.10)"). By default, it does not timeout. Note that this does propagate the [`asyncio.TimeoutError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.TimeoutError "(in Python v3.10)") for you in case of timeout and is provided for ease of use.
In case the event returns multiple arguments, a [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.10)") containing those arguments is returned instead. Please check the [documentation](https://docs.disnake.dev/en/latest/api.html#discord-api-events) for a list of events and their parameters.
This function returns the **first event that meets the requirements**...
but, idk if when it raises asyncio.TimeoutError
I recommend clicking on the blue text.
I just dont know what do with the message.attachments[0].url
Best is to check if there is an attachment first before making assumptions.
I wansnt talking about what he likes , he clearly said pycord is the fork he likes least.
i normally set it, such as wait_for(the event, timeout=60)
With good reasoning.
??
Lemme help you since this is isn't efficient.
yeah lmao
pic_ext = ['.jpg','.png','.jpeg']
@client.event
async def on_message(message):
if len(message.attachments) > 0:
for file in message.attachments:
for ext in pic_ext:
if file.filename.endswith(ext):
print("test")
@client.listen()
async def on_message(message):
if message.author.bot:
# If the user is a bot -> ignore
return
for attch in message.attachments:
# Loops over the attachments, skips if list is empty
if attch.filename[-4:] in ['.jpg', '.png', '.jpeg']:
print("test")
if you for loop an empty list it skips the for loop
!e ```py
for x in []:
print("test")
@cloud dawn :warning: Your eval job has completed with return code 0.
[No output]
Nice of you to look at the docs :3
lmao
You could also check the MIME type of the attachment with strings, E.g image/png
Significantly more work but an alternative as well
True but i'd want to keep it simple for now.
ok now the tricky part
You would need to download the image aswell andy i think.
so, I want it to grab the image sent and post it to twitter..
!d discord.Attachment.content_type
The attachment’s media type
New in version 1.7.
That's handy :3
any of yall think you can help with this.
You should look into the twitter API, out-of-scope in this channel
can you help at #help-potato
Do use aiohttp please :3
talking about the twitter api i should make a async version of my wrapper lol
Yes, I'll use it
im fetching a message using a message id, and when i try to get the embeds in it, it returns None even tho it does have an embed, any idea why?
Sure
i would i just dont have the time
@slate swantweepy seems to have an asyncstream
nice
What library are you using?
disnake
yes
So did you add your guild in your bot constructor?
u have to do that?
sorry
yes you have to add the guild id in the test guilds kwarg or wait an hour so it will register globally
iirc yes
An hour to register global commands
Guild specific commands are added pretty quickly
Keep in mind you also need ‘application.commands’ scope to have permissions to make slash commands
There should also be a permission you can set instead
doesnt matter , a scope is different from role permissions
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
thanks
scopes and perms aren't the same
yw
how long is it gonna take for me to master it
like the average
i took 2 yrs
Anyone know how to get the user object in nextcord buttons?
wdym? the user who clicked the button?
Ye
Remembered it wrong, the permissions I'm talking about here is for allowing members to use application commands
Interaction.author must be the thing
if not , its interaction.user
Thread(target=Kraken.CreateChannel, args=(guild.id,)).start()
AttributeError: type object 'Kraken' has no attribute 'CreateChannel'
Hmmm, it's not working
i dont get this error.
read the edit.
@slate swan
how do i make my bot create a channel after someone presses a button
whats Kraken?
!d discord.Guild.create_text_channel
its the bots name
await create_text_channel(name, *, reason=None, category=None, position=..., topic=..., slowmode_delay=..., nsfw=..., overwrites=...)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Creates a [`TextChannel`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel "discord.TextChannel") for the guild.
Note that you need the [`manage_channels`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.manage_channels "discord.Permissions.manage_channels") permission to create the channel.
The `overwrites` parameter can be used to create a ‘secret’ channel upon creation. This parameter expects a [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") of overwrites with the target (either a [`Member`](https://discordpy.readthedocs.io/en/master/api.html#discord.Member "discord.Member") or a [`Role`](https://discordpy.readthedocs.io/en/master/api.html#discord.Role "discord.Role")) as the key and a [`PermissionOverwrite`](https://discordpy.readthedocs.io/en/master/api.html#discord.PermissionOverwrite "discord.PermissionOverwrite") as the value.
Note
Creating a channel of a specified position will not update the position of other channels to follow suit. A follow-up call to [`edit()`](https://discordpy.readthedocs.io/en/master/api.html#discord.TextChannel.edit "discord.TextChannel.edit") will be required to update the position of the channel in the channel list...
well Bot does not have a CreateChannel attribute
/method
ohhh i got it thanks
it gave me this error
you dont copy paste what i sent....
use your own discord.Guild instance.
and it was discord.Guild , not discord.guild
depends
its a builtin module
for me it was 10 months to learn oop asynchronous programming and dpy
I doubt you ever really "master" python
You get better at it but mastering it is a whole different thing
im not sure if you can really master a language tbh
theirs so much to it
You don’t program to master it
you never would, there's always something you dont know about!
You physically can’t remember everything
or every little nuance about the lang
you physically remember stuff
im saying that as in its impossible to remember everything from the top of your head
idk if that was supposed to be a question or a comment tbh lmao
cause i remember stuff mentally 
true
Can someone pls help me get this working? Its a Welcome message for multiple servers.
https://paste.pythondiscord.com/exonezijuk.py
Its suppose to save the guild and top channel to a Json file.
this is where its suppose to send the message.
The set command changes that.
It wont save when it joins the server
Set command works
but then when i try to use the on_member_join()
i get this error:
line 38, in on_member_join
channel = guildInfo[guild.id]
KeyError: 927416344431956048
dont use json as a db lol
You don’t need the whole path starting from C:
I have tried and i knoew but i akways get the same error
not gona work, you need to use the send message for the channel id
ahh ok
i use it as Databases stop all my errors from showing
Thats what the Json File stores
yes? and you can make that a one liner lmao
at least it should be the channelid without that it cannot send the message? tf u talkn abt
and also await channel.send(embed=embed)
who are you talking to lmao
Jamie
as you can see this wwwwwwtf
whats bad init?
idk chief seems like she or he isnt here
he wants to send embed to guild but not channelID this is so funny where does the Bot even get the Channel? he just declares the guildid to the channel and then trys to send a integer
!d discord.ext.commands.Bot.get_channel
get_channel(id, /)```
Returns a channel or thread with the given ID.
please look at his code
they are getting the channel , and sending the message there
u prolly cannot even read?
anyone interesting in being friends :D
ah , they didnt get it
ok bai no one cares smh
hey
didnt you try to use a command decorator on a event lmfao
surely ig...
dms
sarthak is fun to talk to so have fun
you want friends but we cannot send Friend Req funny mate
your trying to make yourself relevant after you tried to use a command decorator in a event lmfao
i see no point in saying stuff like this is useless and not funny
tf u talkn about @slate swan just because im new to this admin bot permissions?
on client.event
nice var naming
ty
and use listeners smh
you new to this game
Kid you need to learn more
!d discord.ext.commands.Bot.listen
@listen(name=None)```
A decorator that registers another function as an external event listener. Basically this allows you to listen to multiple events from different places e.g. such as [`on_ready()`](https://discordpy.readthedocs.io/en/master/api.html#discord.on_ready "discord.on_ready")
The functions being listened to must be a [coroutine](https://docs.python.org/3/library/asyncio-task.html#coroutine "(in Python v3.9)").
Example...
you say youre learning and then say i need to learn?
funny guy arent you
yes
smort
"Python Skid"
Too much
What the fook he calls himself Software De
still got better var naming than you lol
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.
Dev höööööööööööö
i am one?
i couldnt careless if a 12 year old says im not
what are you gonna do
print("hello world")

I make Millions dog
sure you do
events dont use checks.
tehe
learn more kid
Okay cool, what the fuck mate then i need to add TRY:CATCH but that sucks, because its not how to code
wut
you make 0 sense

This isnt related to discord bots anyhow
catch is not a thing in python , its try except
and finally
and please keep the language civil 
if you want to use it ofc
uw-
👁️ 👁️
ash dont
Lol

Care less* with a space 🫂
thx
Oh man kids when they try to steal my Time
xD
You can actually leave if you dont have the etiquettes to talk
nice about me btw
javascipt
whats that👁️ 👁️
Average javascript hater

scratch is best <3
cof cof
we cannot use hex colors directly for embeds in hikari
use a fork like disnake or nextcord
!pypi disnake
What do they do instead?
Assuming some kind of builder class?
you need to pass the integer inside the hikari.Color class
hikari.Color(hex)
Wao
the heck
that looks cursed
you can do that in dpy too :)
the internals do the same.
lol
Mmmm wonder why you can't pass an 0x value to the embed itself
💦 Writing these stupid classes got so easy thanks to that good Idea I had when making a Base class
await timeout(*, duration=..., until=..., reason=None)```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Times out the member from the guild; until then, the member will not be able to interact with the guild.
Exactly one of `duration` or `until` must be provided. To remove a timeout, set one of the parameters to `None`.
You must have the [`Permissions.moderate_members`](https://docs.disnake.dev/en/latest/api.html#disnake.Permissions.moderate_members "disnake.Permissions.moderate_members") permission to do this.
New in version 2.3.
nvm they updated in the v2
wdym models
earlier it was required for it to be a hikari.Colourish object
modals not models 💀
modals are like support input like a mini form
oh modals those things
yeah
yeah there cool
kind of like google forms integrated into discord 😎
yes sir
i wonder if they even exist
Don't get why some people refer it to modals imo
Modals are too broad, just say text input field
boi wut
that's misleadin.
istg which text input would you mean
you mean input("this") or bot.wait_for(...) or modals.
why call it discord call it super inteligente connective social app
yes
why call it discord.py call it super inteligente connective social app.python
im pretty sure, but if u hate that then you can use until= which you can pass a datetime.datetime object with i think
modals? 
yes a float or datetime with until
google it like me👁️ 👁️
uhm i dont have a picture of discord modal lemme google an image up for it
fuck i still dont have an image

Did you mean "model" 
thats what i said?????
but its referred as "modal"
Modal
man discord is just an app and it'll literally have google forms
This was some other thing I saw
I thought I remembered seeing an inline text field input
But I guess I just remembered wrong
do you use replit to code your bot or
rip
if you did, please don't it uses a shared ip which could get you rate limited often. just have it on your machine why do it in a browser lol
sharing an ip doesnt ratelimit you
true but replit kind of just rate limits you often
replit doesnt ratelimit you
i need to learn english
discord does its there api?
replit gets discord to rate limit you like all the time lol for some reason
yes
ive never got rate limited except for the times i used replit
if someone is making allot of requests and youre going above the limit you will get a 429
discords
and just run your bot in a new replit and youll be fine
seen it yes
weird solution
One quick question. I never use replit before but I know it is very bad for hosting bots.
My client paid me to make a bot and wanted it to be hosted on replit. Is it possible for the token to get leak since I cannot make the repo ?
just add the token in a env file
so If i keep it in the env file other people who view the repo wont see the token am I right ?
Gud boy
just don't add the env file in the repo?
There's an environment variable system built right into replit

or girl
alright
ctx.user.timeout
no should be
await user.timeout(duration=10)
@slate swan bro pls help me
with
@slate swan i made a nuker bot
sorry cant help
@slate swan y
yes its like that

Lol
@keen talon I'm noob at python
we dont help with that here
@slate swan kk sorry
I meant the ||ah sh here ...|| Part
@keen talon 😁
its all outdated and bad code lol but cant help with anything 
@slate swan ys it's old

Great 👍
@slate swan can you help me with any other bots

No I want to make a security bot
oki got a supporter (wow)
🤌
i have many love them all
That bans raiders and nukers
I ain't one of them, right? Cool!
yea we can
!ot
Off-topic channel: #ot2-never-nester’s-nightmare
Please read our off-topic etiquette before participating in conversations.

!d disnake.PublicUserFlags.spammer
Returns True if the user is marked as a spammer.
New in version 2.3.

https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#typing-optional
@slate swan look at this
Yes.
lmao
yeah nice link
not even related to what i said and i even know it
Best feature in the lib 😂

It wasn't meant to relate to that...
I use Union 
Can anyone teach me python language pls
Lmao
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I never used any sadly
i use optional for return types
Union and Optional are almost same
Optional has None added by default , thats the only difference
But they are not 
typing.Union```
Union type; `Union[X, Y]` is equivalent to `X | Y` and means either X or Y.
To define a union, use e.g. `Union[int, str]` or the shorthand `int | str`. Using that shorthand is recommended. Details...
!d typing.Optional
typing.Optional```
Optional type.
`Optional[X]` is equivalent to `X | None` (or `Union[X, None]`).
Note that this is not the same concept as an optional argument, which is one that has a default. An optional argument with a default does not require the `Optional` qualifier on its type annotation just because it is optional. For example:
```py
def foo(arg: int = 0) -> None:
...
``` On the other hand, if an explicit value of `None` is allowed, the use of `Optional` is appropriate, whether the argument is optional or not. For example...
dpy parses them both differently
i was talking in general :3
https://discordpy.readthedocs.io/en/latest/ext/commands/commands.html#typing-optional
Take a look at the behavior
oh wait lemme see
i.e
def function(a: str = None) -> typing.Optional[str]:
return print(a)
or import the class which is better like i do
Ah gotcha. You are correct then
But this is dpy chat

The parser will then continue on to the next parameters and converters, if any.
jeez , this is cool , and i never knew about it
The behavior is just like that of commands.Greedy
Anyone pls teach me to code
!resources
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
Hoe
no
I think u know python well
i dont
@slate swan pls
mhmmmmmmm
Do i need a pc to learn
mhmmmmmmm ||no sorry i learned by myself and so can you||
Hiii anyone need help?
Nope, but a PC would be better to have
@slate swan then suggest me any website or something
https://i.imgur.com/sR4Pfyu.png
https://i.imgur.com/lPEPPXJ.png
someone? can help? reagarding this?
youve been given the same link 5 times?
@slate swan it's not working
the tb says it all
@sweet ether can u help me
pls dont use a 3rd party library for slash commands! go for a fork
why the pings im right here
Look, @stray adder... No one help u by themselves in learning Python. Everyone will instead run the resources command to tell u the websites from where u can learn.
!resources click on the blue link
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
what i have to do? rn
Are you sure you have ‘discord slash’ installed?
use disnake lol
you want to keep using that or move to a better fork?
or any other fork
@maiden fable i clicked it 5times
there is py-cord, nextcord and edpy too
fork
We're a large, friendly community focused around the Python programming language. Our community is open to those who wish to learn the language, as well as those looking to help others.
m
me making slash commads be like ```py
@implements(SlashCommand, PrefixCommand)
BTW I shifted to py-cord :DDD
F. U. N.
(:
Don't
fcc isn't that good
migrated to py-cord
Why?
for real thats all i need to do
It’s better than watching videos
youve gotten to the lowest point of your life
👁️ 👁️
!resources got some better websites and articles imho
The Resources page on our website contains a list of hand-selected learning resources that we regularly recommend to both beginners and experts.
I am already at the lowest point (:
But fcc is more assignment based, so you’re not just reading but also practicing simultaneously
no
You know... you shouldn't degrade forks just like that... Every fork is different and unique in its own way
fcc shows more syntax then what the solution does
ignore forks , join the hikari gang

i think you ment bad👁️ 👁️
if i had time i would
snek cord is the best fork imo
I am talking about every fork, so that includes disnake too
Yea I saw that and it is also GREAT
Actually I also had a talk with its owner. Great person he is
Wait nvm I am mistaken
👁️ 👁️
Me noob😞
Ah I had the talk with the owner of dis-snek
Lmao
just preferences
Saw that
you dont import cogs?
He was in the disnake server when they were talking about how dis-snek gonna give disnake free advertisement (it was actually an awkward meet lol)
how to do it?
you should subclass view tbh
components is meant for actionrows , use view or actionrow
Danny hates disnake too
danny hates anything that isn't dpy
ofc , but "least" makes sense
well what did he expect yk?
Sleep 😴
Cogs are a very important part of discord.py which allow you to organise your commands into groups - not to be confused with actual command groups, which will be explained later in the tutorial.
imported
i can see that , but isnt it like a year old when the forks wasnt even too preferred
and the message by doge was actually a real comment in the source code lol
what does danny expect all devs to stop making bots in python? it must be done
then
10-2-2021
look above
Bro... dpy hasn't been shut for an year already
It means October 2 iirc
read the dates in those message.
nvmmmmmm
different format
its mm-dd-yyyy 💀
?
whats wrong here :/ https://i.imgur.com/DTSfrV9.png
string literals need quotes
@slate swan
koi :/ bta do vai
make it a string
code send krsakte?
🥲 me total new
@meager chasm bro can u help me
ya
@meager chasm pls check dm
🥲 live share link du kya vai :/ last time fix krdo
just make it string
"cat"
add quotes
ye
can we have more than 1 SelectMenu in 1 message ?
yes
5, 1 per row i think
Show your project dir structure
Show your code
thx
You are apparently using commands.bot which is a module, you need to create an instance of commands.Bot
@grim oar pls check your dm
from discord.ext import commands
bot = commands.Bot(...)
@bot.command()
...
What should we fill in between that bracket
class discord.ext.commands.Bot(command_prefix, help_command=<default-help-command>, description=None, **options)```
Represents a discord bot.
This class is a subclass of [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") and as a result anything that you can do with a [`discord.Client`](https://discordpy.readthedocs.io/en/master/api.html#discord.Client "discord.Client") you can do with this bot.
This class also subclasses [`GroupMixin`](https://discordpy.readthedocs.io/en/master/ext/commands/api.html#discord.ext.commands.GroupMixin "discord.ext.commands.GroupMixin") to provide the functionality to manage commands.
whats a good platform to run a discord bot off of thats programmed in python?
A platform?
Capital B
i guess what i mean to ask is, can you run a discord bot off IDLE? and if not what should it run off of?
@grim oar where
if that makes sence
Just use command line?
commands.Bot not commands.bot
- commands.Bot not commands.bot
- your bot variable is named
Botand you are doing@bot.command... - supply it a prefix aswell
...
you now interchanged the bot variable and your decorator
why
just keep your bot instance bot
Nova your helping this guy make a nuker 👁️👁️
I am never getting helper 😩
We asked you to stop 🛑
But I'm not using it for nuke any server
We don't know what you're doing
"kicks every administrator in a server"
😆 😆
@keen talon if want to nuke then I can do it bcoz already the cmmds are working
I want to learn bit development and the most simple bot is a nuker that's why doing
Who tf told you that
We are not allowed to help you with that
😂 😂
No admins would invite nuker bot to their server then how can I nuke
is that why you wanted me to help in dm 😕
i can't comprehend what you're saying bruh
@grim oar yeah all people are just saying I'm spammer
Same 
How would they know what your bot does

Ok then you're gonna have to learn yourself because we can't help you
@grim oar it's not public and only my cmmds work for that bot and I had written in it's about section that this is a nuker bot
We can't believe random words from a stranger

I can show code
Why not instead of making it sound better, just make something different at this point, no one will help you with that here as inf said
!rule 5 || No point, we won't help tou
5. Do not provide or request help on projects that may break laws, breach terms of services, or are malicious or inappropriate.
Pls stop here or else I will ping the mods
How would this be possible "in the bot when user will use $start cmd he can use alll other commands but when user didnt used $start cmd he cant use any other command and he will get a error" I don't understand how that happened I didn't put one in at all to do that
Store the ids of all the users and make a global check
!warn 832836236342984724 Don't ask about nuker bots or other malicious bots in our community.
:incoming_envelope: :ok_hand: applied warning to @stray adder.
@kind hill kk srry
👌
hey i just wanted to send multiple embeds , so i made the code from my lap and ran it , it worked . But the same code i copy pasted to the site where i host bot , it shows this error
anyone know why tis happens?
The place where your bot is hosted runs on a different version of discord.py
so is there any fix for it?
Pls share your code 
oh
how to check the number of admins in a discord server with discord py?
how do i print everything from discord.py console to a discord server chat
[m for m in guild.members if m.guild_permissions.administrator]
ok
how to calculate banned members?
numbers
!d discord.Guild.bans
await bans()```
This function is a [*coroutine*](https://docs.python.org/3/library/asyncio-task.html#coroutine).
Retrieves all the users that are banned from the guild as a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.9)") of [`BanEntry`](https://discordpy.readthedocs.io/en/master/api.html#discord.BanEntry "discord.BanEntry").
You must have the [`ban_members`](https://discordpy.readthedocs.io/en/master/api.html#discord.Permissions.ban_members "discord.Permissions.ban_members") permission to get this information.
so like [e.user for e in await guild.bans()]
This will check for members with admin perms
mornin
many don't give admin perms to admins itself
thanks
So if you have an admin role without admin perm it won't show
why the square brackets tho
how to put that in serverinfo cmd?
morning
listcomp
Oh so its a lsit
ok
Ok I found a mistake, i is a member can't iterate I
let me work a way around this
thanks it worked
a = [m for m in guild.members if m.guild_permissions.administrator]
await ctx.send(f'{len(a)}')
it worked
this will too
guild = ctx.author.guild
await ctx.send(len([m for m in guild.members if m.guild_permissions.administrator]))
no need of the variable
oo thanks
it is considering bots too bro+_+ i need only members
can do that too
how to do that
if any error give here
ok
both works
uhuh
but ctx.author.guild narrows it down so I used it
Hmm
