#Basic Pycord Help (Quick Questions Only)

1 messages Β· Page 45 of 1

full basin
#

It's like the next level of ignorance

rare ice
#

Unfortunately that’s true

limber urchin
#

Even with 5 people telling them they're wrong, they're too delusional to realize their mindset is incorrect lol

young bone
#

There are many people of that stare

fleet marsh
#

help & support = help and support for learning

#

not doing ur job for u

vale heath
#

Wut I missed here πŸ‘€

limber urchin
#

Just someone who thought that help = someone writing code for you

vale heath
#

btw modal can be used by slash cmds ? bridge/prefix wont work ?

young bone
#

so slash/buttons

vale heath
#

thought so thanks ok_fidget

young bone
#

Im not sure if it works with a dropdown

vale heath
#

k

fervent cradle
#
@bot.event
async def on_message(message):
    if message.author.id in silencedids:
        message.delete()
        duration = timedelta(seconds=5)
        await message.author.timeout_for(duration, reason="Member is silenced.")```
#

this code keeps saying no permissions

#

even though my bot has admin perms

#

i even tried giving it an admin perm role

#

lol

proud mason
fervent cradle
#

well

#

the same error

#
@bot.event
async def on_message(message):
    if message.author.id in silencedids:
        duration = timedelta(seconds=5)
        await message.author.timeout_for(duration)
        await message.delete()```
limber urchin
#

Are you going to tell us the error, or should we just guess?

fervent cradle
#

throws invalid perms

limber urchin
#

then your bot doesn't have permission to delete the message, simple

fervent cradle
#

literally admin perms

#

uwu + admin

limber urchin
#

and the error?

fervent cradle
#
Ignoring exception in on_message
Traceback (most recent call last):
  File "C:\Users\Owner\PycharmProjects\nuttttttt\venv\lib\site-packages\discord\client.py", line 377, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\Owner\PycharmProjects\nuttttttt\main.py", line 64, in on_message
    await message.author.timeout_for(duration)
  File "C:\Users\Owner\PycharmProjects\nuttttttt\venv\lib\site-packages\discord\member.py", line 881, in timeout_for
    await self.timeout(
  File "C:\Users\Owner\PycharmProjects\nuttttttt\venv\lib\site-packages\discord\member.py", line 854, in timeout
    await self.edit(communication_disabled_until=until, reason=reason)
  File "C:\Users\Owner\PycharmProjects\nuttttttt\venv\lib\site-packages\discord\member.py", line 828, in edit
    data = await http.edit_member(guild_id, self.id, reason=reason, **payload)
  File "C:\Users\Owner\PycharmProjects\nuttttttt\venv\lib\site-packages\discord\http.py", line 360, in request
    raise Forbidden(response, data)
discord.errors.Forbidden: 403 Forbidden (error code: 50013): Missing Permissions```
limber urchin
#

Read the error, that's on the timeout

proud mason
limber urchin
#

you can't time someone out who has a higher role than you

fervent cradle
#

shouldnt it ignore the error and delete the message tho?

#

or do i have to make an entire check for that

limber urchin
#

no? You don't handle the error anywhere

#

The library raises an error for you to handle, it wouldn't make sense for it to just ignore it

fervent cradle
#

alr

#

is there a way to ignore the error or do i have to use a try block

limber urchin
#

That is the way to ignore the error

fervent cradle
#

brug

#

ok

undone falcon
#

do you know what could be causing this error ?

#

It does it when I try to add a cog:

proud mason
# undone falcon

You have some wrong option input type in one of your commands in that cog

undone falcon
#

These are the imports :

proud mason
#

Hmm no idea

#

Show pip list

undone falcon
#

aiosignal==1.2.0
aiosqlite==0.17.0
async-timeout==4.0.2
attrs==22.1.0
charset-normalizer==2.1.0
frozenlist==1.3.1
idna==3.3
multidict==6.0.2
py-cord==2.3.2
PyMySQL==1.0.2
python-dotenv==0.20.0
pytz==2022.2.1
typing_extensions==4.4.0
yarl==1.8.1

proud mason
#

No idea. Wait for someone else

undone falcon
#

I see thank you ! Should I start a thread ?

#

ooh when I remove the type hinting it is working ThinkO_O

#

these lines seems to be breaking the cog

from __future__ import annotations
from typing import TYPE_CHECKING
if TYPE_CHECKING:
    from bot import Bot   # custom class subclassing from discord.ext.commands import Bot
    from database.database import Database # custom class
proud mason
#

Oh

#

Well then remove them shrug

spare haven
#

Hi! Which is the correct way to avoid executing certain slash commands depending on the role of the Member who executed it? I was thinking of just adding and IF statement and check for their role but I don't know if there is a better way of doing this (Maybe there is a way to not even show this commads if you are "X" role)

vale heath
#

.rtfm has_any_role

winter condorBOT
vale heath
#

.rtfm has_permission

winter condorBOT
vale heath
#

And you can hide the slash cmds from server settings > integration

spare haven
spare haven
vale heath
spare haven
#

Is there a way to pop up a confirmation dialog when executing a slash command? Like (Are you sure you want to do this? You chose parameter1, parameter2)

amber shale
#

what is happening? (it is my user as bot)

full basin
amber shale
#

πŸ’€

proud mason
amber shale
#

it is my account

proud mason
amber shale
#

ok

#

was little scared

proud mason
#

So what I'm guessing is, you don't respond to the cmd before shutting down

amber shale
#

no

proud mason
amber shale
#

idk it happens some time

errant craneBOT
#

Here's the confirm example.

proud mason
#

@spare haven see this

proud mason
proud cargo
#

can you change about me/pfp using api

proud mason
proud cargo
summer atlas
#

Is it possible to determine who invited a bot? I'd like to PM the inviter when the bot joins a guild

ornate swan
#
            view = discord.ui.View()
            keep_button = discord.ui.Button(label="Keep", row=0, style=discord.ButtonStyle.green)
            delete_button = discord.ui.Button(label="DELETE!", row=0, style=discord.ButtonStyle.red)
            view.add_item(keep_button)
            view.add_item(delete_button)

            async def keep_button_callback():
                await discord.interaction.respond.send_message("keep")

            async def delete_button_callback():
                await discord.interaction.respond.send_message("delete")

How do i link the callback functions to the buttons, so they respond as i press the button?

proud mason
#

Check smth in there

#

I believe you should get smth

proud mason
errant craneBOT
#

Here's the confirm example.

proud mason
#

See that example

west quest
#

So is it possible to run a task manually with a command?

summer atlas
fervent cradle
ornate swan
fervent cradle
full basin
#

shouldnt interaction.response.edit_message count as responding the interaction?

fervent cradle
full basin
#

My view is timing out for some reason

#

When it in fact responds to the interaction by editing the message

spare juniper
#

@haughty wedge is that exactly whats in the code?

#

Like its that string

#

Or do you have bot.run(BOT_TOKEN)

proud mason
west quest
proud mason
#

πŸ‘

blissful hazel
#

How do i get infinite channels as an option in a slash command (/cmd #channel1 #channel2...)

vale heath
blissful hazel
#

a slash command that accepts N channels

limber urchin
#

You need to take it as a string input and parse it on your own. Discord currently does not support multiple channels in one option

blissful hazel
limber urchin
#

Or do some workaround with a whole lot of optional options, but that's the ugly solution

young bone
blissful hazel
#

But my issue is resolved

young bone
#

you have to check for it if its and int

knotty surge
#

Hey all trying to set up Rich Presence for my bot. Anyone know an example I can see/read through or point me in the right direction

full basin
#

Bots cant use rich presences

knotty surge
#

Thank you

#

Unresolved reference 'Activity' ?

fervent cradle
#

How can I make a command that will make a channel to which the person who used the command has access, but other participants do not?

full basin
full basin
winter condorBOT
full basin
#

.rtfm discord.Permissions

full basin
fervent cradle
#

from discord.ext.commands import slash_command
from discord.ext import commands
from discord.ext.commands import Cog
import datetime

class pollModal(discord.ui.Modal):
    def __init__(self,bot,*args, **kwargs) -> None:
        self.bot = bot
        super().__init__(*args, **kwargs)
        self.add_item(discord.ui.InputText(label="What are you asking?", style=discord.InputTextStyle.long))

    async def callback(self,ctx, interaction: discord.Interaction):
        m = await interaction.response.send_message("Poll sent!", ephemeral=True)
        poll = discord.Embed(title=f"New Poll",color=discord.Color.blue())
        poll.add_field(name="yes", value=self.children[0].value)
        poll.timestamp = datetime.datetime.now()
        poll.set_footer(text=f"Message id: {m.id}  ")
       
        embed = await ctx.send(embed=poll)
        await embed.add_reaction('β˜‘')
        await embed.add_reaction('❌')
     

class pollCog(discord.Cog):
    def __init__(self,bot):
        self.bot = bot


    @slash_command(name="poll", description="Creates a poll")
    async def modal_slash(self,ctx: discord.ApplicationContext):
        await ctx.send_modal(pollModal(self.bot, title="Poll"))



def setup(bot):
   bot.add_cog(pollCog(bot))```
Ignoring exception in modal <Poll.create.pollModal object at 0x7f023f9f0a30>:
Traceback (most recent call last):
  File "/home/jack/.local/lib/python3.10/site-packages/discord/ui/modal.py", line 341, in dispatch
    await value.callback(interaction)
TypeError: pollModal.callback() missing 1 required positional argument: 'interaction'
#

No response after clicking sumbit in modal

fervent cradle
#

To respond

full basin
#

Modals have no ctx

#

You only receive interaction

fervent cradle
#

Oh i see now then]

