#General Help
1 messages · Page 28 of 1
hi, i am trying to get the id of user who used an interaction button, but i found only user in the documentation and that gives me only his username (example: Kchulka#4766). is it possible to get id of that user?
if your user object is user, use user.id you will get an int
ok, ill try that
ok that works, thx
no problem
can I add a reason argument for create_invite() like this?
create_invite(reason="testing reasons")
basically I’m saying, would this work ^
@bot.slash_command(name="apply")
async def apply(ctx):
modal = Apply()
await ctx.send_modal(modal)
it doesnt give any error
nvm

how do i use this
await interaction.response.send_message
to send in a specific channel
Is there a way to disable button from only client side?
just fetch the channel, and then send a message to it
You can't. You have to get the channel and send the message. Then you also have to respond to the interaction.
dark, do you have an idea to fix this?
simple 'yes' would’ve been nice
but thanks anyway 👍
after fetching the channe doi do sumthing like await interaction.chananel.send_message?
ohhh okay ty
AttributeError: 'TextChannel' object has
no attribute 'send_modal'
You can't send a modal to a specific channel. It must be an interaction
no wait not the modal mb, i want to send the messge that the user puts in the modalto another channel
im sorry for the confusion lol
alright
anybody has a idea?
one last question,is it possible to "attach" a button to the embed that gets sent
Yes
alright
Is it possible to check if a user doesnt have specific permissions?
for example
user.has_permissions(send_message=True)
you can do like
if ctx.author.guild_permissions.send_message:
# ....
else:
# ....
thanks
so. the top part is if they can send msgs
then bottom is if they cant?
right
yes
but you have to change your member obj if you want to use user
current member obj is ctx.author
oh i got
AttributeError: 'Permissions' object has no attribute 'send_message'
error
Hello where, and how do i make it so that the buttons has no timeout/(will not get disabled)
you mean, after a specific time or when you are restarting your bot?
no i mean like because i cant use the button anymore after like 5mins or so
you can set the timeout to a really high number and on callback reset the timer, so it practicly does not have a timeout
that is going to work until you restart the bot
oh
but since i dont use class where do i put the timeout=
buttonfish = Button(label="Fish", style=discord.ButtonStyle.primary, emoji="")
async def button_callback1(interaction1 : discord.Interaction): ```
i am not sure
Hmmm
do you have any view there
yes
the screen shot comes from this video: https://www.youtube.com/watch?v=kNUuYEWGOxA
This is the Ultimate Python Guide on Buttons with Discord.py or Pycord. In this video, I talk about how to create buttons in discord.py or pycord and how to respond to button clicks along with everything about Views. After watching this you'll know everything about Buttons and Views in discord.py or pycord.
This video might also apply to other...
i used this a lot to create my buttons
ye i also look there for some tips like how to add multiple buttons on one embed
xD
btw how do u reset the timer
i generate the view again
k
and edit the message with the new view
btw just wondering cant i just maybe do timeout=None?
idk, didnt try that
hmmm lemme try it
cant get it to work
alr turns out guild permissions still says i can send msgs if im muted
is there a way to check for a timout?
it works xD
ok nice
msg = await ctx.respond(embed=embed)
asyncio.sleep(3)
embed=discord.Embed(title=":game_die: | Minigame: Reactiontime", description=f"Click the button now!!", color=0xffb35c)
msg.edit_message(embed=embed)```
I am getting an error that Interaction has no attribute 'edit_message' why?
try
await msg.edit(embed=embed)
ok
'Interaction' object has no attribute 'edit'
oh nice
Hi, how can I edit a interaction message twice? I edit my button click with interaction.response.edit_message() then wait a couple sec but how do I edit the message again?
TypeError: 'NoneType' object is not subscriptable how do i handle this?
except TypeError:
print("typeError") i tried this
but doesnt work
depends where you are getting the error idk. If u just want to ignore it: ```py
try:
ur code that gives a typerror
except Typerror:
pass
i did that
its a little long but its a on_message and on every message it tries to find the author id in the database to check if its afk,if its not afk it throws that error
File "c:\Users\amito\Desktop\tests\main.py", line 529, in on_message
memberafk = results["member"]
TypeError: 'NoneType' object is not subscriptable
async def on_message(message):
results = await collectionafk.find_one()
memberafk = results["member"]
reasonn = results["reason"]
Is your database a json file?
no its mongodb
Hi, is it possible to send a button or a select menu as a private message?
yes
yep
np
yep
and the right way to do it is by the use of the class discord.dmmessage?
i am planning to make a bot that works with an sqlite database. For that task I need to create a few classes that represent groups of data (e.g. the data of a specific discord member). Should I put those classes in a separate python file and import it to the main file? If no, is there a way to put it in separate files while it acts as if it is all one file?
cogs
I'm only gonna use the bot for one server, how do cogs help me there?
Do they allow separate files?
yes
Hi, I didn't understand how to send a private message, can someone help me pls
@bot.command()
@commands.is_owner()
async def ledm(ctx):
ctx.author.create_dm()
jaaj = ctx.author.dmchannel.id
await jaaj.send('yo')
I have smth like this atm
it's obviously not working
async def dmuser(ctx, member: discord.Member,message):
if member is None:
member == ctx.author
member.send(meessage)
else:
member.send(message)```
Ignoring exception in view <SuggestionButtons timeout=None children=4> for item <Button style=<ButtonStyle.success: 3> url=None disabled=False label='Upvote' emoji=<PartialEmoji animated=False name='⬆' id=None> row=None>:
Traceback (most recent call last):
File "/home/container/.local/lib/python3.8/site-packages/discord/ui/view.py", line 371, in _scheduled_task
await item.callback(interaction)
TypeError: upvote() missing 1 required positional argument: 'interaction'```
@discord.ui.button(label="Upvote", emoji="⬆", style=discord.ButtonStyle.green)
async def upvote(self, ctx, button: discord.ui.Button, interaction: discord.Interaction):
msg = await self.bot.db.select("suggestions", ["*"], checks=[["status", 0]], single=True)
print(msg)
embed = discord.Embed(title=f"TITLE | Suggestions",
description=f"""
EMBED_HERE""", colour=col)
embed.set_image(
url="URL_HERE")
m = ctx.fetch_message(msg[0])
await m.edit(embed=embed)```
why do you have ctx in a button callback?
m = ctx.fetch_message(msg[0])
that will throw an error
Is there any other way I can fetch a message?
what message do you need?
How can I make those Options for my slash commands?
you can just access self.message
though you probably need to use alpha for that
yeah you can still use self.message but you just need to assign the message attribute after sending the message
no
⚠️ Suggestion channel not found.
The ID and content gets stored
when a player presses upvote
I need Upvote to increment by one
so whats your database solution to store that info?
mkay cool
I just am having issues getting the message
you should have these be persistent
the buttons?
yes
?tag ex
Bot examples: https://github.com/Pycord-Development/pycord/tree/master/examples
Slash command/context menu examples: https://github.com/Pycord-Development/pycord/tree/master/examples/app_commands
Buttons, dropdowns example: https://github.com/Pycord-Development/pycord/tree/master/examples/views
theres an example on persistent views
I just wanted to get them working first
yep fair
channel = interaction.channel(ID)
you can just chain the fetch_message method onto the end of this
class Apply(Modal):
def __init__(self, *args,**kwargs):
super().__init__(*args,**kwargs)
self.add_item(InputText(label="test",placeholder="Approximate"))
async def callback(self,interaction: discord.Interaction):
em = discord.Embed(color=discord.Color.from_rgb(13, 99, 143),title="New Application.")
em.set_thumbnail(url="https://cdn.discordapp.com/attachments/991328804347854948/991329051430113380/14dncpxcxwh61.jpeg")
em.set_author(name=f"{interaction.user}",icon_url=interaction.user.avatar.url)
em.set_footer(text="Veno Applications")
em.add_field(name="__test__",value=f"{self.children[0].value}",inline=False)
accept = Button(
label="Accept",
style=discord.ButtonStyle.green,
emoji=":heavy_check_mark:"
)
decline= Button(
label="Decline",
style=discord.ButtonStyle.red,
emoji=":grey_exclamation:"
)
view = View()
view.add_item(accept)
view.add_item(decline)
async def acccallback(interaction: discord.Interaction):
await interaction.response.send_message("accept")
async def deccallback(interaction:discord.Interaction):
await interaction.response.send_message("decline")
accept.callback = acccallback
decline.callback = deccallback
await interaction.response.send_message("Application submitted! check #✗・results"
)
channel = await bot.fetch_channel(992014248102346803)
await channel.send(embed=em,view=view)```how do i make it so that in the buttons callback it gives a role to the person that used the modals command
Quick question: how to deal with tying commands to a role if it contains an emoji ? Example : " ✅ Community Role" ?
I've tried with the ":emoji_name:", sadly no success
get the role by the id
b!rtfm pyc member.add_roles
How, if not able to ping the role or copy ID , nor able to retrieve it since I can't query it atm ?
Why you can't get the ID?
no that's not the problem ik how to add roles but idk how to get the member that used the command for the modal
The role is something like "✅Community Role", has to get access like "Mods" and "Admins" have to some commands; however I can't get the ID with \ since role is not pingable, cant copy the ID either with dev mode, and cannot address the role to get a ID back because I cannot get it to work with the emoji
interaction.user is the person that clicked the button
What user you want to give the role to then
turn in Dev mode and right click on the role
or in settings
to the user that used the command for the modal
Do you realise you can get the ID by right clicking the role in some user
basically they do /apply they have a modal and the embed gets sent with 2 buttons that says "accept" and "decline"
Then you'd need to store such ID to a database
if we click accept it should give a role to the person that used the command /apply
And then use it
oh
okay
so I add the id of the user once they use the command right?
oh wait nvm I'm confused
Store the ID when they submit the modal
Then on the button callback get that ID, get the user and add the roles
okay ty
after it stores the ID how will it find the right ID?
cuz multiple people could apply at the same time and I'll have multiple ids in the database
Damn, I was too sleepy headed ; clicking on an avatar and then getting the role ID is the way, oops. Was right clicking the roles in right tab like an idiot ; sorry 
@permissions.has_any_role("Guides", "Mods", 9686xxxxxxxx)
@permissions.has_any_role("Guides", "Mods", "9686xxxxxxxx")
would suffice then ?
the id would be an int
ctx.author
but i cant do ctx.author in the callback or am i wrong?
Depend on how you define the button, under view subclass or local function
.
how would i fix it
Add new attributes that accept dicord.Member
where
On modal class
yh im still confused😭 can you maybe send an example
im on mobile may take long
Hold up
def __init__(self, author, *args, **kwargs):
self.author = author
...
Then when you send a modal in your command
You pass ctx.author
To your modal class
Under your accept callback you can access self.author.add_roles()
Sadly this doesn't seem to work (ofc passed as int not string), guild Id is set. Should I handle this differently as it's a role ID and not a name ?
Shall I move to all int or all strings instead ? Or am I missing something ?
This might sound really lame but how can I run something after client.run("token") I know I can use on_ready() but it defies my purpose here. I really need to execute some code after client.run(). Bassically I don't want it to forever loop So that I can execute further commands. Please, any help will be really grateful.
what youre trying to use is outdated and no longer works. upgrade pycord
Owhe sorry; I'll do that. No longer need the dev / beta for slash commands I assume ?
you still need a beta version
2.0 still has no stable release
2.0.0rc1 is the latest on pip
Thanks 👍
Could you point me in the right direction on how to handle this going forward ?
@bot.bridge_command(name="boosters",description="Displays every booster")
async def boosters(ctx):
x = 1
for booster in ctx.guild.premium_subscribers:
em = discord.Embed(color=discord.Color.from_rgb(13, 99, 143),title="Boosters")
em.add_field(name=f"A list of every person that has boosted **{ctx.guild}**",value=f"`{x}`: {booster.mention} {booster.premium_since}")
em.set_footer(text=f"Total boosts: {ctx.guild.premium_subscription_count}")
x += 1
await ctx.respond(embed=em)``` how do i make it so that it adds the users to the embed
pip install -U py-cord==2.0.0rc1
then you can set sensible defaults. too lazy to fetch the link to an example
Apologies, I meant to limit a command per roles with the new approach 🙏
the integrations tab in server settings
Oh damn, is that the only way to handle permissions going forward ? No longer hard coded after the latest API change ?
Thanks for your help much appreciated btw 👍 🌻
everything is configurable by server admins
you can set defaults based on guild permissions though
Thanks for the heads up 👍 🚀 🌻
?
Morning fellas
I'm trying to set up a pycord bot (2.0.0rc1), but I'm unable to get a cog from working
This is how the bot is currently running
import discord
bot = discord.Bot(command_prefix="!")
bot.load_extension("cogs.battle")
bot.run(os.getenv("BOT_TOKEN"))
And this is the cog (cogs/battle.py), which is just a copy paste of the cog example on the docs besides the class name
import discord
from discord.ext import commands
class Battle(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command() # create a command
async def hello(self, ctx): # all methods now must have both self and ctx parameters
await ctx.send('Hello!')
@commands.command()
async def goodbye(self, ctx):
await ctx.send('Goodbye!')
@discord.slash_command() # we can also add application commands
async def hello(self, ctx):
await ctx.respond('Hello!')
@discord.slash_command()
async def goodbye(self, ctx):
await ctx.respond('Goodbye!')
@discord.user_command()
async def greet(self, ctx, member: discord.Member):
await ctx.respond(f'{ctx.author.mention} says hello to {member.mention}!')
def setup(bot):
bot.add_cog(Battle(bot))
Do you see anything wrong? The bot doesn't react to the regular commands, and the slash commands won't appear in the server the bot is in
?
The setup() method is being called at the very least
So the cog should indeed be loading
And you need Intents
In the code?
Ah no, in the platform
I haven't added any intents in the code. That might be the problem then
You can add it to the discord.Bot
intents=discord.Intents.all()
Snd you need the guild id for slash commands
The docs say that if I don't specify the guild ID it will be enabled globally, though
Yes
and thats something you dont want during development
^
Hey all. question is there a way to await an async call in an Option?
async def blahFunction(ctx: discord.ApplicationContext,
name: Option(str, "Enter Name", choices = get_names(), required = True),
):
where get_names() is an async call to an API to get the names. I tried adding this in the on_ready() but it seems like the slash command is created before the on_ready completes so the global array isn't updated in time to get the names?
I'm aware that it's not a good practice, but this bot is just for a single server and I don't expect it to be deployed anywhere else so globally is just a dummy test server and the one where the bot will be, though
Adding the intents didn't help, by the way. The bot is still ignoring me.
bot = discord.Bot(command_prefix="!", intents=discord.Intents.all())
that bot class doesnt support prefixed commands
you need the bot class from the commands extension for that support
You can use bridge or commands.Bot for anything
That sounds like something that should be changed in the example then
Wait a second, how do I invoke the bot in the cog as a decorator when I only have access to the bot instance inside the self arg of the methods?
I can't just do @bot.command inside a cog
Because you dont use the command one
You use the Bot for application commands and not for a prefix command
No?
The docs explicitly say that you use the bot for prefixed commands
Learn how to use the commands extension for Pycord.
You need commands.Bot or bridge.Bot for prefix commands
Yes
I'm aware
and what I'm saying is that I can't access the instance of commands.Bot inside a cog to put in a decorator because it's passed as part of self in the args of the methods of the cog
You only need it in the main file and not inside of a cog
Yes
I know that's how it should work
but then how do I add the decorator inside the cog
Because the bot instance is only defined in the main file and not the cog
@commands.command()
.
I restarted the python process
vscode shouldn't change anything, it's just a text editor
why did it not work? is there any inherit error, or anything?
It just doesn't trigger the bot to do anything
But after some extra testing it's not the cog's fault, I've checked and it doesn't seem to do anything even in the main script
So the issue must be somewhere else
a quick question, you have verified that the main file is indeed running?
Yes? I'm manually running the script locally.
bot = discord.Bot(command_prefix="!", intents=discord.Intents.all())
@bot.command()
async def ping(ctx):
await ctx.send("Pong!")
bot.run(os.getenv("BOT_TOKEN"))
This minimal bot isn't working for me
And yes, I can confirm that the bot token is being parsed correctly
how are you verifying that? im trying to get as much information as possible.
You still use discord.Bot()
Because it's what the docs say...
Wrong reaction, it was meant to Zervyrel
Use commands.Bot()
looks like a dependency issue
I've printed, checked with a debugger AND I had a bot previously running with discord.py using the same env file and setup and it worked
Is it possible to update Options - choices after startup of a bot?
do you by any chance still have discord.py installed within your local enviroment?
pycord 1.7.3 is basically discord.py 1.7.3
No, I've already uninstalled it to avoid conflicts
shouldn't use that (message towards colin)
Package Version
----------------- -----------
aiohttp 3.7.4.post0
async-timeout 3.0.1
attrs 21.4.0
chardet 4.0.0
ffmpeg-python 0.2.0
future 0.18.2
greenlet 1.1.2
idna 3.3
imageio-ffmpeg 0.4.7
multidict 6.0.2
numpy 1.23.0
pip 22.0.4
psycopg2 2.9.3
py-cord 2.0.0rc1
python-dotenv 0.20.0
setuptools 58.1.0
SQLAlchemy 1.4.39
typing_extensions 4.3.0
yarl 1.7.2
please format your code into codeblocks
ncm fixed
At this point you've insisted so much about this that now I genuinely want to see an example that is working for you, because I'm genuinely intrigued
?
something like
async def blahFunction(ctx: discord.ApplicationContext,
name: Option(str, "Enter Name", choices =[Al, Bob, Sally] required = True),
):```
then later I want to update choices for name to be `[Al, Bob, Sally, Jerry]`?
import discord
from discord.ext import commands
client = commands.Bot()
client.run("token")
wwhy's everyone ignoring it 💀
what do you mean?
i want it to send an embed with a list of boosters
ok
so if thats the case why are you defining the embed in a for loop
that's just going to make a seperate embed for each user
ye i figured
move the set_footer call out of the for loop as well
While now it was more clear that you mean the bot instance initialization and not the command decorators, it still displays the same behaviour
from discord.ext import commands
from dotenv import load_dotenv
load_dotenv()
bot = commands.Bot(command_prefix="!")
@bot.command()
async def ping(ctx):
await ctx.send("Pong!")
bot.run(os.getenv("BOT_TOKEN"))
This is still not working
what needs to remain in the loop?
well maybe the add_field call
since you want the list to be displayed within the embed
I think I'll just create a different thread at this point
is it possible to edit a ephemeral message?
try and see what will happend
Hi, I would like to know if it's possible to give to someone a role by a button who are on a private message?
You'd need to look for the user in the guild and then add the roles
Is there anyway to get the ID of the message that the button is on?
help
help yourself. the problem is obvious lol
code
async def Ping(ctx):
latency = bot.latency
trueLatency = * 1000
await ctx.respond(f"Mi ping es {round(trueLatency)} ms.")```
Pretty self explanatory
trueLatency = WHAT multiplied by 1000
Let them realise
lol
He watchin a pycord tutorial lmao
Bump
b!rtfm interaction.original_message
I couldn't find a documentation with the name interaction.original_message! Maybe you used to command wrong? Correct Usage: <prefix>rtfm <docs> [<term>] (eg. b!rtfm py cool)
List of Documentations you can search:
python
pycord
discord.py
yarsaw
nextcord
disnake
b!rtfm pyc interaction.original_message
Is there a way to disable button from only client side?
Only for one user? No
hi, how to store datetime object in database using aiosqlite ?
i don't see any mention of it on the documentation of aiosqlite
hi
can anyone help me?
i dont get my attachment in the embed.set_image
element.screenshot(f'temp/qr-{n}.png')
embed.set_image(url=f"attachment://qr-{n}.png")
you need a valid https:// url of the image
bruh no
you can put a local file
but it already found out how
So , I am really embarrassed to ask this but I have been getting this indentation error, and I can't just figure out where I am wrong
you need to give a callback function to the select menu, it can't be just a standalone decorator
@discord.ui.select(**kwargs)
async def select_callback(self, select: discord.ui.Select, interaction: discord.Interaction) -> None:
... # callback code here
Ohh I see , ty
If i has used Select simply without any classes would it still need a callback?
I tried this too but doesn't work so, I guess that defining a callback is necessary for the select menu to work otherwise it doesn't work whether you subclass View or use select directly
how can i get the content of an embed?
read the docs
i am but i am not getting
from copy i am getting memory location
nvm got
thanks
its was to_dict
i want to get message id, but i see this thing
ctx.message.id
thanks
But now i've got this error discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'NoneType' object has no attribute 'id'
i am making a private thread through a channel and i am getting this error discord.errors.HTTPException: 400 Bad Request (error code: 20035): Guild premium subscription level too low
can you please show your code?
you need to have boost
0.0 making threads need boost?
private
without boost you can create public threads
async def suggest(ctx, sugs: Option(str, name='предложение', description='Что вы хотите предложить?')):
user = ctx.author.id
use = ctx.author.id
va = '*нету*'
la = '*нету*'
b.add_s(self=b, idea=sugs, user=use, vkans=va, lvans=la)
ids = b.get_s_id(self=b, ids=user)
l = b.get_l_id(self=b, ids=user)
v = b.get_v_id(self=b, ids=user)
mes = b.get_mark(self=b, ids=user)
am = b.get_mark_am(self=b, ids=user)
m1 = discord.utils.get(bot.emojis, name=f'mk1')
m2 = discord.utils.get(bot.emojis, name=f'mk2')
m3 = discord.utils.get(bot.emojis, name=f'mk3')
m4 = discord.utils.get(bot.emojis, name=f'mk4')
m5 = discord.utils.get(bot.emojis, name=f'mk5')
embed = discord.Embed(title=f'Предложение № {ids}', color=discord.Colour.from_rgb(76, 0 ,153))
embed.add_field(name=f'Идея от {ctx.author}', value=f'> {sugs}', inline=False)
embed.add_field(name=f'Ответ ВКинулся™#1860', value=f'> {v}', inline=True)
embed.add_field(name=f'Ответ Lavrik#8298', value=f'> {l}', inline=True)
embed.add_field(name=f'Оценка участников ({am})', value=f'**{mes}** {m1}', inline=True)
embed.set_footer(text=ctx.message.id)
m = await ctx.respond(embed=embed, view=PersistentView())
```
you need to send a message first to get message id
embed.set_footer(text=ctx.message.id)
and after i need to edit message?
yes
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'edit_message'
I'm having issues getting a cog to work properly
This is the cog:
import discord
from discord.ext import commands
class Test(commands.Cog):
def __init__(self, bot):
self.bot = bot
@commands.command() # create a command
async def hello(self, ctx): # all methods now must have both self and ctx parameters
print("invoked")
await ctx.send('Hello!')
def setup(bot):
bot.add_cog(Test(bot))
And this is the main script
import discord
from discord.ext import commands
from os import getenv
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.message_content = True
intents.members = True
intents.presences = True
bot = commands.Bot(command_prefix="!", intents=intents)
bot.load_extension("cogs.test")
@bot.command()
async def command(ctx):
print("commanded")
bot.run(getenv("EVENTBOT_BOT_TOKEN"))
The command "command" works fine, but the command "hello" results in a commandNotFound exception
Any idea about what could I be doing wrong?
Can someone help me with this error, when I tried to do this with buttons it worked fine
Try self
1st argument takes view, 2nd argument takes item(select/button), 3rd argument is interaction
No input about the cog issue?
@bot.event
async def on_user_update(before, after):
if before.name != after.name:
if any(word in after.name.lower() for word in blacklistwords):
await after.kick(reason=f"{after} | {after.id} Blacklistwort.")
return print(f"{after} | {after.id} Blacklistwort.")
why do i get this?:
line 287, in on_user_update
await after.kick(reason=f"{after} | {after.id} Blacklistwort.")
AttributeError: 'User' object has no attribute 'kick'
@bot.event
async def on_user_update(before, after):
if before.name != after.name:
if any(word in after.name.lower() for word in blacklistwords):
await after.guild.kick(after, reason=f"{after} | {after.id} Blacklistwort.")
return print(f"{after} | {after.id} Blacklistwort.")
i have this now
but i cant test because ratelimit
is it gonna work?
Python Help: I have an base image, i want to put some text over it and send it in a embed. How can I do this?
try with pillow
Python Pillow. Pillow: the friendly PIL fork. Python Imaging Library.
which section should I see to do this in the docs?
it isnt in the pycord docs
i already was looking at the pillow docs not the python docs, anyway i found the thing i needed in PIL.ImageFont

What are the benefits of subclassing the view?
any takes a list object, not just a generator
so you want any([word in...])
it's typically neater and easier to manage, pretty useful if you want to make a generic framework for a view and reuse it multiple times
but it isn't a necessity, ultimately just preference
Tyy, also I have been looking on how to reuse it again so just like you said made a basic template and pass on the arguments to make as many buttons.
for reusability you can just inspect the examples
Here's the button roles example.
in that example, each button is doing more or less the same thing; the role given is ultimately just dependant on the custom_id, which is taken from the role passed into the button class
thanks, but what is with the AttributeError: 'User' object has no attribute 'kick'
i know
you can't kick a "user" because a user doesn't belong to a guild
yeah that works
but guild.kick which you're currently doing also works
you don't need to get the member object if you already have the guild and user
i think the smartest way is to fetch the member
just to make sure, are you trying to filter usernames or nicknames?
usernames
is your bot only in a single guild?
on on_user_update i only get usernamens
yes, when i am adding it to more i have to define guild
you can just use bot.get_guild(id) for the guild object then
guild = bot.get_guild(guild_id)
await guild.kick(after, reason=f"{after} | {after.id} Blacklistwort.")
this is my code now
yeah
my bot wont register any commands anymore. i have the intents enabled and debug guild is correct - any ideas ? and yeah i waited for some time for it t o update but it wont recognize anymore
It can take some minutes
yeah but whats odd is that i am waiting for 30 mins now and in my guild it doesnt register the commands for my other bots too. i gave permission in two different guilds still not working
it worked ilke 1 week ago without problems. now there are only the defualt slash commands
I had the same problem with some servers, it was really weird
ooof ok weird? any fix for thaT?
ty
but as you said it is just our preference , so we can do it normally too?
yes, subclassing isn't required
so like i went to bed
and now i try out my code
50 errors
and i dont know what they mean
i tried finding the invaild form body bt idk where its at
prob you have more than 1 command having the same name
Code ```py
if not discord.opus.is_loaded():
discord.opus.load_opus('./libopus.so')
how do i solve this?```py
discord.ext.commands.errors.ExtensionFailed: Extension 'cogs.music' raised an error: OSError: ./libopus.so: ELF file's phentsize not the expected size
Why if I use the slash command in my bot __ in private message__, the bot will automatically shut down?
Send your code, it shouldn’t do that just from running a slash command.
Is there any examples to disable all buttons on that message when pressed?
Or remove the buttons
I don't have any buttons on this commands
@spring wharf
I am asking for help haha sorry.
Bump
Either a for loop on the view children
Or, there's a method which disables all buttons
Could you link it?
b!rtfm pyc view.disable_all
No results found when searching for view.disable_all in pyc
await interaction.response.send_message(embed=embed, ephemeral=True, view=discord.ui.View.disable_all_items(self))```
Could anyone help it does not disable the buttons?
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: AttributeError: 'Interaction' object has no attribute 'edit'
How can i fix it
And you have to subclass discord.ui.View you're calling the class itself and passing self?
Interaction.response.edit_message
Read the docs

but i want to edit normal message
no one will tho if you are giving them solution 
async def suggest(ctx, sugs: Option(str, name='предложение', description='Что вы хотите предложить?')):
user = ctx.author.id
use = ctx.author.id
va = '*нету*'
la = '*нету*'
b.add_s(self=b, idea=sugs, user=use, vkans=va, lvans=la)
ids = b.get_s_id(self=b, ids=user)
l = b.get_l_id(self=b, ids=user)
v = b.get_v_id(self=b, ids=user)
mes = b.get_mark(self=b, ids=user)
am = b.get_mark_am(self=b, ids=user)
m1 = discord.utils.get(bot.emojis, name=f'mk1')
m2 = discord.utils.get(bot.emojis, name=f'mk2')
m3 = discord.utils.get(bot.emojis, name=f'mk3')
m4 = discord.utils.get(bot.emojis, name=f'mk4')
m5 = discord.utils.get(bot.emojis, name=f'mk5')
embed = discord.Embed(title=f'Предложение № {ids}', color=discord.Colour.from_rgb(76, 0 ,153))
embed.add_field(name=f'Идея от {ctx.author}', value=f'> {sugs}', inline=False)
embed.add_field(name=f'Ответ ВКинулся™#1860', value=f'> {v}', inline=True)
embed.add_field(name=f'Ответ Lavrik#8298', value=f'> {l}', inline=True)
embed.add_field(name=f'Оценка участников ({am})', value=f'**{mes}** {m1}', inline=True)
m = await ctx.respond(embed=embed, view=PersistentView())
em = discord.Embed(title=f'Предложение № {ids}', color=discord.Colour.from_rgb(76, 0 ,153))
em.add_field(name=f'Идея от {ctx.author}', value=f'> {sugs}', inline=False)
em.add_field(name=f'Ответ ВКинулся™#1860', value=f'> {v}', inline=True)
em.add_field(name=f'Ответ Lavrik#8298', value=f'> {l}', inline=True)
em.add_field(name=f'Оценка участников ({am})', value=f'**{mes}** {m1}', inline=True)
em.set_footer(text=m.id)
await m.edit_message(embed=em, view=PersistentView())
```
и что ты хочешь тут изменить?
🤔
напиши на русском
футер поставить с id
Use ctx.edit
скинь в ЛС ссылку на МЛ
я там в бане
tnaks

это не сработает

Is there any examples?
у объекта Interaction есть property message
Of what
Here's the confirm example.
когда ты отправляешь сообщение, ты получаешь в ответ объект Интеракшон
thanks
а он уже содержит .message
вроде так должно быть по сути
я сейчас еще посмотрю, тут очень запутанно все и я бы лично переписал
@slender lintel короче, тут можно даже легче это сделать, у discord.Interaction есть edit_original_message
по сути это должно сделать то, что ты хочешь
No results found when searching for ApplicationContext.edit in pyc
понял
it kills me how its completely not intuitive
Yeah
someone should kinda rewrite the code or docs
спасибо гигабит
пожалуйста
что такое member_descriptor
в доках нет
я вот тоже не вижу
Here's the slash cog example.
¯_(ツ)_/¯
ок
можно вопрос в ЛС?
да
is there a fast way to get all members who are online?
is it possible to get an attached file?
yeah just check the message's attachments attribute
im new to cogs and i was wondering if i have py channel = await bot.fetch_channel(992014248102346803) how do i define bot
commands.fetch_channel?
typically you have self.bot defined in the cog's init
ohh ye
@crimson coral how to run unending loops without on_ready () with no timelimt
uhhhh
that sounds like a really bad idea but what exactly are you trying to do
might wanna use tasks instead
i have the cog class and a class inside it and at the and i have a command that needs to use the inner class but it says that the inner class is not defined
kinda confusing
class Application(commands.Cog):
class Apply(Modal):
def __init__(self,bot, *args,**kwargs):
self.bot = bot
super().__init__(*args,**kwargs)
self.add_item(InputText(label="Since when do you edit",placeholder="Approximate"))
async def callback(self,bot,interaction: discord.Interaction):
self.bot = bot
em = discord.Embed(color=discord.Color.from_rgb(13, 99, 143),title="New Application.")
em.set_thumbnail(url="https://cdn.discordapp.com/attachments/991328804347854948/991329051430113380/14dncpxcxwh61.jpeg")
if interaction.user.avatar == None:
em.set_author(name=f"{interaction.user}")
else:
em.set_author(name=f"{interaction.user}",icon_url=interaction.user.avatar.url)
em.set_footer(text="Veno Applications")
em.add_field(name="`1` __Since when do you edit?__",value=f"{self.children[0].value}",inline=False)
await interaction.response.send_message("Application submitted! check #✗・results"
,delete_after=10)
channel = await bot.fetch_channel(992014248102346803)
await channel.send(embed=em)
@commands.slash_command(name="apply",debug_guilds=[991441544349499512])
async def apply(ctx):
modal = Apply(title="Veno Application Form")
await ctx.send_modal(modal)```i had to get rid of some code or it wouldve been to long
@crimson coral
wait so what's the error
in the command Apply isnt defined
what about modal = self.Apply(...)?
alternatively just have the apply class outside the cog
oh ty
you also need to pass bot into the Apply class
the latter is more preferable since it can then be reused outside of the cog easily
yeah
scan every member names continuously
....
if matches --> do some tasks
just use on_member_update for nicknames, or on_user_update for usernames
i want it to run for all the user
yes
even new users
new users wont to both
?
they simply join
what
i want to check the names
for that user need to update their names right ?
yes
im saying i want to just check the exiting member name - where they wont change
but why would you need an infinite loop for that
Discord Security Analyst? 🤔
to make it simple , i want to continuously loop through every member
that's... not simple
if you're "scanning all member names continuously" then of course you want to use an event
you can do a one time check of all bot.users with a command or something, then do the tracking with on_user_update
what if i just run a loop on on_ready
for all the bot.users
Yeah on_ready can be fired multiple times during the running of the bot iirc
is there no optimal way to scan every members continuously ?
ok
Application Command raised an exception: ValueError: no such name
@crimson coral what might be the reason
maybe also supply your code
^ what code triggered that
simple slash command
like..
print username

lol
just send your code for the command
Thought you had more than 7 years of experience in programming my man.
@tepid anvil send your code otherwise we can't help.
Read #help-rules
is that on his website?
🤔
why code from documentation is not working?
and after fixing that, another code from doc is not working:

Yes lmao.
do pip list for me
update pycord
it was just fresh install
we're on 2.x
1.7.3 is old
# Linux/macOS
python3 -m pip install -U "py-cord[voice]"
# Windows
py -3 -m pip install -U py-cord[voice]```
also you might need this
pip install py-cord==2.0.0rc1 ^^
is this with voice support
yes
💀
example from documentation:
https://github.com/Pycord-Development/pycord/blob/525d9531aca77efdbf769888df7f730a1f587c09/examples/audio_recording.py
Pycord, a maintained fork of discord.py, is a python wrapper for the Discord API - pycord/audio_recording.py at 525d9531aca77efdbf769888df7f730a1f587c09 · Pycord-Development/pycord
seems to be an issue with example, but, still, what is your pycord version?
@main grail
did you change something in code?
i'll try to recreate a bug and possibly fix it
@main grail to be sure, what python version are you using?
yes
from enum import Enum
import discord
intents = discord.Intents.all()
# bot = discord.Client(command_prefix=',', intents=intents, debug_guilds=[957264333509898312])
bot = discord.Bot(command_prefix=',', intents=intents, debug_guilds=[957264333509898312])
connections = {}
class Sinks(Enum):
mp3 = discord.sinks.MP3Sink()
wav = discord.sinks.WaveSink()
pcm = discord.sinks.PCMSink()
ogg = discord.sinks.OGGSink()
mka = discord.sinks.MKASink()
mkv = discord.sinks.MKVSink()
mp4 = discord.sinks.MP4Sink()
m4a = discord.sinks.M4ASink()
async def finished_callback(sink, channel: discord.TextChannel, *args):
recorded_users = [f"<@{user_id}>" for user_id, audio in sink.audio_data.items()]
await sink.vc.disconnect()
files = [
discord.File(audio.file, f"{user_id}.{sink.encoding}")
for user_id, audio in sink.audio_data.items()
]
await channel.send(
f"Finished! Recorded audio for {', '.join(recorded_users)}.", files=files
)
@bot.command()
async def start(ctx: discord.ApplicationContext, sink: Sinks):
"""
Record your voice!
"""
voice = ctx.author.voice
if not voice:
return await ctx.respond("You're not in a vc right now")
vc = await voice.channel.connect()
connections.update({ctx.guild.id: vc})
vc.start_recording(
sink.value,
finished_callback,
ctx.channel,
)
await ctx.respond("The recording has started!")
@bot.command()
async def stop(ctx: discord.ApplicationContext):
"""Stop recording."""
if ctx.guild.id in connections:
vc = connections[ctx.guild.id]
vc.stop_recording()
del connections[ctx.guild.id]
await ctx.delete()
else:
await ctx.respond("Not recording in this guild.")
@bot.event
async def on_ready():
print('działam!')
3.10.4
the same with python 3.9.13
@main grail i got it to work
there is my pull request, you can use the code from it https://github.com/Pycord-Development/pycord/pull/1466
say if something isn't working
super, thank you. I will check
👍🏻
File "C:\Users\Fammy\Desktop\test\cogs\Button.py", line 36, in closeTradeButton
await messgae.thread()
AttributeError: 'Message' object has no attribute 'thread'```
i want to get the thread created on this message
read the error
or your code
pip install py-cord==2.0.0rc1
oh
you need github master
you need git installed: pip install -U git+https://github.com/Pycord-Development/pycord
sorry but i am noob at github 😅
!git
Git Software
Windows: https://gitforwindows.org/ or https://git-scm.com/download/windows
If you use choco package manager do :
choco install git
Or if you use scoop do :
scoop install git
Linux: https://git-scm.com/download/linux (it's extremely likely in your distros repository)
Mac: https://git-scm.com/download/mac (it's in brew)
is there any step by step process?
idh both choco and scoop
here is my list
do you use linux or windows?
windows
which one should i install?
or start cmd
next
uninstall pycord and try this command
pip install -U git+https://github.com/Pycord-Development/pycord
oki
is there a way to role a bunch of people at once in a slash command?
ohh
nice its installing
installed
lemme open vs code again...
oki working 😄
thanks alot
i have one more issue how can i get bot in this?
@discord.ui.button(label="Close Trade",style=discord.ButtonStyle.red,custom_id="closeTradeButton")
async def closeTradeButton(self,button:discord.Button,interaction:discord.Interaction):```
while sub classing View
just pass bot as an init argument for the view
oki
@bot.command()
@commands.has_role("Council")
async def addrole(ctx, role: discord.Role, *members: discord.Member):
rnames = [role.name for role in player.roles]
for member in members:
if str(role) in rnames:
await ctx.respond(f"<@{member.id}> already in {role}")
else:
await member.add_roles(discord.utils.get(ctx.guild.roles, name=role))
await ctx.respond(f":white_check_mark: {role} added to <@{member.id}>")
@addrole.error
async def addrole_error(ctx, error):
if isinstance(error, commands.MissingRole):
await ctx.send("You dont have the Council role.", ephemeral = True)
im making a command to role multiple people at once
but right now it doesn't do anything?
no errors or anything
import discord
intents = discord.Intents.all()
# bot = discord.Client(command_prefix=',', intents=intents, debug_guilds=[957264333509898312])
bot = discord.Bot(command_prefix=',', intents=intents, debug_guilds=[957264333509898312])
connections = {}
sinks = {
"mp3": discord.sinks.MP3Sink(),
"wav": discord.sinks.WaveSink(),
"pcm": discord.sinks.PCMSink(),
"ogg": discord.sinks.OGGSink(),
"mka": discord.sinks.MKASink(),
"mkv": discord.sinks.MKVSink(),
"mp4": discord.sinks.MP4Sink(),
"m4a": discord.sinks.M4ASink()
}
async def finished_callback(sink, channel: discord.TextChannel, *args):
recorded_users = [f"<@{user_id}>" for user_id, audio in sink.audio_data.items()]
await sink.vc.disconnect()
files = [
discord.File(audio.file, f"{user_id}.{sink.encoding}")
for user_id, audio in sink.audio_data.items()
]
await channel.send(
f"Finished! Recorded audio for {', '.join(recorded_users)}.", files=files
)
@bot.command()
async def start(ctx: discord.ApplicationContext, sink: discord.Option(str, choices=sinks)):
"""
Record your voice!
"""
sink = sinks.get(sink)
print(sink)
voice = ctx.author.voice
if not voice:
return await ctx.respond("You're not in a vc right now")
vc = await voice.channel.connect()
connections.update({ctx.guild.id: vc})
vc.start_recording(
sink,
finished_callback,
ctx.channel,
)
await ctx.respond("The recording has started!")
@bot.command()
async def stop(ctx: discord.ApplicationContext):
"""Stop recording."""
if ctx.guild.id in connections:
vc = connections[ctx.guild.id]
vc.stop_recording()
del connections[ctx.guild.id]
await ctx.delete()
else:
await ctx.respond("Not recording in this guild.")```
after /start
How can I check the rights of a person in a specific voice channel?
You could iterate over bot.guilds and check the len(guild.members) >= 10
@slender lintel
for g in bot.guilds:
if len(guild.members >= 10):
await guild.leave()
Put that in your command
You cant just copy paste, understand it whats wrong on the code
wait thatts more than 10 tho
No it dont, the code here is iterating client's guild and store it to var g
Also the len function parenthesis are wrong
Are there any error?
Show codee
The parenthesis or the closing ) is wrong
This is not iterating it
But store it
for g in bot.guilds:
if len(g.members) <= 10: # if member count is less than 10
await g.leave() # leave
that should work
i think
More like g.members
mb i forgot what i was and copied it from my code lol
Are there any bugs on the current github version with cogs?
Suddenly my bot loads cogs twice and commands inside cogs will not register / even message commands. My Error handler will say that they do not exsist.
- Version of pycord?
- command group or stand alone slash commands?
- Error?
- Snippets of relevant code?
-
Version py-cord==2.0.0rc1 (Bug is on both github latest version and pypi)
-
Slash commands and prefixed commands
-
No specific error, they just dont register / added to the bot
-
if os.path.isdir("./cogs"):
for file in os.listdir("./cogs"):
if file.endswith(".py"):
try:
bot.load_extension(f"cogs.{file[:-3]}")
print(f"{file[:-3]} loaded")
except Exception as e:
print(f'Cog {file[:-3]} failed to load:\n{e}')
continue```
This is how I load cogs normally. Each exsisting cog will load twice for some reason
At least I can sea that each print(f"{file[:-3]} loaded") from a cog shows twice
Or could this be any error with my code? 
Is your code long? Can you post it? If not, things to check:
Are you loading them twice in any other area?
I'm not seeing the point of the first if statement (if os.path.isdir) if you're already defining which directory to use in line 2 ( for file in os.listdir("./cogs"):
how can i fix it?
payload["components"] = [] if view is None else view.to_components()
AttributeError: 'Dropdown' object has no attribute 'to_components'```
wtf
dhooks 1.1.4
discord.py 1.7.3
discord-webhook 0.16.3```
uninstall these libs
py-cord 1.7.3```
and upgrade pycord
or you try to search for it on google with discord.py
like
discord.py webhook
i cant use options in a cog, why?
@discord.slash_command(description="Heirate jemanden")
async def marry(ctx, user: discord.User):
embed = discord.Embed(title="Offiziel verheiratet!",
description=f'**{ctx.author}** und **{user}** haben gerade geheiratet!:heart_on_fire:',
color=0xff0000)
embed.set_image(url="https://c.tenor.com/K6xMm3nxBg4AAAAC/marriage-marry.gif")
await ctx.respond(embed=embed)```
you forgot to add self
async def marry(self, ctx, user: discord.User):
And use discord.Member
I updated Py-Cord and now the bot crashes when I execute a slash command in a direct message.
I used "pip install git+https://github.com/Pycord-Development/pycord" to update the py-cord.
did you give it the application.commands scope when inviting it
Is this it?
I do not need to use the slash command in my direct messages.
Is there any way to disable the slash command in direct messages?
go the developer panel and invite with your bot with the scope selected
I have done it but get an error.
a new error?
same error
hm
Do I need to set some kind of intent?
latest pycord requires intents yes
do you have the intents enable on the developer portal?
Which intent is required?
presence, server member, message content
Only server member intent is enabled.
#993544558828851250
When I rewrite interactions.py like this, the BOT no longer crashes, but something else may be wrong.
enable all 3
you can change it to
intents=discord.Intents.all()
I enabled everything and changed "discord.Intents.default()" to "discord.Intents.all()" but it crashed.
In interactions.py,
data.get("app_permissions")
seems to return None.
I have an old bot that used to work fine but suddenly it doesn't respond to commands or anything. The bot loads up just fine, no error shows up too.
Can you take a backup of the interactions.py and try with my rewritten interactions.py?
My BOT at least seems to work with this.
Any errors on console?
yes
can you print it out?
if its really a int or str?
Are you sure TOKEN points to something
What version are you on
I installed py-cord from github.
pip install git+https://github.com/Pycord-Development/pycord
this is definitely a lib bug
import discord
from discord.ext import commands
from discord.commands import option
import os
from dotenv import load_dotenv
load_dotenv()
intents = discord.Intents.default()
intents.members = True
bot = commands.Bot(command_prefix='$')
@bot.event
async def on_ready():
print(f"{bot.user} Ready")
@bot.command()
async def poopin(ctx):
await ctx.send("farting")
bot.run(os.getenv("TOKEN"))
did i mess something up for it not to give me anything?
i dont have any errors or unresponsive messages
it does on_ready but thats it
opened #1467 to fix
you need intents.message_content too
and you never passed the intents into bot either
oh
intents = discord.intents.message_content()
bot = commands.Bot(command_prefix='$', intents=intents)```
or is this wrong way
ehh nearly... first line is wrong, it's the same as how you set intents.members
i.e. intents.message_content = True
oh right i forgot about that
thank you!
allgood
I’m randomly getting this error but I haven’t touched any of my code?
it is defined
Clearly its not
Basic python.
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: ValueError: could not find open space for item
I got this error while sending a Modal
how many items can I add in a Modal, is their a limit ?
any ideas why deleting the message in the on_message event throws discord.errors.NotFound: 404 Not Found (error code: 10008): Unknown Message error even though it deletes the message=
I believe its a small limit
Like 5 items. Or maybe less
When I make a select menu and use it, the option I select is a default option for me on my client side, how do I remove that so it doesn’t make it a default option on my end but just shows the normal select menu?
Looks like a Discord issue?
Hello everyone, does anyone know what could be the problem?
WARNING:discord.gateway:Shard ID None heartbeat blocked for more than 10 seconds.
@commands.slash_command(name="mute",description="Mutes a user for a specified time")
@commands.has_permissions(manage_roles=True)
async def mute(self,ctx,user: discord.Member=None,time=None,*,reason: Option(str,"why",required=False)):
time = humanfriendly.parse_timespan(time)
if ctx.author.top_role <= user.top_role:
e = discord.Embed(color=discord.Color.from_rgb(13, 99, 143),description=f"You can't timeout {user} according to roles hierarchy")
await ctx.respond(embed=e)
else:
await user.timeout(until=discord.utils.utcnow() + datetime.timedelta(seconds=time),reason=reason)
e = discord.Embed(color=discord.Color.from_rgb(13, 99, 143),description=f"Succesfully muted {user} for reason: `{reason}`")```
it doesnt give me any error but it doesnt time out the person
Why is it that after I run a message command, the context menu is no longer visible if I right click on the message?
thank you
So, I'm coding a League Of Legends Discord Bot and I want to show my best 5 champions (Champion Name - Champion Mastery Points) in a Embed Value like this example [1] [2]
embed.add_field?
This is the code that I have right now
No, I want something like this
Champion1 - Mastery Points\n
I don't want a field for each champion, I want a line of the field value for each champion
and then embed.add_field(name = "Best Champions", value = champions)? right?
Yep!
Okay, gonna try that
That's my best shoot rn
I tried that (I don't know if I did it correctly) and the bot only send one of the 5 champions (the last one)
Because that's what your for loop does
champion = champion + f"{cm.champion.name} {str(cm.points)}\n"
Thanks! It worked, now I have another question
Do you know how can I do to convert the number (e.i: 92000 to 92k?)
tysm
Probably not the place, but just an FYI, there's a hack going around telling you that you've been exposed and asking you to click a link. I can share a screenshot if you like. Would recommend NOT clicking that link. Multiple people in my server caught it within the past hour.
😐 fucking token grabbers
absolute low lifes
I think the ones sending it are just infected with it as well, so they deserved to be pitied as well.
true
Is it a bad idea to store Discord IDs as floats? They take so much less storage than str, and its much faster too. I cant use int bcz it would be very complicated to change things when discord ids go above 64bits (it'll be a couple years but better be ready than sorry)
int -> str -> float
nvm im stupid, its super innacurate
#993544558828851250 pls help
How to process commands in on_message event?
client.process_commands(ctx)
Does not work
How to make a discord.File object a discord.Attachment?
send it
pass the message as an argument (i think)
I passed it
I don't want to send it though.
It returns me that "Bot" object does not have process_commands
I want a link of the attachment which then downloads the file.
But the txt file is created using Python
link is generating when you send an file to the discord cdn
Then how can I get a url to download the txt file
upload to an external host
bump
How am I meant to do that with Python though
use the api of the service u choose
are you using discord.Bot?
Can I not just create an attachment or get a url for the file using discord api
import discord
intents = discord.Intents.all()
activity = discord.Activity(name='Use /rphelp!', type=discord.ActivityType.watching)
client = discord.Bot(intents=intents, command_prefix='>', fetch_offline_members=True, sync_commands=True, activity=activity, debug_guilds=[985044751122313227])```
That's my client instance
you should send it into a channel
But I don't want to send it as a file
I want to send it as a link
They just take up lots of space
then you cant access the link
what
Ill describe it to you simple
if you dont send the file you cant access the link
ik
Post file you want on external API and get a link from it
bruh
it's simple
im looking it up file to url and nothing comes up
Sharing files with file.io is convenient, anonymous and secure. Just upload files and share the links via email, SMS, Slack, Discord, etc. Easy-to-use REST API.
EZ api
discord.Bot does not having an method calling process_commands
so how to have it
only commands.Bot have
So how do I process commands in on_message event ?
With client instance that I have now ?
theoretically you could create an discord.Context calling the process, but i am not sure if that one will works
bruh
nvm
i am dumb
replace discord.Bot with commands.Bot
if this dont work i am out
and try ```
cctx = discord.commands.Context()
await cctx.invoke(command_here)
discord.errors.ExtensionFailed: Extension 'jishaku' raised an error: AttributeError: module 'discord.ui' has no attribute 'TextInput'
what does this means ?? and how to fix it
Thx i got it working with it but how can i specify the extension in the dict data
otherwise when u download it, it is just a File ext
It means you probably have conflicting libraries
Or you mistyped an import
Anyone know where the @commands.has_permissions decorator source code is located?
I'm on a Macbook and I'm following this tutorial, I have to do node bot.js in terminal however since I moved the file to desktop its giving me an error saying Error: Cannot find module '/Users/bradley/bot.js'
have you seen the discord you're in?
?
This is Pycord (a python discord api wrapper) not discord.js
probably
so if a timezone object returns none when .tzinfo is called, is it native or offset, i am so confused
its naive
@xp.command()
@option(
'user_id',
int,
description='Enter user id'
)
async def add(self, ctx, user_id: int, xp: Option(int, 'Enter amout of xp to be added', min_value=1)):
```how?
it's above 2^32

