class NitroView(View):
async def on_timeout(self):
expire_button = Button(label='Claim', style=discord.ButtonStyle.gray, disabled=True)
view.add_item(expire_button)
view.remove_item(accept_button)
nitroexpire_embed = discord.Embed(title="You've been gifted a subscription!", description='Hmm, it seems someone already claimed this gift.')
nitroexpire_embed.set_thumbnail(url='https://i.imgur.com/wI9q2Md.png')
await self.message.edit(view=self, embed=nitroexpire_embed)
accept_button = Button(label='Claim', style=discord.ButtonStyle.green)
async def accept_callback(interaction):
await interaction.response.send_message('https://tenor.com/bItJt.gif', ephemeral=True)
nitro_embed = discord.Embed(title="You've been gifted a subscription!", description=f'{ctx.author} gifted you nitro for **1 month!**')
nitro_embed.set_thumbnail(url='https://i.imgur.com/wI9q2Md.png')
accept_button.callback = accept_callback
view = NitroView(timeout=5)
view.add_item(accept_button)
await ctx.respond(view=view, embed=nitro_embed)
#Basic Pycord Help (Quick Questions Only)
1 messages Β· Page 39 of 1
Attribute error: Nonetype object has no attribute edit
look i might be making some dumb mistake but i cant figure it out on my own, can someone please help
Alright, well it seems like things are all over the place, but first, this:
nitro_embed = discord.Embed(title="You've been gifted a subscription!", description=f'{ctx.author} gifted you nitro for **1 month!**')
nitro_embed.set_thumbnail(url='https://i.imgur.com/wI9q2Md.png')
accept_button.callback = accept_callback
view = NitroView(timeout=5)
view.add_item(accept_button)
await ctx.respond(view=view, embed=nitro_embed)
Is this under the View? Or is this in a command? By the looks of it, it seems like you just bundled everything up in a View. Also, seems like you are not using the View properly, or are carving segments of your code out.
error:
'cogs.ableton' raised an error: AttributeError: 'AbletonBot' object has no attribute '_bridge_commands'
i've subclassed my bot insance (bridge.Bot) and named it -> 'AbletonBot;
pls ping when answer
Hm, do you have super().__init__() in your subclassed __init__ by any chance?
normally an underlying attribute like that not existing can be a result of not having it.
yep
btw is that bcuz im not using 2.3.1?
What version are you using at the moment
GitHub
https://pypi.org/project/py-cord/2.3.1
What's Changed
fix(ext.bridge): fix bridge_commands attribute by @Middledot in #1802
Full Changelog: v2.3.0...v2.3.1
stable
also, how do i install the 2.3.1 version using pip
2.3.1 is already stable, so you can just pip install again
nvm i figured it out
ye alr thx
still didnt fix the error
how can i save TWO audios (wav)? Whenever I try to record two audios, it sends both audios in the chat. So I tried to save TWO audios, but I can't, because it only saves ONE, how do I save TWO?
noob here, I'm trying to run a script that will post a message to a channel without waiting for an event
bot = discord.Bot()
TOKEN = "REDACTED"
channel_id=588866881159430146
channel = bot.get_channel(channel_id)
channel.send("test")
bot.run(TOKEN)```
should this not just work?
send must be awaited inside of an async function
how should it work without it?
The Select should have the custom_id. SelectOption does not have custom_id's.
You can put that in on_ready event, or throw it into a thread
so I cant connect > puke text into channel > disconnect?
on ready event
intent is to use as notifications for other bot unrelated to discord
hey
im facing the same issue
did u find the fix yet?
or actually you don't need a bot instance to send it, sending a message is just a single http request
somebody?
I'm python smoothbrain, am coming from working go discord bot
Reorder your command options. Non required options should be placed after required ones
Hey all π is there a way to disable commands for a guild ?
put the id of all other guilds into scope ig
Others are dynamic ahah
or check for the id in callback, return if the guild id is matching
Which callback ?
command callback
Is there a "before_command" or "before_invoke" for all ? π
There is checks
commands options as in? slash commands?
Yea
it worked
thanks a lot :D
Haha np
Does pycord work with 3.11
python 3.11
I had some trouble when switching to that version
If you use the latest version, yes
Python 3.11 support was added in PyCord 2.3
If you use an earlier version you need to downgrade your Python version to 3.10 or below
Show the error and command
π
i updated the library and it fixed itself.
oh okk
placeholder = "Select One",
min_values = 1,
max_values = 1,
options = [
discord.SelectOption(
label="Support",
description="Minerva Support Ticket"
),
discord.SelectOption(
label="Bug Reports",
description="Minerva Bug Reports"
),
discord.SelectOption(
label="Premium",
description="Minerva Premium Purchase"
)
]
)
async def select_callback(self, select, interaction):
member = interaction.user
guild = interaction.guild
guild = interaction.guild
overwrites = {
guild.default_role: discord.PermissionOverwrite(read_messages=False),
member: discord.PermissionOverwrite(read_messages=True),
}
global Channel
Channel = await guild.create_text_channel(str(member) + "s Ticket" , overwrites=overwrites, category=interaction.channel.category)
await interaction.response.send_message("Created Ticket <#" + str(Channel.id) + ">", ephemeral=True)
embed=discord.Embed(title="Ticket", description="<@" + str(member.id) + ">\nSupport will be given shortly...", color=0x2F3136)
embed.set_author(name = str(interaction.user), icon_url = interaction.user.avatar.url)
await Channel.send(embed=embed, view=TicketDropdown())```
I need help getting this to work. It doesnt show the select menu when i run the command for the embed to be posted
I have a task stored in a cog to change my bot's status every 30 seconds. when attempting to start the task, i get the error
await self.ws.change_presence(activity=activity, status=status_str)
AttributeError: 'NoneType' object has no attribute 'change_presence'
below I have the code that is causing problems:
async def stat_task(self):
status_rotation_time = 30
await self.bot.change_presence(status=discord.Status.online, activity=discord.Activity(type=discord.ActivityType.watching, name=f'{len(self.bot.guilds)} servers'))
await asyncio.sleep(status_rotation_time)```
i remember this working earlier today, so im not sure whats wrong
edit: the task begins to work if I manually reload the cog after the bot has started. it seems to be something with the cog failing to connect to a websocket. what could cause this?
edit 2: I AM SO SILLY. of course there was a websocket error!! i was starting the task when the cog had loaded, not when the bot connected. put your task starters in on_ready or on_connect
facing this weird issue recently
#1048166266453639288 moved to^
Why are you using global variables?
I got it thank you
its for a ticket bot system
π
Does anyone know how I can do this? I can't find anything in the docs.
only for verified bots, and the upgrading thing are available to few popular bots
the About Me Section is done on devportal @ https://discord.com/developers/applications and can be on any bot
but yeah the rest are limited to verified bots
The new docs are not easy to use
Before you could do ctrl+f to do an approximate search, I miss it :c
The problem was it was a huge page and took forever to load. It could take up to 30 seconds for it to load my search result sometimes.
I never had this problem personally, leaving it accessible would have been cool
how can I fix this? im trying to invoke a command with a button
@barren garnet Please donβt cross post. #help-rules
could have 1 for advanced devs and beginners yk
Stay in one channel
even when i use my chromebook it doesn't take that long π
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
embed.set_image(url=self.children[0].value)```It already checks if it is a valid link how do I just make it still point to image?
Can anyone help me here?
Perhaps, it could be this.
int(nettax + netfprice) in message.content
Consider, message.content is a str.
What you are most likely experiencing is a TypeError, of the kind 'in <string>' requires string as left operand, not int.
In essence, this is not valid
print(int(30.0 + 50.0) in '80') # int(80.0) in '80'
Let me try this. Thanks for helping me !
It didn't work. If I had a type error, I would have a traceback. But instead, The bot is waiting for any message to be sent. Like if I execute the command and just send any message, It will work. And I don't want it to work! Except for the specified things that I did specify!
nevermind, a second
Don't use type as a variable. It's a python built in function. It will break stuff
Also you didn't close the cursor and connection
Ah ok
Oh, don't make the check asynchronous
looking back at it, that's one of the issues I see, besides the one I explained before
It worked. I mean I made some changes in the code after making the check not asynchronous and After that It worked. Thank you !
Yeah, okay, that was the reason for that then, I didn't catch that, wanted to check on my side and then saw that issue
Thank you for helping me !
no problem
Hello! I'm coding a economy bot, but i'm having problems. I made 2 comands with cooldown, when i use them, 3 out 6 commands of the bot dissapear. This problem never happened to me before.
I can send all the code if needed.
Is there currently any way to utilize the new Server Subscriptions metrics through the API? Like when a user purchases one of the subscriptions, do some stuff?
Yes, but there is no documentation (from discord) for it and pycord has not implemented it yet.
My guess will be 
π Ty. Server I dev for just launched their subscriptions and told me to do some stuff with it lol
the best you can do for now is make sure your subs are bound to a role and use on_member_update
then later when the api updates switch over
Yeah, discord automatically makes subscription roles once you publish, so I can just hook into those
Anyone know how to get a thread by channel ID and name?
I'm trying to allow my bot to create a thread when a user begins a questionnaire and continue sending their answers to the thread as they answer. To do this, I want to name the thread after their User ID and refer back to send the message using that name. Any advice would be loved <3
Currently trying, but not working:
channel = bot.get_channel(1048419372554780732)
thread = channel.get_thread("DrewBleam")
await thread.send("Testing?")
Currently, you canβt get a thread by name, however, you can access .threads and iterate through them and compare names to a string.
Any thoughts on how I could move said string from a class to a higher rung? I don't know the actual way to phrase that so I'm so sorry for noob LMFAO
I'm trying to get the string outside of the class to use it in a different class π₯²
What is your current code?
you can?
get_thread
https://docs.pycord.dev/en/stable/api/models.html?highlight=get_thread#discord.TextChannel.get_thread < this exists too, to find a thread in a channel
You cant get it by name, maybe its possible via utils, but it is possble via ID
Basic Pycord Help (Quick questions only)
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
embed.set_image(url=self.children[0].value)```It already checks if it is a valid link how do I just make it still point to image?
What are you trying to do and what's going wrong?
And errors?
Well the link is supposed to check if it is valid that happens and then it comes an error but if I then use a valid link it is not sent in the embed that's why also wants it to refer to an image
is there any way to lock bridge slash commands for particular role like @commands.has_any_role used for prefix commands ?
You can add @has_permissions(permission=True) if thatβs what u mean
It's either @bridge.has_role or @commands.has_role
So invalid links are being set in the image too? Is that the issue
The user can decide if he wants to make a Image URL or not but if the user writes a URL and it is invalid then an error is sent but if the user uses a png link or generally an image URL then the link is valid the embed is also sent but it is not assigned to an image URL. that means in the embed no image is then displayed
Ok so the regex is always failing?
Try using a regex tester. https://regex101.com
The regex checks if the link is valid or not this works fine and if it is not valid then also the error comes for the user but if the user uses a valid link then this is not sent to the embed because it does not point to an image
So you mean if the link passes the regex but does not point to an actual image?
Exactly the link is fulfilled but it is not referenced to an image for example I use a link with .png at the end but in the embed nothing is displayed because the link does not point to an image
Ah so this one is a bit tricky
You will need to perform a HEAD request to the link and check the type of the data returned
I'm not sure if that will always work but you gotta try a bit and see
How do I do that exactly I have now tried everything for a week but unsuccessful
Print what the request returns and see if there is anything of useful value
Are you familiar with aiohttp
Like the basics
is it something like this
import requests
def is_url_image(image_url):
image_formats = ("image/png", "image/jpeg", "image/jpg")
r = requests.head(image_url)
if r.headers["content-type"] in image_formats:
return True
return False```
?
Well that's the requests library. It's fine but that's blocking the event loop. Not recommended for discord bots
Yes, I thought so too, but how else could I do it differently?
?tag aiohttp
Use aiohttp.
requests and urllib are blocking. Do not use these libraries within your asynchronous code as they're not asynchronous.
(http://discordpy.readthedocs.io/en/latest/faq.html#what-does-blocking-mean)
discord.py uses aiohttp, so it should already be installed. An example of code using aiohttp and discord.py:
async with aiohttp.ClientSession() as cs:
async with cs.get('https://httpbin.org/json%27') as r:
res = await r.json() # returns dict
await ctx.send(res['slideshow']['author'])β
For more help, see aiohttp's documentation: <http://aiohttp.readthedocs.io/en/stable/>
right good point i use this a bit but how do i incorporate this so it goes in my code
i mean here
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
embed.set_image(url=self.children[0].value)```
Do the same thing you did with requests, but with aiohttp
That is clear to me but I have never used aiohhtp in this case for such things but for direct requests
Then look up the docs for aiohttp
Can I do but I can't do such an async just in the middle below if or else?
How would you have done it with requests?
You can do it inside the if block
Do you mean this?
I mean if you were to do the head request in your command with requests then how would you have done it? That's a good way to start converting to aiohttp
You can also make a separate function to keep it clean
the thing is that it is not a command but a class (callback)
π
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
async with aiohttp.ClientSession() as cs:
async with cs.get(self.children[0].value) as r:
res = await r.json()
embed.set_image(url=res)```
Why are you setting the url to the json of the response?
For me this makes no sense
You're supposed to perform a request to see if the URL points to an image
Exactly
You can't just copy/paste things and expect them to work
Ik
That command is just an example of how to make requests
You make a request to the endpoint and check the type of the response and check if it's an image
we are not going to write that code for you
Instead of cs.get you should be doing cs.head
I think cs.get should work too but mostly unnecessary to get the contents of the image
ok π
Why does self.bot.get_application_command always return None
Even though the command name is correct
Command : /setup tickets, I inputted self.bot.get_application_command(name="setup tickets")
Got none
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
async with aiohttp.ClientSession() as session:
async with session.head(self.children[0].value) as resp:
img = await resp.read()
with io.BytesIO(img) as file:
embed.set_image(url=file)```
You're supposed to check the type of the response, not set the response to the image
The parameter is called "url" for a reason, it's supposed to be a url
Ah ok
Setting the parameter to a BytesIO is not magically going to fix your problem
Welp pls
bot.http_session: ClientSession = ClientSession()
async with bot.http_session.get(...) as resp:
print("Content-type:", resp.headers['content-type'])```
I do not get it
try it and see
and what did you try?
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
async with bot.http_session.get(self.children[0].value) as resp:
embed.set_image(url=resp.headers['content-type'])```
is it not content type?
I'm asking why
Now I am confused
Why are you trying to set the url to the content type of the response?
I thought you wanted to check the content type if it's an image?
@oblique river but you know the basic of python?
That is exactly my goal
Yes, but I never really got into aiohttp lib.
So why in the world are you trying to set the value of url to a content type?
How is that going to check if it's an image?
This is not an issue with the aiohttp lib, this is just basic Python
Funny I know most of Python and have no problems only if I want to use aiohhttp correctly and I don't have it it doesn't mean I can't do Python.
So answer my question that I have asked 4 times then
Sure I should deal with it but I've been trying for a week otherwise I would not have asked for help
Which question?
This is not my intention I'll just try it I also just checked what method I use to do this and that is content-type but I don't quite understand how to put this together in my code
That is why my code is messed up right now
Like we have told you multiple times, get the content type of the url, check if the content type is an image
I have understood the whole thing and also made myself smart in the docs but I can't find an example ?
You won't always find an example to copy paste, sometimes you need to write your own code
I realize that, but it's not about copying, for example when I look at the docs at PyCord I take a picture and rewrite it into my code to make it work the way I want it to work
Do you know how to make an if statement in python?
yes
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
for url in self.children[0].value:
if url.content_type.endswith("png"):
embed.set_image(url=self.children[0].value)```
yes, if you only want png files
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
for url in self.children[0].value:
if url.content_type in ('image/jpeg', 'image/jpg', 'image/png'):
embed.set_image(url=self.children[0].value)```
Now ? π
Still not using aiohttp...
Ok it is all correct but I just need to put aiohttp in it?
try it and see
nope do not work the embed do not send the image
show your code
class MyModal(Modal):
def __init__(self, *args, **kwargs) -> None:
super().__init__(*args, **kwargs)
self.add_item(InputText(...)
async def callback(self, inter: discord.Interaction):
...
if value := self.children[0].value:
if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value):
await interaction.response.send_message(content="Url Invalid")
return
else:
for url in self.children[0].value:
if url.content_type in ('image/jpeg', 'image/jpg', 'image/png'):
embed.set_image(url=self.children[0].value)
...```
for url in self.children[0].value:
if url.content_type in ('image/jpeg', 'image/jpg', 'image/png'):```I know but how should I include aiohttp in the part here and how to do that
You literally did that earlier
What do you think this does?
I'm starting to think you do not know basic Python
Thats why I already ask it...
Hi there!
I have a question, my bot sends a private message with buttons. It sends about 30 messages to defined users. I don't know why but some users, after 5 short minutes the buttons don't work anymore. "Interaction failed"
The bot didn't reboot in the meantime, that's really weird.
Did you set a timeout on the buttons?
Nope
Then it's going to default to 180 seconds
Do you think if I do this, it's okay?
Yes I wrote that once so there but not in my code just informed me
That will work as long as the bot isn't restarted, if you want the view to be active after restarts you'd need to look at persistent views
To do this I have to look at what Zervyrel has sent?
Yes
how can we fetch a user by their id and send them a message, i have tried bot.get_user, bot.fetch_user but it always gives a object nonetype doesnt have an attribute send
Do you have intents?
i think i got like this?py if value := self.children[0].value: if not re.match(r"http[s]?://(?:[a-zA-Z]|[0-9]|[$-_@.&+]|[!*(),]|(?:%[0-9a-fA-F][0-9a-fA-F]))+", value): await interaction.response.send_message(content="Url Invalid") return else: for url in self.children[0].value: if url.content_type in ('image/jpeg', 'image/jpg', 'image/png'): bot.http_session: ClientSession = ClientSession() async with bot.http_session.get(url) as resp: embed.set_image(url=resp.headers['content-type'])
exists for modal discord.ui.Input Int? I can not find it
?
Well that with aiohttp is now the right?
what should I do there url.content_type
what?
if url.content_type in ('image/jpeg', 'image/jpg', 'image/png'):
?
should this be in there when url is not
I have no idea what you are saying
What else should I put there is the point not the link?
w h a t
async with session.head(self.children[0].value) as resp:
if resp.headers["Content-Type"] in ('image/jpeg', 'image/jpg', 'image/png'):
embed.set_image(url=self.children[0].value)``` 
i have it

See how you actually get things done when you try, instead of expecting someone to just give you code
But it still does not send the image in the embed 
what intents, i am just fetching a user
What url are you trying to use then?
anyways i got these intents as of now
intents = discord.Intents.default()
intents.message_content = True
imgur but at the end is .png
That is not a url
and does the bot have permissions to attach image embeds?
Member intents
still not work
You don't need member intents to fetch a user
also with the permission
?
ah i know why ups because of session
i forget to import



That should give you an error in the terminal
maybe i forgetpy async with aiohttp.ClientSession() as session: xD
?
thats my code
async with aiohttp.ClientSession() as session:
async with session.head(self.children[0].value) as resp:
if resp.headers["Content-Type"] in ('image/jpeg', 'image/jpg', 'image/png'):
embed.set_image(url=self.children[0].value)```
ok?
now its good ?
try it and see

.tias
nope dont work
ok
but why
π€·ββοΈ
Everything is right
Anyone know the rules of when messages have to be less than 4000, and when they have to be less than 2000? I'm getting both errors and it's annoying.
For what?
For ... messages.
Invalid Form Body In content: Must be 2000 or fewer in length.
But there are other errors that say 4000.
For which messages?
Regular messages just like we're sending right now
That is normal for discord that they have to be 2k or less
Well I recently got an error that they had to be less than 4000 (which I didn't copy), and it's definitely sent longer messages before.
With discord Nitro you can have like 4k? The bots have a limit of 2k
Hi, how can I assign permissions to a button?
Always under the impression that bots generally had nitro-level permissions. Emoji, and messages (in specific cases, apparently). Anyway, was able to work around it by adding it to an embed description, which I know is 4096
they do
No
.
oh god why is this broken :(
pip list and send output
Package Version
aiohttp 3.8.3
aiosignal 1.3.1
async-timeout 4.0.2
attrs 22.1.0
certifi 2022.9.24
charset-normalizer 2.1.1
dnspython 2.2.1
ffmpeg-python 0.2.0
frozenlist 1.3.3
future 0.18.2
idna 3.4
imageio-ffmpeg 0.4.7
multidict 6.0.2
numpy 1.23.5
pip 21.3.1
PlexAPI 4.13.1
py-cord 2.3.0
pycord 0.1.1
pymongo 4.3.3
python-dotenv 0.21.0
requests 2.28.1
setuptools 60.2.0
typing_extensions 4.4.0
urllib3 1.26.13
wheel 0.37.1
yarl 1.8.1
uninstall py-cord and re-install py-cord.
you uninstall discord.py after installing py-cord.
ah ok
and issues happen
Py cord wont install on replit
?tag replit
Read this to find out how you can install Pycord in Replit
Old instructions: https://web.archive.org/web/20211128084858/https://namantech.me/pycord/installation/#replit
New instructions: #998272089343668364 message
?tag noreplit
No tag noreplit found.
?tag norepl
Why NOT to use Repl as a hosting platform
You should not use Repl.it to host your bot.
It may be a nice option as its "free" but you should use something else considering the major flaws.
- The machines are super underpowered.
-
- This means your bot will lag a lot as it gets bigger.
- You'll need a web server alongside your bot to prevent it from being shut off.
-
- This isn't a trivial task, and eats more of the machines power.
- Repl.it uses an ephemeral file system.
-
- This means any file you saved via your bot will be overwritten when you next launch.
IMPORTATNT
- They use a shared IP for everything running on the service.
This one is important - if someone is running a user bot on their service and gets banned, everyone on that IP will be banned. Including you.
Please avoid using repl.it to host your bot. It's not worth the trouble.
If you're looking for free options, consider using AWS/Google Cloud Platform/Azure and its respective free tiers or just pay for an actual VPS.
Also JSON has issues
so you'll end up using an external database anyway
like MongoDB
Replit has their own DB
they do?
Still doesn't work
which surprisingly isn't that bad
Oh nice
Or you can use MySQL
Or that
I just use a Json 
But not JSON its not a database
Well there's an issue with that
It's not very good
I use local storage
figured it out with if interaction.user.guild_permissions.manage_guild:
I tried to use it to store info in a counting bot, but it kept reverting back for some reason
and other people had the same issue
so I ended up using mongoDB
That's pretty good
yeah, that one in your browser
You have a lot of database at your disposal but don't use JSON that is not a database
Uninstall replit
What
When I code in JS all my objects become JSON format.
idc if its not effecient
Under packages, uninstall replit
I dont have it installed
I followed my own instructions and it worked
when bot joins to a new server, i want to write to a channel. How can i make it? (joins and leaves both)
on_guild_join, on_guild_remove
Use the events mentioned above and send a message to the channel you want to
Hey, Why i get this error? ```
gnoring exception in view <prtnappplybutton timeout=None children=1> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Apply for partnership' emoji=<PartialEmoji animated=False name='π±' id=None> row=None>:
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ui\view.py", line 414, in _scheduled_task
await item.callback(interaction)
File "c:\Users\danie\OneDrive\Documentos\Phython\Otros\Bots\cot utilities\main.py", line 109, in callback
await interaction.response.send_modal(modal=partnershipmodal())
File "c:\Users\danie\OneDrive\Documentos\Phython\Otros\Bots\cot utilities\main.py", line 87, in init
self.add_item(discord.ui.InputText(label='Your server advertisement', placeholder='Your ad here.......', style=discord.InputTextStyle.paragraph, min_length=100))
File "C:\Users\danie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ui\view.py", line 287, in add_item
raise TypeError(f"expected Item not {item.class!r}")
TypeError: expected Item not <class 'discord.ui.input_text.InputText'>
Ignoring exception in view <prtnappplybutton timeout=None children=1> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Apply for partnership' emoji=<PartialEmoji animated=False name='π±' id=None> row=None>:
Traceback (most recent call last):
File "C:\Users\danie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ui\view.py", line 414, in _scheduled_task
await item.callback(interaction)
File "c:\Users\danie\OneDrive\Documentos\Phython\Otros\Bots\cot utilities\main.py", line 109, in callback
await interaction.response.send_modal(modal=partnershipmodal())
File "c:\Users\danie\OneDrive\Documentos\Phython\Otros\Bots\cot utilities\main.py", line 87, in init
self.add_item(discord.ui.InputText(label='Your server advertisement', placeholder='Your ad here.......', style=discord.InputTextStyle.paragraph, min_length=100))
File "C:\Users\danie\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\site-packages\discord\ui\view.py", line 287, in add_item
raise TypeError(f"expected Item not {item.class!r}")
TypeError: expected Item not <class 'discord.ui.input_text.InputText'>
InputTexts can only be placed in modals
yeah
If you are looking for a timestamp, check out https://docs.pycord.dev/en/master/api/utils.html#discord.utils.format_dt
how can i take time then?
i made a variable as time = datetime.datetime.utcnow()
then idk what to do
I don't know what you mean by "take time"
i meanhow to get time
no need a variable?
you can use https://docs.pycord.dev/en/master/api/utils.html#discord.utils.utcnow to get the time
so i shouldn't use datetime.datetime.utcnow?
and https://docs.pycord.dev/en/master/api/utils.html#discord.utils.format_dt to format the time into Discord timestamp for mat
they are the same thing
oh i see
well, what are these arguments?
style ?
and dt
all cool
how does i fix this problem im new to python
Read rule 1 in #help-rules
It is basic Python
oh sorry
Which you should know before developing with PyCord
Which is why I told you to read rule 1 in #help-rules
You should use a user id
Did you define member or user in that scope?
Ok? And?
That has nothing to do with my question
Did you define member or user in that scope?
Did you define member or user in that scope?
Then why are you trying to use member.id?
or user.id?
ok?
And why can't you use it twice?
Why did you change it?
And it seems useless to store the same value on two columns
So idk why you even want it twice
because you don't have member defined 
do you know basic Python?
That would still store the same ID on two columns
Why do you want to store it in two columns anyways?
Hey I'm having trouble getting on_raw_reaction_recieved to check if a certain emoji was used I'm checking it like this but its not working, I printed both values I'm checking and they're the same but it wont go inside of the if https://i.imgur.com/ORXLi36.png ```py
check_emoji = "
"
@bot.event
async def on_raw_reaction_add(payload: discord.RawReactionActionEvent):
if payload.emoji == check_emoji:
print('do stuff')
payload.emoji is an Emoji object, and you are comparing it to a string
you need to parse payload.emoji to a string as well
Why do you even have a column for it if you don't want to use it? 
that worked thank u very much

So what do you want to store in the column then?
And what does that represent?
And how do you know which user was warned?
Show your entire event handler
No
Oh jesus christ
No.. you're querying your database on every message
that is absolutely terrible
And how tf are you going to store the ID of the mod who warned them when a mod didn't warn them?
First of all that code is going to immediately crash your database server if your bot is ever popular
Second of all, learn how to use the database system instead of just copying code
I don't know what to tell you man, you obviously don't know a lot about the database you're using
or Python itself for that matter
So I was reading this about how to make a help command, but I cant seem to find anything about a help command using slash commands...
example : /help utility
https://guide.pycord.dev/extensions/commands/help-command
Now my old and most idiotic way of making a help command using slash commands was basically just with using the slash command decorator and async defining help and then a long list with if elif.... elif and then else which would give out an error if the command were to be not found.
Oh and ofc turning off the default help command.
But I want to do it smarter, and the future will require me to have made it as a slash command since discord wants us all to have migrated sooner or later.
Pycord's commands extension comes with a built-in help command. In this guide, we will take a look at them as well as learn how to create your own. Let's dive in!
hey can anyone tell me the type of ctx when a slash command is used? it's really annoying to not have autocomplete on it
I tried py print(type(ctx)) but it just causes an error
How can I make a timer efficiently?
I want every user to be able to "share" a message every 3 hours.
please don't crosspost
use https://docs.pycord.dev/en/stable/ext/tasks/index.html#discord.ext.tasks.Loop. And don't make multiples posts about the same issue
not really an issue tho..
Read #help-rules
Anyways.
tasks.Loop is not really helpful because it resets after the bot is restarted
Then save your reminders in a database and re-start them when your bot starts
hm, there must be a better way then restarting all of them
restarting 100+ loops sounds not very performant*
Store the message the user wants to share, how often, and when it was last executed. From there you can just spin up a task for each one in the database. I don't see why you'd need to remove them every minute
You only need to read from the database if your bot has to restart anyways
Read the error
π€£
Just want to let you know, it does not seem to actually hit the on_member_update when somebody subscribes. We've had a couple since I implemented the proper code for it and nothing happened.
you definitely have members intent? it should still pick up the role addition
I do, yes
No errors were thrown or anything.
How do I get the description of a cog?
Like I can get the commands out of a cog, but how do I get the description of a cog out of it?
how does one make an automod system then without querying the database on every message to check if itβs blacklisted for that specific guild?
.rtfm cog.description
Do Pycord cogs support Pydoc docstring syntax where I can provide descriptions for each argument?
No tag codeblocks found.
?tag codeblock
Please put your code in a code block:
```py
Here is your Code
```
That makes reading code in Discord a lot easier:
print("This is an example.")
shouldn't this button.disabled=true in the button callback disable the button?
this probably a dumb question but i didn't see anything in the docs for it, is it possible to restrict slash commands on a certain channel through code?
Dude. Nothing can be bigger than 100%
is it possible to check if any person in a guild has nitro
Every message with more than
100%gets deleted and the user gets warned
A message cannot have more than 100% CAPITAL LETTERS, so it won't ever get deleted or responded to.
How do I use other buttons after I've used one, because I only get "Interaction Failed"
huh
just change the timeout
u prob have a really low one
How do I close a post in Forums? I'm so confused as archiving and locking it don't work...
why is pycord not working on ptero panel?
keeps saying that βdiscordβ package isnβt installed
If you dont show us the pip list, we cannot help you...
YOU CANβT GET PIP LIST IN PTERODACTYL PANEL
contact Pterodactyl's support
we need the pip list
or use subprocess to get the pip list or smth
no you need just local folder
You dont have a terminal?
some dont work ig
No tag pycord found.
?tag notpycord
The library name is py-cord not pycord
but still
@boreal dust.
hm
try ig
what is wrong with my keyboard
re-install the git version of py-cord tho
yes, py-cord need 3.8+
no
?
same sh!t happening
re-install py-cord
install py-cord again with the 3.8
i did
hm
why do you use this host?
wow
dayum guys
np
is it possible that commands just dont appear in dm channels rather than using commands.guild_only which just raises a no private message error, then we have to error handle that
guild_only is the param to make it disappear from dms.
In the discord docs it's called dm_permission (https://discord.com/developers/docs/interactions/application-commands#application-command-object-application-command-structure)
Indicates whether the command is available in DMs with the app, only for globally-scoped commands. By default, commands are visible.
See https://docs.pycord.dev/en/stable/api/application_commands.html#discord.SlashCommand.guild_only
How can I create Auto Moderation rules with pycord?
what to put here?
Did you read the docs?
Apparently not 
@limber urchin seems the stuff isn't linked correctly in docs .-.
or better said doesn't exist at all

welp
discord/automod.py lines 169 to 196
class AutoModTriggerMetadata:
"""Represents a rule's trigger metadata.
Depending on the trigger type, different attributes will be used.
.. versionadded:: 2.0
Attributes
----------
keyword_filter: List[:class:`βstr`β]
A list of substrings to filter. Only for triggers of type :attr:`βAutoModTriggerType.keyword`β.
presets: List[:class:`βAutoModKeywordPresetType`β]
A list of keyword presets to filter. Only for triggers of type :attr:`βAutoModTriggerType.keyword_preset`β.
"""
# maybe add a table of action types and attributes?
# wording for presets could change
__slots__ = (
"keyword_filter",
"presets",
)
def __init__(
self,
keyword_filter: list[str] = MISSING,
presets: list[AutoModKeywordPresetType] = MISSING,
):```
that's the object
π
Hope that helps at least somehow
Yes thanks
Question: When I call a modal with a slash command and it opens, a message appears in the chat all the time saying: Sending command.... not only with the modal but also with other commands how do i make this go away
you'll have to probably respond to it or something
I also can not answer it with defer
defer is not an answer
what can I do it should simply not be displayed there is surely a possibility
?
Well apparently it is an answer
It is not
well now im stuck
Ok if it is not how should I do it then
Alright thanks
meta = discord.automod.AutoModTriggerMetadata(keyword_filter=words, presets=MISSING)
await server.create_auto_moderation_rule(
name=self.children[0].value,
event_type=discord.AutoModEventType.message_send,
trigger_type=discord.AutoModTriggerType.keyword,
actions=[discord.automod.AutoModAction(action_type=discord.AutoModActionType.block_message, metadata=discord.automod.AutoModActionMetadata(channel_id=ch, timeout_duration=dur))],
exempt_roles=None,
exempt_channels=None,
trigger_metadata=meta,
reason="Pulsar Auto Moderation feature.",
enabled=True
)```
what could be the problem?
But the modal is send with ctx: discord.ApplicationContext

Dunno if you can do =missing
Try None or just leave it blank?
ctx: discord.ApplicationContext
ctx.send_modal(MyModal)```
what about it?
Well in the slash command is the inside so it is already answered why comes because still the message
Sending command...
What
bruh
Tf
Γ€h who delete my message
Me
?
btw this is where it happens
And why nice
Could you not send it multiple times.
Itβs clearly an issue with your own code. Look where youβre responding to the slash command with a normal message. Maybe you have something like auto defer on or something.
Without your actual code we canβt help.
Create a new post in #969574202413838426. Helping you exceeds the use case of this post.
View #help-rules before creating the post, because we need all the infos mentioned there.
@round rivet youβve implemented it, please take a look when youβre awake
Very great the explanation I have only explained Spaxter what just does not go because he has not understood it earlier...
After I press the button the buttons are still there, even though I call self.clear_items() Why is that?
My code:
@discord.ui.button(label="Add", style=discord.ButtonStyle.green)
async def add_button_callback(self, button, interaction):
self.clear_items()
await interaction.response.send_modal(BlacklistModal1(title="Add words to blacklist"))
self.stop()
I have no idea what you are trying to say, this just looks like random English words
you need to edit_messsage on followup with view=self
You need to edit the message with the updated view
It was in response to this. Now move over
Yes I made a mistake and that's why I explained it normally but Lala... has deleted my message
That message was not for you, now I suggest you follow Lala's advice
Well, then I just ask somewhere else nearby, that was a super help.... I asked friendly and then I'm told directly to move over....
Have a nice day
Because you donβt listen. This channel is for quick questions.
And you posted your message 2 times, if Iβm mistaken, sorry. Still itβs better to open an own post
As long as you use this channel you are expected to read and follow all rules in #help-rules and #rules. And that includes listening to staff members.
im trying to download the latest version of pycord on my raspbery pi, when i do python3 -m pip install -U py-cord it downloads the 1.7.3 version, what command should i be doing!??!?!?!
Make sure you are using at least Python 3.8 and run python3 -m pip install -U py-cord==2.3.2
oh shit
im using python 3.7.2
how do i update python on a raspberrypi? it came with this version haha
wait thats not a pycord question sorry ill google
Is there any way I can get a command id? just like I can get for example an author id by using ctx.author.id ?
slash command id!
How do I get the guild id from an on_message event?
π³
message.guild π
.rtfm discord.Message.guild
1 results
My problem is when someone executes an slash command it returns None and then I get an error that I can't get the Id of none
Well if they execute it in dms π€·ββοΈ basic knowledge normally. It should even be noted in the docs
I think theyβre confused themself
π
well
could you perhaps elaborate? e.g. do you mean to resend the new messages somewhere else
isee
well wait_for is useful but not quite in this case
you basically need the message_content intent and then use an on_message listener to __continuously __ listen for messages
in @client.event async def on_message():
astnc my beloved
use the message create event, determine whether the channel id is a global chat
call a function to transform the stuff
@west vault
could you send some examples of bot.wait_for?
i donβt see anything in docs
maybe just skill issue
wdym
this lol
examples are the same
no
then what else are you looking for? those examples are pretty straightforward
which the docs showcase.... ```py
@client.event
async def on_message(message):
if message.content.startswith('$greet'): # bad way of doing commands but basic example
channel = message.channel
await channel.send('Say hello!')
def check(m):
return m.content == 'hello' and m.channel == channel
msg = await client.wait_for('message', check=check)
await channel.send(f'Hello {msg.author}!')```
is there anything more specific you're after?
How to make an event using Json?
elaborate?
Anyone got an example of the new select types in use
in the docs
i meant something in use
elaborate?
as in, be more specific
idk how much more you want man, that's as in use as it gets
Forget it then
π
I've been trying to figure out bridge command groups in cogs, can someone give me some pointers?
if you reformat the example to use proper commands it looks more like ```py
@bot.command()
async def greet(ctx):
await ctx.send('Say hello!')
def check(m):
return m.content == 'hello' and m.channel == ctx.channel
msg = await bot.wait_for('message', check=check)
await ctx.send(f'Hello {msg.author}!')```
I just coded a setup slash command now, the text channel is saved in the json file. How do you do, for example, that when in the specific text channel it automatically reacts to every newly written message?
oh i see
use an on_message event which accesses the json (using some method like load or open), compare message.channel.id to the contents of your json and if it's valid use message.add_reaction
i am useless
import json, discord
with open("file.json") as f:
data = json.load(f)
@discord.Client.event()
async def on_message(message: discord.Message):
if message.channel.id == data['channel id'}:
# whatever
```something like that
you have seconds = 0 instead of seconds = time

first the command
what was the issue then
what have you tried so far? it shouldn't be too different from regular groups
no idea
the docs and guide do not help
allgood
is it like```py
help = bridge.BridgeCommandGroup("test", "testing")
@help.command()
async def aaaaaa(self, ctx: bridge.BridgeContext):
# something
pretty much
if i'm not mistaken, it should be more or less identical to existing group methods
there's also the @bridge_group decorator if you're used to the prefix version of command groups
the thing that confused me was the callback field
oh i see
it's because, unlike slash commands, prefix command groups can run as a standalone command
e.g. if you have !group command, you can also run !group without any subcommands
so it expects you to include a function as the base command
well there's an easier method i suppose
?
instead, i'd recommend this syntax ```py
@bridge.bridge_group()
async def test(self, ctx):
any random command logic```
with every command in the group?
just for the group
thanks
Hi, I needed some help with the discord.Member.timeout_for() method. Here's what I'm trying to do:
duration = # Some value (I don't know what to use since a list isn't supported) that includes all the duration related parameters (days, hours, minutes, seconds)
if reason == None:
await member.timeout_for(duration)
await ctx.send(":white_check_mark: Operation Successful, <@{member.id}> was timeout for {days} day(s), {hours} hour(s), {minutes} minute(s), and {seconds} second(s).\nReason: {reason}\nAction taken by: <@{ctx.author.id}>")
else:
await member.timeout_for(duration, reason = reason)
await ctx.send(":white_check_mark: Operation Successful, <@{member.id}> was timeout for {days} day(s), {hours} hour(s), {minutes} minute(s), and {seconds} second(s).\nReason: {reason}\nAction taken by: <@{ctx.author.id}>")
(This isn't the full code of the command btw, I just want to know if this is the right method, or what to use to include all my needed parameters in some single variable (duration)).
just checking, why are you expecting a list to work for duration?
oh i see
Is there something I can use to do it this way?
anyway, as per https://docs.pycord.dev/en/master/api/models.html#discord.Member.timeout_for the duration is a timedelta object https://docs.python.org/3/library/datetime.html#timedelta-objects
conveniently, it supports all the units you're trying to use
I tried using timedelta, it returns a NameError.
Saying timedelta is not defined.
well you need to import it
Oh wait.
God, I didn't spend almost 60 minutes trying to figure this out when I forgot to import it.
Thanks for the help, I appreciate it. Oh God, I forgot importing, lmao
Even a NameError didn't make me think whether I even imported it.
Anyway, it worked.
Wait nevermind it didn't, thought it would. A TypeError this time.
Why it's not defined
it works but everytime i try to do !help, i get this error
hmm wait
@bot.slash_command
```not```py
@slash_command
doesnΒ΄t matter
if you import it
ahhh thanks
not how it workd
importing from discord.Bot doesnt define your bot's class
from discord.commands import slash_command
huh
did you even define your bot class
that is in a cog...
oh wait is that a cog
pls check if you have an error above the command
@discord.slash_command
```then
library bug it looks like
damn
I'll get a fix on the master branch in a bit
Okay π
slash_command was fine
no idea then
@fervent cradle
wait
that is not what I mean
@cyan quail
What do you mean?
duration = timedelta(days = days, hours = hours, minutes = minutes, seconds = seconds)
if reason == None:
await member.timeout_for(duration)
await ctx.send(":white_check_mark: Operation Successful, <@{member.id}> was timeout for {days} day(s), {hours} hour(s), {minutes} minute(s), and {seconds} second(s).\nReason: {reason}\nAction taken by: <@{ctx.author.id}>")
else:
await member.timeout_for(duration, reason = reason)
await ctx.send(":white_check_mark: Operation Successful, <@{member.id}> was timeout for {days} day(s), {hours} hour(s), {minutes} minute(s), and {seconds} second(s).\nReason: {reason}\nAction taken by: <@{ctx.author.id}>")
I'm running into a TypeError (unsupported type for timedelta seconds component: NoneType) when the options (days, hours, minutes, seconds) are being taken as integer inputs. Why is that?
async def timeout(ctx, member: Option(discord.Member, description = 'Select a user to timeout'), reason: Option(str, description = 'Any reason?', required = False), days: Option(int, required = False), hours: Option(int, required = False), minutes: Option(int, required = False), seconds: Option(int, required = False)):
I checked and tried to fix this multiple times, nothing works.
make a post
Alright.
Is there any way to differentiate between different checks failing?
I want to have a different failure method between things like being banned or just not allowed to use a command
nvm ik now
Neither @bot.slash_command nor @commands.slash_command seem to be making commands?
Which bot class are you using
well.. both are the same?
commands.bot
I've subclassed it for what its worth
OH WAIT I overwrote on_connect
forgot that I had to call super for that
god I need a rubber duck on my desk
π
bot or Bot?
k
what error event/type is executed when a select menu gives the error: "This interaction failed"
And how to check if a error is from a specific select menu?
the menu's view has it's own handler, on_error
tried it now
but its not getting triggered
async def on_error(error, item, interaction):
print("hi")
await interaction.reponse.send_message("test", ephemeral=True)
i put this unter my callback
you forgot self
oups
and you spelled response wrong
oups, but still not working
could you show your entire view with on_error?
class Dropdown(discord.ui.Select):
def __init__(self):
options = [
discord.SelectOption(
label="Test", description="test", emoji="π€"
),
]
super().__init__(
placeholder="Pick one...",
min_values=1,
max_values=1,
options=options,
custom_id="selectTest",
disabled=False
)
async def callback(self, interaction: discord.Interaction):
guild = interaction.user.guild
if self.values[0] == "Test":
await interaction.response.edit_message(view=self.view)
await interaction.followup.send(f"test", ephemeral=True)
else:
pass
async def on_error(self, error, item, interaction):
print("hi")
await interaction.response.send_message("test", ephemeral=True)
The on_error should be in the view class, not the select class.
okay
class DropdownView(discord.ui.View):
def __init__(self):
super().__init__(timeout=None)
self.add_item(Dropdown())
async def on_error(self, error, item, interaction):
print("hi")
await interaction.response.send_message("test", ephemeral=True)
like this?
in-line with __init__
thanks its working
Dont really want my question to drown but I think it did- sry
can you add PyCord commands to a Node.JS based bot?
my friend has a nodejs bot which I'd want to contribute to
JavaScript isn't python...
wow nobody knew
well how do you wanna add commands of a python library to a javascript bot
I don't think that's possible
prob not
imagine it was
well i guess I'll have to learn the basics of demon text then
lol
for my friend's bot
^
I wanna contribute to it
and add a bunch of stuff
commands
you know
but why JS?
he made the bot with njs
it's entirely in njs
and I only know python
when it comes to bots
I also know lua but not getting into that
is there any way I can add command etc.
the answer is no
ok
pycord isn't made to support such a thing.
yeah
I get that
btw what happens if you run two python files with the same token
does the other one get rejected
or what happens
which ever one gets executed first works
the second one fails
that's what I thought
so imagine someone got your token
if you're running the bot they can't do anything
nice
they can. They can still send messages in channels
o
and unregister your commands
well yeah
or spam DM users
it's actually funny, it's a mess
You can do this to temporary test something on a live bot
But i.e. maybe if you use sharding, you could let one shard use python and one shard js
but that won't help here
we alr noticed
I can make some commands but
or do practically anything to get your bot disabled by Discord
So keeping your token safe is a good thing
well I meant run a file to automate all the bad stuff
long story short, don't
I thought it doesn't do anything
it does automoderation and statistics
Is there any way we can edit the original msg (the ui.VIEW inside a slash cmd) after calling an asyncio.sleep()
Like can we fetch the original msg, as I'm trying to use .message in this case
there
but we there's no such attribute as 'message' in slash command...
create a file called requirements.txt and put in all packagesyou want to be installed there like py-cord
He just doesn't know how to install packages in ptero
@commands.slash_command(name="resume")
@commands.slash_command(name="pause")
async def pause_resume(self, ctx):
is there a way i can assign two aliases to a slash command, something like the above, but here only resume works
Add self.message to to view init and pass the original message in the view
how do i check for type...? message.channel.type == 'text' is just returning False
ah, found it. it needed to be in str(message.channel.type)
use requirements on ptero panel. Im running my public bot off of ot and its perfect.
I have use_default_buttons=False in both the paginator and the pages.PageGroup yet my default buttons pop up when selecting an item in a dropdown, any idea what I'm doing wrong?
Read rule 6 in #help-rules
aaah thanks
no
no
.
wdym?
It wasn't problem with installing pycord
what was the problem with docker
it probably was
man
i know how to install packages
at least how to add requirements file
:)
leave it-
i didn't start this lol
#1049292195808690268any help would be helpful if anyone has any ideas!
Iβd recommend using railway.app, doesnβt need a credit card as long as your connected to a more than 90day old GitHub account
it says that it couldnt find a version, its looking in pypi and piwheels
im trying to download the latest version of pycord on my raspbery pi, when i do python3 -m pip install -U py-cord it downloads the 1.7.3 version, what command should i be doing!??!?!?!
what python version do you have
3.11
you sure?
the error it gives me when i do py-cord==2.3.2 is that ccould not find a version that staisfies the requirement pycord==2.3.2 and that above it, it says, normal site-packages is not writeable and it starts looking in pypi and pinwheels .org
so i think that its not looking in your website, and the versions in pypi and pinwheels are outdated
the command i issued was python3.11 -m pip install -U pycord==2.3.2
should i try with a hypen?
yes
it seems to be downloading it now!
thank you for your help

do i rep you or something or is that not a thing for this support server
wonder if this got fixed
#1049018625006239834 
You just be thankful
I guess
Forgot about that, I set a reminder this time :p
if interaction.guild.role(id)
# button work
else:
# button not work``` does this work?
@bridge.bridge_command(name="purge")
@bridge.has_permissions(ban_members = True)
async def purge(self, ctx:discord.ApplicationContext):
limit = 1000
await ctx.channel.purge(limit=limit)
This is not working in Cog why?
error because has_permissions
I feel like I'm missing something here, but is there a way to create a background task without a loop? Everything I find online when I search for background tasks in a loop using @tasks.loop. However, I just want to be able to have the user run a command, and trigger a background task that replies to them when it's done. Something like this:
@commands.command(name="example")
async def example(ctx, etc):
output = background_task(etc) # runs some background task
await ctx.reply(output) # replies when the background task is done
async def background_task(etc) ?
asyncio.create_task ?
I solved it using "commands.has_permissions"
doing this just seems to freeze the bot
I'm going to try what Om suggested (asyncio.create_task)