fervent cradle
young bone
fervent cradle
#

so send_interaction?

young bone
proud mason
fervent cradle
north gorge
#

I'm getting certain users getting "interaction failed" when trying to use a button that seemingly works for everyone else, but there's no error being thrown on my side. I have no idea where to start with troubleshooting this, do you think it's possible they just have high latency or packet loss or something?

#

It's a "cancel the game" button that only works for a short period of time then is automatically removed, so I'm wondering if it's just them being slow to update on their end

fervent cradle
north gorge
#

hmm.. yeah I guess it could be something like that, but this code is pretty fast and not the kind of thing that ought to be deferred or given some kind of special treatment as far as the response goes

#

not sure what to tell this guy lmao, can't figure out what's going on here

fervent cradle
#

or a lot of people?

north gorge
#

this is literally the only guy I can confirm it happening with

#

everyone else plays this game happily all day

#

that's why I'm so confused

fervent cradle
#

if its fine with everyone else, leave it and tell them to try again later

north gorge
#

yeah.. maybe that's just what it is

#

"sorry kid it ate your money try again later :D" oh well

fervent cradle
#

Lol

north gorge
#

this is the entire callback, not really sure how it could be failing to respond in time, the first line is literally deferring the response

young bone
#

and where is the message?

north gorge
#

elsewhere in the game logic, once that task is cancelled the game_end condition does some tallying and responds within a fraction of a second

#

but it's literally this interaction which is being said to fail

#

not .. y'know, the followup stuff

#

I just don't know how that happens, not like the box is even under heavy load

#

like doesn't that imply the code pycord runs to handle the callback between their click and this code saying "OK, defer the response" isn't happening fast enough to hit the .response window, that 3 seconds or whatever it is

#

I kinda doubt pycord is the issue here, given that every other button works great and only this single user has this issue

#

just not even sure where to start troubleshooting this lol

final fractal
#

Hey! How do I get my bot to say *bot name* is thinking ...?

north gorge
#

you want to defer your interaction.response

#

await interaction.response.defer()

knotty surge
#

There anyway to only have the slash commands appear and work in a certain channel?

proud mason
knotty surge
#

Ah so base discord, is there anyway to automate this (if the bot was to be spread across many servers or no)

simple canopy
woeful spindle
knotty surge
simple canopy
#

i believe permissions handler from .ext.commands also works with slash commands

#

you can set it up to work on per-channel basis

woeful spindle
simple canopy
#

or use cooldowns from same .ext.commands module, they also work with channels iirc

simple canopy
knotty surge
#

Hey one more thing I am getting these errors when I am starting my bot:

  File "", line 352, in _run_event
    await coro(*args, **kwargs)
  File "", line 793, in on_connect
    await self.register_commands()
  File "", line 460, in register_commands
    await self.http.bulk_upsert_command_permissions(
  File "", line 338, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 405 Method Not Allowed (error code: 0): 405: Method Not Allowed

Can someone tell me why these are happening?

knotty surge
young bone
#

?tag idw

obtuse juncoBOT
#

Saying it doesn't work or asking what's wrong with this code? is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

knotty surge
# young bone ?tag idw

Ah so, the errors appear to be coming from my installed package of pycord and appear when my bot runs. It doesn't crash my bot etc and it functions fine, however when I make my bot and libraries exes, my exe fails to launch. Presuming these errors are why

silver moat
#

.tag application.commands

winter condorBOT
#

Tag not found.

silver moat
#

?tag application.commands

obtuse juncoBOT
#

dynoError No tag application.commands found.

silver moat
#

?tag missing_access

obtuse juncoBOT
north gorge
#

Can you disable a button from the callback given button: discord.ui.Button as a callback parameter?

#

without.. y'know, having to fetch the response, do .edit(view=None) or whatever

proud mason
round rivet
#

update pycord

proud mason
winter condorBOT
knotty surge
proud mason
#

Ta?

round rivet
#

ta.

proud mason
fleet marsh
#

.slashcommandmention

winter condorBOT
#

</full name:ID>

fleet marsh
#

this doesnt work for me

#

it just prints the command name in plaintext

#

does the command need to be global or smth?

#

</github:990412794551750682>

dim cape
#

/github

fleet marsh
#

thats what i get when doing </github:990412794551750682>

#

ik the bot isnt in this server but it happens in servers where the bot is too

round rivet
fleet marsh
#

just plain text /github

round rivet
#

</github:990412794551750682>

#

so this is plaintext?

fleet marsh
round rivet
#

update discord

fleet marsh
#

oh

round rivet
fleet marsh
#

but it worked for other bots...

round rivet
#

Β―_(ツ)_/Β―

#

It's showing fine for me

#

Though I am on Android alpha
App: 160.1 (160201) canaryRelease; Manifest: N/A; Build Override: N/A; Device: barbet (Pixel 5a) OS 33;

fleet marsh
#

whats the command that says "use /close to close the post"

round rivet
#

shouldn't change anything though, that rolled out a long time ago

round rivet
fleet marsh
#

.close

winter condorBOT
#

Done with your help thread?

Please close your own help thread by using </close:1009144375709814897> with @errant crane.

fleet marsh
#

yeah

round rivet
#

weird

fleet marsh
#

also i restarted discord and it didnt update anything lol

#

yeah it works perfectly on my phone

#

update: now on canary and it still doesnt work 🀣

#

Canary 165559 (ee56d1a) Host 1.0.55 (28098) Windows 10 64-Bit (10.0.22621)

young bone
dim cape
#

2022-10-31 23:18:10.764000+00:00 somone know how i can convert this into datetime formatter quickly.

proud cargo
#

How can I check if the bot has permissions to ping a given role in a given channel?

round rivet
full basin
#

datetime my beloved

round rivet
#
>>> import datetime
>>> datetime.datetime.fromisoformat("2022-10-31 23:18:10.764000+00:00")  
datetime.datetime(2022, 10, 31, 23, 18, 10, 764000, tzinfo=datetime.timezone.utc)
novel jay
#

I was curious if there was some way to shard a bot without taking it offline since i really don't like putting it offline, and if there's no way what's the downsides to sharding before 1000 guilds? (besides just wasted resources)
Please ping when replying

silver moat
knotty surge
#
gnoring exception in on_connect
Traceback (most recent call last):
  File "C:\Users\my_dir\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\client.py", line 352, in _run_event
    await coro(*args, **kwargs)
  File "C:\Users\my_dir\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\bot.py", line 793, in on_connect
    await self.register_commands()
  File "C:\Users\my_dir\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\bot.py", line 460, in register_commands
    await self.http.bulk_upsert_command_permissions(
  File "C:\Users\my_dir\PycharmProjects\pythonProject1\venv\lib\site-packages\discord\http.py", line 338, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 405 Method Not Allowed (error code: 0): 405: Method Not Allowed
#

This is what my executable is saying

full basin
#

@knotty surge show pip list

peak chasm
#

how can i edit the message? I thought that was the command

peak chasm
#

thanks <3

#

I thought it was the same as interaction.response.edit_message
It already works <3

#

i love u

north gorge
#

I'm a little confused, this concept of guild.premium_tier is not the new new "Server Subscription" thing where you can buy four tiers, right? It's just Nitro?

north gorge
#

I guess it's confusing because it also mentions a premium "slider" which sounds a lot like the nitro bar, not the VIP subscriptions thing

#

eer progress bar

#

what would you say is the best way to run some code when someone buys tier 0, tier 1, etc of the VIP Subscription?

#

I don't see an event handler for it

final fractal
#

Hey guys. I have an issue with my code and I hope you can help. When I run my slash command sometimes it does not work. Meaning, The application did not respond. It feels kinda unpredictable. What should I do about this? Why is this happening? Here is my error:

  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/bot.py", line 992, in invoke_application_command
    await ctx.command.invoke(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/commands/core.py", line 358, in invoke
    await injected(ctx)
  File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/discord/commands/core.py", line 135, in wrapped
    raise ApplicationCommandInvokeError(exc) from exc
discord.errors.ApplicationCommandInvokeError: Application Command raised an exception: NotFound: 404 Not Found (error code: 10062): Unknown interaction```
full basin
#

You're taking too long to respond aka taking too long to process the command

north gorge
#
await interaction.response.defer()
... your long-running code here
await interaction.followup.send("Something")
north gorge
final fractal
north gorge
#

await ctx.defer() might be more applicable if you're asking that

final fractal
#

😳

north gorge
#

I'm pretty new to discord bot stuff but most slash commands I've seen use either ctx or interaction to let you do stuff, both of those can be deferred

final fractal
#

So i added await ctx.defer and I dont see my bot saying *bot name* is thinking... and i still sometimes get the error.

limber urchin
#

Show your code

copper dew
limber urchin
#

Well first of all, you're deferring after you make the request, which does nothing

#

And don't use the requests library

#

?tag requests

obtuse juncoBOT
#

Why you should not use the requests library for your bot
requests is a popular HTTP library for Python. It is however not a good option for Discord bots, since it is not async and blocking.

This essentially means that your bot will not be able to execute any code at all while a request is happening. Since requests usually take a few seconds to complete, this can have a detrimental effect on your bot's performance. E.g if a user executes a command that performs a request taking 5 seconds to complete, no one else will be able to use your bot for those 5 seconds.

Please look at using a HTTP library that has async support, such as aiohttp or httpx

final fractal
#

Can I easily replace my code with aiohttp? I used it in a older bot.

limber urchin
#

Up to you πŸ€·β€β™‚οΈ

final fractal
limber urchin
#

Like you were told, you need to defer before any code that can take more than 3 seconds

#

Now you're just deferring right before you respond to the command, which makes no sense

final fractal
#

I thought you defer before a you respond. :/

limber urchin
#

No, you defer before you run code that takes a long time

#

like you were told

final fractal
# limber urchin like you were told

Hey, I'm sorry but I don't appreciate being spoken to in a condescending or dismissive way. It's not helpful or respectful, and I expect to be treated with kindness and patience as I'm still learning.

limber urchin
#

I'm just stating the fact that someone told you how to solve your issue but you either didn't read it, or didn't understand it.

#

And if you're still at the learning stage of basic Python, a Discord bot is not a project fit for you yet

#

If you find that disrespectful, then I can't help you any further

novel jay
haughty wedge
stark walrus
#

What's up with that! Not responding

proud mason
#

any errors?

#

is the bot running?

#

send pip list

stark walrus
# proud mason send pip list

searching from this channel's previous messages, i diagnosed that- i deleted all discord related packages and re installed py-cord

then after that now i think i diagnosed the exact cause, i used commands.Bot

#

If I don't have my on_interaction event it works properly

#

Any idea how that can be fixed?

#

I use message commands as well

proud mason
#

why are you having that event?

stark walrus
#

I need that event

#

Is there a way i can do smth like await bot.process_commands in that event

proud mason
stark walrus
#

Similar to what we do traditionally in on_message event

proud mason
stark walrus
#

ohh

#

Thank you!

proud mason
proud mason
stark walrus
#

Oh

proud mason
#

yeah

#

or you know there is an on_application_command event too if you want to listen to app cmds only. that way you wont need the on_interaction event

stark walrus
#

That fixed it, tysm!

proud mason
#

πŸ‘ πŸ‘

knotty surge
young bone
young bone
#

and really old py-cord version

#

?tag install

obtuse juncoBOT
#
  1. Uninstall discord.py or any other forks of discord.py you might have with the namespace discord.
    python -m pip uninstall discord.py discord -y

2a. Install py-cord
python -m pip install py-cord

2b. Update py-cord
python pip install -U py-cord

Installing other builds:
Note: You need to have git installed. Use ?tag git to find out how to install git.

Updating the module to master branch (unstable):
pip install -U git+https://github.com/Pycord-Development/pycord

knotty surge
# young bone discord.py

Hey mate thank you that sorted it. I thought I updated py cord last night. Still quite new to this level of python so trying to get used to it, so thanks so far

vale heath
misty yew
#

How can I send a message in text chat, in voice channel?

proud mason
winter condorBOT
proud mason
#

just like you do in a normal text channel

misty yew
#

oh, thanks

errant craneBOT
#

Here's the slash options example.

young bone
#

^

knotty surge
#

Finding this on my console when I run my exe, googled it and not sure why its happening, anyone ran into this before?

_distutils_hack\__init__.py:33: UserWarning: Setuptools is replacing distutils.

knotty surge
#

I did a google search it says to update setuptools, did that and it is still appearing. Its not causing any issues with my bot though

proud mason
#

Can you show the full error?

knotty surge
#

That is all that comes out

proud mason
#

I think it's something related to python 3.11 preferring pyproject.toml over setup.py

But im not sure about those facts

knotty surge
#

So update python?

#

I'll update python and see if that is why

#

I am on Python 3.11.0

proud mason
#

You can try but I'm not sure

#

Do you use distutils?

knotty surge
#

Not that I am aware of

#

I'll clear my build folders etc then remake the exe

proud mason
knotty surge
#

Should I install distutils?

proud mason
#

I'm shooting in the dark here, so i don't know

proud mason
misty yew
#

How can I get author of message in myview (button) without ctx?

proud mason
knotty surge
#

Strange I'll put it on stack overflow

gilded niche
#

Is it possible to put all members in a drop down menu??

full basin
#

You can use a member dropdown type

#

.rtfm discord.ComponentType.member

winter condorBOT
#

Target not found, try again and make sure to check your spelling.

full basin
#

.rtfm ComponentType

full basin
#

Provide it in the select_type kwarg of the select's init

spare juniper
# haughty wedge its a string

Ye thats a problem do bot.run(BOT_TOKEN) since you stored your token into that variable at the beginning of your code

proud mason
#

.rtfm user_select

winter condorBOT
proud mason
# winter condor

@gilded niche you can also use the 2nd one here. That's easier

haughty wedge
#
Traceback (most recent call last):
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 801, in static_login
    data = await self.request(Route('GET', '/users/@me'))
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 744, in request
    raise HTTPException(response, data)
discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "C:\Users\Admin\Downloads\premix\main.py", line 811, in <module>
    bot.run(BOT_TOKEN)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 828, in run
    asyncio.run(runner())
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\runners.py", line 44, in run
    return loop.run_until_complete(main)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 646, in run_until_complete
    return future.result()
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 817, in runner
    await self.start(token, reconnect=reconnect)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 745, in start
    await self.login(token)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\client.py", line 580, in login
    data = await self.http.static_login(token)
  File "C:\Users\Admin\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\http.py", line 805, in static_login
    raise LoginFailure('Improper token has been passed.') from exc
discord.errors.LoginFailure: Improper token has been passed.
fervent cradle
#

To see what is the error and debug it

haughty wedge
#

idk what is the error

#

it just gives me the token

#

the token is in strings

full basin
#

Read your own code? shrug

simple plover
#

Hi, i have a Select Menu class in a file and i imported it in a cog file and used it in a command, the thing is, i want to put emojis to the options in the class, how can i put an emoji object (client.get_emoji(id) ) in a file that is not a cog or the main file?

proud mason
#

Bruh. Thats the only way to know

#

Please stop being rude

proud mason
amber shale
#

to gets dm message way i know is listen for messages and check if server is None
is there any other way?

proud mason
#

Ok calm down. Are there any cmds to which you have passed a name in the decorator? Have you checked those

#

Also send pip list

simple plover
amber shale
#

like if id == 12424:

#

12424 is hardcoded

#

is that complete error message?

proud mason
amber shale
#

i guess there is some more above or below

proud mason
amber shale
#

ok

#

yeah you are correct

final fractal
#

Do bot.command and bot.slash_command do the same thing? Because I see them being user interchangeably.

proud mason
#

If you are using commands.Bot then bot.command is a prefix cmd

If you are using discord.Bot then it is a Slash cmd

bot.slash_command is a Slash cmd in both (ofc)

proud mason
proud mason
#

Pass the emoji string into the emoji parameter. Or you can create and pass a PartialEmoji too

simple plover
#

Yeah i understood, thanks

#

why i cant import functions from the main file?

#

it gives me an error

proud mason
simple plover
#

Yeah thats the error

#

anyways to use a func from the main file?

proud mason
#

You should rather subclass bot and add the functions you need to your bot class

simple plover
#

okay thanks again, i'll take a look

proud mason
final fractal
final fractal
#

Thank you.

simple plover
#

i wanna use it in another file, non cog file

#

should i put it in class?

proud mason
#

Uh

#

Well

#

client.get_guild will only return the guild after the bot has connected. Else it will return None

#

You will mostly be calling the non cog file before your bot has connected

proud mason
#

Wdym interfere?

round rivet
#

prefix is on_message, and you can use bot.process_commands

#

what

#

prefixed commands are processed in on message

#

Unless I misunderstood the question

vivid plaza
#

Hello I'm getting this error while trying to turn on my bot: TypeError: Client.start() got an unexpected keyword argument 'bot'

limber urchin
#

bot=False???

#

@kindred sail

#

Aaand reported to Discord's ToS team

vivid plaza
#

sad

limber urchin
#

RIP account

vivid plaza
#

RIP fr man

#

when will I get banned ?

#

from discord.

limber urchin
#

You'll see :)

vivid plaza
#

I'm really surprised.

limber urchin
#

I see you online @hollow brook

hollow brook
#

Yeah indeed I am

#

What's up?

limber urchin
hollow brook
#

What a guy

#

Let's see what I can do

vivid plaza
#

ban me

#

all u can do

#

other things are up to Discord team.

silver moat
#

actually, we can get you banned from Discord as well

#

it is just a DM away

full basin
#

People still use selfbots?

vivid plaza
#

Go on

limber urchin
#

And this big brained fella decided to ask about it in a partnered server

young bone
#

what is happening here lul

vivid plaza
#

I'm using a selfbot and they're raging or idk

limber urchin
#

No, you got it wrong. We're making fun of you

full basin
#

^ tbh

young bone
vivid plaza
#

You got me here πŸ’€

#

WHY TF DID I ASK A PARTENERED DISCORD SERVER

#

FOR SMTH AGAINST DISCORD ToS

limber urchin
#

Because someone smart (dumb) enough to self-bot would do something like that

vivid plaza
#

trying to make account checker

limber urchin
#

didn't ask

vivid plaza
#

for something I want to do

vivid plaza
#

and said "why"

#

Fr people here are weird

limber urchin
#

Uh-huh, whatever you say buddy

#

@west vault congratulations, you have been pinged

#

since every other mod is asleep

proud mason
#

πŸ‘€

vivid plaza
#

Imma just leave lmao

vivid plaza
#

Cya

round rivet
#

you don't need process commands in a listener

fervent cradle
#

hi guys im trying to prevent a command to be running in an event. but i dont know how to do that. i tried return but it still executes the command

young bone
fervent cradle
#
import json
import discord


intents = discord.Intents.default()
intents.members = True

bot = discord.Bot(intents=intents)

config = json.load(open("config.json", "r"))

@bot.event
async def on_application_command(context:discord.ApplicationContext):
    print(context.guild)
    if context.guild_id != None:
        await context.send("You can only use this command inside a DM!")
        return

@bot.slash_command(name="hi")
async def global_command(
    ctx: discord.ApplicationContext, num: int): 
    await ctx.respond(f"This is a global command, {num}!")

bot.run(config["token"])```
fervent cradle
proud mason
#

Brb let me pull up docs

proud mason
#

.rtfm guild_only

proud mason
#

1st one

full basin
#

And FYI, that event doesn't override command procession so that's why it still executes lol

proud mason
#

Oh yeah

rare ice
full basin
#

What does that even have to do with on_application_command

#

I'm saying that event isn't the one that handles the slash command procession

west vault
fervent cradle
west vault
#

don't do that

#

wait nvm

#

you want it in a dm

fervent cradle
#

yes

west vault
#

why do you even need to do it like that lol. that sounds overcomplicated

fervent cradle
#

nvm checks are suitable for my usage

west vault
#

checks sound like the only correct way in that case tbh

#

everything else would be manual fuckery with core functions

novel jay
#

Is there any difference between @bot.event and @bot.listen()?
If so, what are they?

silver moat
novel jay
#

ohhh ok I'll use bot.listen() then πŸ‘

rare ice
silver moat
#

listen is also what cog.listener uses

simple plover
#

can i add defer() to select menus?

#

i need a defer when someone clicks the option

silver moat
simple plover
silver moat
#

await interaction.response,defer()

young bone
silver moat
young bone
silver moat
#

just anti-spoonfeed things

young bone
dim cape
#

How can i get the users message

young bone
dim cape
young bone
#

slash commands are broken again why....

dim cape
astral mist
#

where can i find the part in docs where it shows how to hide ur token

#

found it

fluid tusk
#

how do i check a modal if its sent by the user who sent it

proud mason
#

.rtfm interaction.user

winter condorBOT
proud mason
#

you mean this?

lost lodge
#

Hey! How can i add "Try my commands" to my Bot?

boreal dust
#

I have a serious question. Can I still use PycordV2?

boreal dust
boreal dust
digital storm
#

How do I disconnect a user from a voice channel? Ping me
nvm figured it out

vale heath
boreal dust
vale heath
#

It's currently in alpha as it's mentioned in #server-announcements so you can use still use v2

digital storm
#

You will always be able to use any version

#

It's just maybe discord will update their API and some stuff won't work anymore

misty yew
#

How can I timeout an author of message without commands? (on_message)

vale heath
digital storm
vale heath
#

Even if they do idt it would be hard to migrate to v3 after it becomes stable thenking

digital storm
boreal dust
static juniper
#

how to ctx.respond with mention but not ping the user?

warm kindle
#

how can i do mention command?

vale heath
#

Wdym ?

warm kindle
fervent cradle
#

how do i add cooldown

fervent cradle
#

okay

proud mason
proud mason
static juniper
#

like @static juniper but not ping the user

proud mason
#

.rtfm AllowedMention

proud mason
#

Pass that to respond

static juniper
proud mason
#

I got ratelimited error for doing defer() + 1 followup

I thought interactions didn't have ratelimits. Why is this happening?

#

This is a giveaway bot with many gaws

misty yew
#

How can I get a name of user, that use interaction? (for example, send text in modal)

proud mason
#

It's an oracle free vps

silver moat
#

If I remember correctly, followups count towards rate limits.

proud mason
#

just delay the response till you're not rate limited? or try again after for shared limits?

I asked in discord devs server and they suggested me to do this. How can I do that

proud mason
#

But i can't directly respond with deferring because i have external api calls and it does sometimes take over 3 seconds

silver moat
#

what apis are you calling?

proud mason
silver moat
#

ah

proud mason
#

Yeah

fervent cradle
#

async with aiohttp.ClientSession() as session: Would i need to change the aiohttp.ClientSession() if im using bot intents? by changing it i mean changing it to aiohttp.BotSession()

proud mason
#

No lmao. That's a separate library

fervent cradle
#

Okay thank you

proud mason
#

ClientSession is not related to discord.Client or anything

fervent cradle
#

Just wanted to make 100% sure before i complete the code.

proud mason
#

Haha πŸ‘

misty yew
proud mason
#

If message.guild is None then it means the message is a dm

#

Check that before doing the stuff

misty yew
#

Oh, thanks

proud mason
silver moat
proud mason
proud mason
silver moat
#

{}

proud mason
#

Anyways ig I'll make a post after a while

silver moat
#

it's an array in every other language

#

or a set in Python

proud mason
#

πŸ‘€
{} Is a dict right

silver moat
#

since you don't actually care about the order of people in there

#

it's also a set

proud mason
#

Oh

#

Well what is a={} then?

silver moat
#

dict by default

proud mason
#

Ic ic

#

Ty DaniSalute

copper knot
#

i dont get the point of a set compared to a tuple

proud mason
silver moat
#

set also doesn't have them ordered

limber urchin
#

Checking if a set contains something is O(1) which is a lot better than a list or tuple. And they're mostly used for the mathematical operations like intersection and all that.

misty yew
#

This panel in voice channel. After triggering one button, no more respond (from other accounts)
There are no errors. What happened?

limber urchin
misty yew
silver moat
#

no

limber urchin
misty yew
limber urchin
#

Send a pastebin or something

silver moat
#

how about opening a new thread?

misty yew
errant craneBOT
limber urchin
#

And yeah, probably open a new thread.

misty yew
#

OK

ornate swan
#

how do i get the id from the user who interacted with the button.
i dont want anyone to interact with my button, except the user who created the command.

limber urchin
#

.rtfm interaction.user

winter condorBOT
dim cape
#

How do i read measage after a command is ran

limber urchin
#

Please be more specific, what is your use case?

dim cape
#

Well the bot sends message β€œrespond with title”

#

then user responds an bot sends

limber urchin
dim cape
#

m.author == ctx.author and m.content.isdigit() how do i make this into like upper case and lowercase

limber urchin
#

??

#

what

dim cape
#

Could make the v3 example more text realted

limber urchin
#

Huh

#

It's literally the same event, you just need to change the check to match your own use case

#

If you're unable to do that then you probably need to learn more Python before making bot

#

You can't expect there to be examples of everything you want to do, sometimes you need to use your own brain

lone kiln
#

How can I change the format of the page indicator button of a paginator ?

dawn berry
#

I have an activity on my bot, but when I call Bot.activity it returns None CB_notlikethis

fleet marsh
#

confusion?

silver moat
#

yeah

fleet marsh
#

it works perfectly and is also what the docs say...

silver moat
#

you can avoid this warning by using discord.Intents(insert_intents_here)

dim cape
#

Btw for SelectOption is there a way to call back a certain label

silver moat
#

set the value as the label

dawn berry
#

the docs say that Bot.activity returns the activity that the bot started with. What if I want to know the current activity?

dim cape
silver moat
#

what is the scope of self?

dim cape
#

def init(self, bot_: discord.Bot):

fleet marsh
silver moat
#

which includes the messages intents (receive's on_messages)

dim cape
silver moat
dawn berry
#

ClientUser doesn't have activity

silver moat
#

hmm, I thought it did. Why do you need the current activity anyways?

dim cape
royal pulsar
#

When I run messages = await member.history(limit=None, after=datetime.now()-timedelta(weeks=2), oldest_first=True).flatten(), messages is an empty list. What am I doing wrong with this function?

cyan quail
dawn berry
#

that works thanks

silver moat
dawn berry
silver moat
#

ah ok

fleet marsh
silver moat
#

but yes

#

.rtfm intents.value

winter condorBOT
cyan quail
#

or just use discord.Intents.default() and then add more to that

#

probably the most readable

dim cape
#

How can i get a channel with the name

cyan quail
dim cape
#
        interaction.response.send_message("gamepass")```
#

@silver moat would this work

cyan quail
#

await but yeah

royal pulsar
cyan quail
#

just checking, are you 100% sure the bot has messages with that member?

silver moat
#

also confirming that you are looking for messages in direct messages?

dim cape
silver moat
#

where is this snippet?

#

under callback in a Select?

dim cape
errant craneBOT
royal pulsar
#

is it DMs or channel history?

cyan quail
#

DMs

#

if you want channel history then that's, well, channel.history

royal pulsar
#

i'm looking for a specific member, so should i put something in the check argument?

cyan quail
#

hmm history doesn't actually have a check argument so you'd have to filter it after

dim cape
deep holly
#

sorry if this has been answered before/happened before but I haven't had a chance to dive deeper yet but wanted to ask a quick question if there's a simple solution:

I just switched from discord.py to pycord. I noticed there isn't much I have to change since they're similar. My code actually works as-is before going in and adjusting whatever needs to be adjusted,

(actual question -->) however, when using slash commands, the bot DOES respond but there is a slight delay and I get that "The application did not respond" message, anyone know why? Thanks

cyan quail
limber urchin
deep holly
# limber urchin Some things *should* be different, for instance when responding to a slash comma...
async def inventory(ctx, member: discord.Member = None):
    await open_account(ctx.author)
    if member == None:
        user = ctx.author
        person = user.display_name
        personid = user.id
    else:
        user = member.mention
        person = member.display_name
        personid = member.id
    users = await get_bank_data()

    try:
        inventory = users[str(personid)]["inventory"]
    except:
        inventory = []

    em = discord.Embed(title = f"{person}'s Inventory",color=baby_blue)
    for item in inventory:
        name = item["item"]
        amount = item["amount"]

        em.add_field(name=name,value=f"x{amount}")
    await ctx.send(embed=em)```

That might be why - the ctx.send
sorry I tried to find a quick code example, most of them have a lot going on
cyan quail
#

yeah gotta use ctx.respond

deep holly
#

thanks quick solution I'm sure lol

deep holly
#

hahaha nvm I typed response, not respond. It's been a long day

cyan quail
#

rip

deep holly
#

okay weirdly I actually do still get that same error even using ctx.respond hmmm

#

looking at documentation, it seems fine but guess I have some digging to do. maybe it's not using pycord like it's supposed to. but the results have definitely changed so idk

limber urchin
#

Make sure you don't have any conflicting libraries installed, and keep in mind that if your command takes more than 3 seconds to execute you need to run a ctx.defer before any long-running code to make sure the interaction doesn't time out.

#

If you don't see this when using the command, you're still using ctx.send

deep holly
deep holly
limber urchin
#

What error?

deep holly
#

ctx doesn't have attr respond

#

is site package from discord.py? lol maybe I need to wipe it all and start over

limber urchin
#

In that case you probably still have discord.py installed

#

So yeah, do a wipe and make sure it only installs pycord

deep holly
#

I'll see what I can do on the servers files

limber urchin
#

And it might be worth check which version of pycord it installs too

deep holly
#

yep that's it, it does keep the old stuff. thanks.

lapis raptor
#

Hey, feel like it is fairly simple but cant find it anywhere, how would i take an embed I have made through a modal and send it to another channel other than the one it was sent in?

cyan quail
lapis raptor
cyan quail
#

essentially yeah

lapis raptor
#

alright, thanks will go try that out πŸ™‚

deep holly
#

good lord, I'm so done with Sparked right now lol
I'm looking through the history in this server and lots of people come across the module 'discord' has no attribute 'Bot when switching over. (using sparked too it seems) I've gotten rid of anything discord.py and manually moved over the discord folder from the pycord github and yeah idk lol

#

literally changed commands.Bot to discord.Bot just for stackoverflow to be like "change it to commands.Bot"

#

and then when you do that you have to change slash_command back to command. then finally the code runs ..until you try to use a command and it says context object has no attribute "respond"
yet when it's ctx.send it works, it just gives me an error next to it

#

I'm going to bed lol

#

oh okay weird, so change it back to ctx.send and it works. even after removing all discord.py with just py-cord left. except the console gives me an error that the command doesn't exist yet it works in discord just fine. I'm so lost but it works as-is and I will honestly sleep fine for now x.x

young bone
#

Show the pip list

zenith crystal
#
ImportError: cannot import name 'PartialMessageable' from 'discord.channel'```
#

Can somebody help me?

zenith crystal
#

i hav solved the prob

proud mason
#

send pip list. you may have library conflicts

zenith crystal
#
py -m pip install --upgrade --no-deps --force-reinstall git+https://github.com/Pycord-Development/pycord```
proud mason
proud mason
zenith crystal
#

Okay

#

Thanks man! Panda_Loves_Hearts_Likes

proud mason
#

πŸ™ƒ

ionic hull
#

hey guys

#

how can I add image to to embed? I've tried

@bot.slash_command()
async def test(ctx: discord.ApplicationContext):
        embed = discord.Embed(image={'url': 'https://www.gannett-cdn.com/presto/2021/03/22/NRCD/9d9dd9e4-e84a-402e-ba8f-daa659e6e6c5-PhotoWord_003.JPG'})
        await ctx.respond(embed=embed)

but I receive
TypeError: __init__() got an unexpected keyword argument 'image'

#

help pls

proud mason
storm oyster
proud mason
#

.rtfm Embed.set_image

winter condorBOT
proud mason
storm oyster
ionic hull
proud mason
#

not the embed image

zenith crystal
proud mason
#

thats the embed thumbnail tho

#

that is different than embed image

sleek haven
zenith crystal
#

how can i ban/kick somebody with buttons?

#
class MyView1(discord.ui.View): # Create a class called MyView that subclasses discord.ui.View
    @discord.ui.button(label="Kick!", style=discord.ButtonStyle.primary, emoji="😎") 
    async def first_button_callback(self, button, interaction):
        await guild.kick(member)
        await interaction.response.send_message("Du hast {member.mention} gekickt!") 
    @discord.ui.button(label="Ban", style=discord.ButtonStyle.primary, emoji="😎") 
    async def second_button_callback(self, button, interaction):
        await ctx.guild.ban(member)
        await interaction.response.send_message("Du hast {member.mention} gebannt!") 

@bot.slash_command() # Create a slash command
async def memberverwaltung(ctx, member: discord.Member):
    await ctx.respond("This is a button!", view=MyView1()) 
#
NameError: name 'guild' is not defined```
#

@proud mason

proud mason
zenith crystal
#

sorrryyyy

proud mason
#

You also need a member

zenith crystal
#

can you do a example?

errant craneBOT
#

Here's the button roles example.

proud mason
#

See that

#

You need to do similar to that

#

But rather, subclass view and add a self variable to store the member

errant craneBOT
#

Here's the confirm example.

proud mason
#

See that too

#

This is how you subclass view

zenith crystal
#

Thanks

dreamy mauve
#

can a bot invoke a slash command of some other bot?

proud mason
#

nope

fervent cradle
#

I stored current datetime in postgresql and after 2 or 3 day i want to end the giveaway so i have a task loop so how can I check if the database_datetime < current_datetime ??

#

Any example??

limber urchin
#

When your bot starts, just read the date from your database and start a task that runs on that date

fervent cradle
#

Using If else

rare ice
limber urchin
proud mason
fervent cradle
fervent cradle
limber urchin
fervent cradle
limber urchin
#
from datetime import datetime

datetime_str = '09/19/22 13:55:26'
datetime_object = datetime.strptime(datetime_str, '%m/%d/%y %H:%M:%S')
fervent cradle
rare ice
limber urchin
#

And a code example isn't spoonfeeding if that what's that reaction means

fervent cradle
#

Thanks πŸ™πŸ‘

proud mason
# fervent cradle Ohh so what's the difference between those timestamp and datetime ?? Because i j...

storing datetime in sql datetime datatypes has things like timezone come into play. It's good if multiple people access the db from different locations around the world, but they always make stuff buggy. and when you add orms into this, it becomes very very buggy

rather as only you would be accessing the db yourself, store the unix timestamp from datetime.timestamp(), which is a float and then convert save it as a bigint (or double)

then when you retrieve the data, run datetime.fromtimestamp and get the datetime object back

limber urchin
#

There is also the timestamp_tz datatype for postgres that ignores timezones

proud mason
#

oh

fervent cradle
proud mason
limber urchin
#

time.time() will give you the current timestamp in milliseconds. datetime.now gives you a datetime object for the current time.

fervent cradle
proud mason
proud mason
#

but that depends on your code

fervent cradle
#

That's what I'm doing rn

proud mason
thorny stag
#

How does inline work?\

#

I want
1
2
2
2

#

but I have no clue how

limber urchin
#

Setting an embed field to inline=True means the field only takes up as much space as it needs to, instead of the entire width

#

it defaults to False, which means it will use the entire width, forcing the next field to use the next line

thorny stag
limber urchin
#

I don't understand what you're looking for, but if you want everything on separate lines, just leave all fields as false

thorny stag
#

nevermind

limber urchin
#

πŸ€·β€β™‚οΈ ok

dim cape
proud mason
dim cape
#

Oh

dim cape
full basin
#

Then view.value isn't False

dim cape
dim cape
dim cape
#

Yoo

full basin
#

.tag idw

winter condorBOT
#

Saying it doesn't work or asking what's wrong with this code is not helpful for yourself or others.
Describe what you expect and/or tried (with your code), and what isn't going right.
Please provide any errors you get for optimal assistance.

dim cape
full basin
#

You're not providing more relevant code

#

Nor describing what you're expecting and what's actually happening

dim cape
#
async def purchase(ctx):
  view = payment()
  amount = DropdownView(bot)
  
  msg = await ctx.send("Please select the payment", view=view)
  await view.wait()
  if view.value == True:
    await msg.edit_orginal_response("Pick The Amount:", view=amount)
  elif view.value == False:
    await msg.edit_orginal_response("Pick The Amount:", view=amount)```
dim cape
dim cape
young bone
#

I know

barren garnet
#

is there such thing as bot.dispatch_event() in pycord?

gentle egret
#

I have this very very very simple code:

import discord

bot = discord.Bot()

@bot.command(description="Sends the bot's latency.")
async def ping(ctx):
    await ctx.respond(f"Pong! Latency is {bot.latency}")

bot.run("TOKEN")

And I get this error:

AttributeError: module 'discord' has no attribute 'Bot'```
gentle egret
#

um

#

pip install git+https://github.com/Pycord-Development/pycord I reinstalled pycord with this command

#

and now get this error

#
Traceback (most recent call last):
  File "c:\Users\intel\Desktop\NexShop\bot\main.py", line 1, in <module>
    import discord
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\__init__.py", line 33, in <module>
    from .bot import *
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\bot.py", line 40, in <module>
    from .cog import CogMixin
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\cog.py", line 38, in <module>
    from .commands import (
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\__init__.py", line 26, in <module>
    from .context import *
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\context.py", line 68, in <module> 
    class ApplicationContext(discord.abc.Messageable):
  File "C:\Users\intel\AppData\Local\Programs\Python\Python310\lib\site-packages\discord\commands\context.py", line 347, in ApplicationContext
    @discord.utils.copy_doc(Interaction.edit_original_response)
AttributeError: type object 'Interaction' has no attribute 'edit_original_response'. Did you mean: 'edit_original_message'?
PS C:\Users\intel\Desktop\NexShop\bot> 
#

?

young bone
#

uninstall it and use py-cord==2.3.2

gentle egret
#

one sec

#

run this: pip install py-cord==2.3.2

#

got same error

young bone
gentle egret
#
Package                  Version
------------------------ -------------------
aiohttp                  3.8.1
aiosignal                1.2.0
aiosqlite                0.17.0
asttokens                2.2.1
async-timeout            4.0.2
asyncio                  3.4.3
attrs                    21.4.0
backcall                 0.2.0
beautifulsoup4           4.11.1
Brotli                   1.0.9
certifi                  2022.6.15
cffi                     1.15.0
chardet                  4.0.0
charset-normalizer       2.0.12
colorama                 0.4.6
databases                0.6.0
DateTime                 4.5
decorator                5.1.1
discord-disnake          2.1.2
discord.py               2.1.0
discord-py-interactions  3.0.2
discord-py-slash-command 4.2.1
dislevel                 2.0.3
disnake                  2.5.1
disnake-ext-components   0.3.3
easy-pil                 0.1.6
executing                1.2.0
ffmpeg-python            0.2.0
frozenlist               1.3.0
future                   0.18.2
greenlet                 1.1.2
humanfriendly            10.0
idna                     3.3
imageio-ffmpeg           0.4.7
ipython                  8.7.0
jedi                     0.18.2
matplotlib-inline        0.1.6
multidict                6.0.2
mutagen                  1.45.1
mysql-connector-python   8.0.29
nextcord                 2.1.0a4055+g6774954
nextcord-ext-ipc         2.2.1
numerize                 0.12
numpy                    1.24.1
parso                    0.8.3
pickleshare              0.7.5
Pillow                   8.4.0
pip                      22.3.1
prompt-toolkit           3.0.36
pure-eval                0.2.2
py-cord                  2.3.2
pycparser                2.21
pycryptodomex            3.14.1
pygame                   2.1.2
Pygments                 2.13.0
PyNaCl                   1.4.0
pyreadline3              3.4.1
python-dotenv            0.20.0
pytz                     2022.1
requests                 2.28.0
setuptools               58.1.0
six                      1.16.0
soupsieve                2.3.2.post1
spotipy                  2.19.0
SQLAlchemy               1.4.39
stack-data               0.6.2
traitlets                5.7.1
typing_extensions        4.2.0
urllib3                  1.26.9
wcwidth                  0.2.5
websockets               3.4
yarl                     1.7.2
yt-dlp                   2022.5.18
zope.interface           5.4.0
#

da hell

#

I promise I uninstalled all discord.pys

young bone
blissful spear
#

hmmmm... is there no event for a member joining/leaving a voice channel? Thought on_guild_channel_update is the right one.. but seems like not xD

young bone
gentle egret
#

disnake and dpy deleted

young bone
gentle egret
#

ok..

young bone
#

you have all 3 installed

#

wtf

gentle egret
#

deleted those

gentle egret
young bone
gentle egret
#

tried disnake about an year ago, and forgot about it

#

dislevel is just simple leveling module

thorny stag
#

Is there a way to check who used a slash command?

frank shale
#

Is there anything special I need to do if I add my own loop to the bot Client? I get after a while a win10054 error: An existing connection was forcibly closed by the remote host

young bone
#

?

#

the discord bot is already in a loop

frank shale
#

It doesn't make a new event loop if a loop is not provided?

young bone
#

do you see anything at the examples?

deep holly
young bone
#

oof

#

Can you show the r.txt file?

deep holly
#

how do I get that/where is it?

silver moat
deep holly
#

oh gotcha.

#

this is what I have currently

#

it's been a while since I've touched my bots so I'm not even sure if I need all of them or not but haven't touched it other than pycord

limber urchin
#

The requests library shouldn't be used at all with a Discord bot

deep holly
#

I know that isn't true

limber urchin
#

?tag requests

obtuse juncoBOT
#

Why you should not use the requests library for your bot
requests is a popular HTTP library for Python. It is however not a good option for Discord bots, since it is not async and blocking.

This essentially means that your bot will not be able to execute any code at all while a request is happening. Since requests usually take a few seconds to complete, this can have a detrimental effect on your bot's performance. E.g if a user executes a command that performs a request taking 5 seconds to complete, no one else will be able to use your bot for those 5 seconds.

Please look at using a HTTP library that has async support, such as aiohttp or httpx

deep holly
#

I haven't had any issues for what I used it for and it isn't related to my current issue

limber urchin
#

I know, I just noticed you had it and pointed it out. requests shouldn't be used in any async environment

#

and it comes by default with python anyways, so it doesn't need to be installed

deep holly
#

thanks for the information. I might have changed something though because I am not even importing requests in my current code anyway

cyan quail
# deep holly this is what I have currently

delete /.local/lib/python3.x/site-packages/discord (or rename it in case you want a backup) + related folders that have names like discord.py or py-cord and restart server

deep holly
#

discord.py and any other discord folder was deleted. I deleted the existing discord folder and manually created one copying everything over from the py-cord repository because they use a discord folder and I'm assuming I kind of need it because it still wasn't recognizing things.

#

and installing py-cord I don't think placed one?

cyan quail
#

wait so what happens on startup now

deep holly
#

it starts up. but that's because I put everything back to normal. my issue is I get an error saying the bot didn't respond when it did. then you guys said to change it from ctx.send to ctx.respond but then it says respond doesn't exist and so on. there's obviously some redundant discord.py or something but I can't figure it out

cyan quail
#

it would only exist in the site-packages/discord folder through .local, it won't be installed anywhere else

deep holly
deep holly
#

I didn't put it anywhere else

#

I have aiohttp, async, attr, chardet, dateutil, etc no more discord.py but

#

I guess I could request IT to like, somehow wipe everything from my cloud server so I can start with a clean plate

#

I already tried reinstalling the server itself

#

sorry in this case the error is completely gone except for now there's an error on the console I forgot. command not found but it worked fine πŸ˜… so that was the last thing I mentioned last night before taking a break

#

but I did have to switch back to commands bot and ctx.send for it to work at all

limber urchin
#

It looks like you're just using prefix commands and your prefix is /.

#

That is not how slash commands are made

deep holly
#

I know, I can't use slash_command with discord.Bot as it doesn't work at all right now

limber urchin
#

Well yeah, of course ctx.respond won't work then. That's only for actual slash commands and interactions.

deep holly
#

if I change to discord.Bot, use slash_command, and change to ctx.respond - everything breaks

#

so I'm not sure how to go from here to transition to py-cord because it's not letting me lmao

#

I'll show the example of what happens now that I've changed all those things.

limber urchin
#

In that case there's still something conflicting with py-cord, because that should work

young bone
#

could you change the git one to the pip Version?

deep holly
#

yeah, I'm frustrated with Sparked right now

limber urchin
#

what if you just used a different host? It seems pretty wack tbh

deep holly
#

because I kinda love it. I tried doing it through google and that was ..tedious and lame
this is really good but not for changing half way through the project I guess

young bone
#

And if you would use Oracle?

limber urchin
#

I would highly recommend just getting a proper VPS rather than some platform that abstractifies it all

deep holly
#

before I change the entire host I guess I should at least attempt them to just reset what I have and try that

silver moat
#

could you send the build logs?

deep holly
limber urchin
#

well, learning how to deal with a linux server environment is always beneficial imo. But yeah, I get it

deep holly
#

also ignore like all on top.... I'll get a cleaner version

deep holly
silver moat
#

at the moment, I think this is a host issue. I think the best way to get this fixed is to contact your host's support

rare ice
#

sounds like a skill issue for the host

deep holly
#

I just submitted a ticket to the host service, thank you guys for taking the time to help when there was nothing to help anyway lol

silver moat
#

no problem!

lapis raptor
#

Hey there, looking for how to get allow a user to add a channel at the end of a slash command and then send a message into that channel.

For example,
User enters:

/poll #General

Bot messages embed that is made in modal into general?

dim cape
#

Is there an event when a bot joins it msgs the owner

lapis raptor
dim cape
#

.rtfm discord.utils

silver moat
winter condorBOT
dim cape
silver moat
#

.rtfm guild.owner_id

winter condorBOT
lapis raptor
#

.rtfm default_role

winter condorBOT
lapis raptor
#

.rtfm has role

full basin
dim cape
#

Is there a way to use break() to make the command stop working

cyan quail
#

you can just return

#

break is used to exit a loop

silver moat
#

Neither break or return is a function. They are keywords

thorny stag
#

I have an embed and I have 7 fields. I want to have it so that the first line has one field and the second, third and fourth lines have 2 fields each. I've been messing around with inline but I cant seem to get it. Can anyone help?

#

||Please ping me if you respond to my question||

limber urchin
barren garnet
#

s there such thing as bot.dispatch_event() in pycord?
why doesn't my on_some_event get triggered when bot.dispatch_event("some_event", smthing) is called

limber urchin
#

dispatch_event is not a thing in pycord

barren garnet
limber urchin
#

You can look around in the docs, never used anything like it

barren garnet
#

.rtfm dispatch_event

winter condorBOT
#

Target not found, try again and make sure to check your spelling.

barren garnet
#

.rtfm event

north gorge
#

I'm trying to edit a message fairly quickly, maybe every .4 seconds, and I'm running the code that does so in a tasks.loop. Elsewhere in the bot I can get away with even quicker updates to certain games, but this one seems to get stuck for a second or two at a time and then continue the loop

#

Might it be something with how tasks.loop runs or is changing out ascii art that fast some kind of rate limit vs message size issue

north gorge
#

I guess I'm asking if tasks.loop functions are somehow lower priority and message.edits or sleeps would behave weirdly

swift pumice
#

Does anyone know if pycord works with ironpython, and what is the minimum version of python needed to run pycord?