#AttributeError: type object 'Interaction' has no attribute 'respond'. Did you mean: 'response'?
1 messages · Page 1 of 1 (latest)
Package Version
------------------ ---------
aiohappyeyeballs 2.6.1
aiohttp 3.12.13
aiosignal 1.4.0
attrs 25.3.0
audioop-lts 0.2.1
certifi 2025.6.15
charset-normalizer 3.4.2
discord 2.3.2
discord.py 2.5.2
dotenv 0.9.9
frozenlist 1.7.0
idna 3.10
load-dotenv 0.1.0
multidict 6.6.3
mysql-connector 2.2.9
pip 25.1.1
propcache 0.3.2
py-cord 2.6.1
python-dotenv 1.1.1
requests 2.32.4
typing_extensions 4.14.1
unbelievaboat 2.2.0
urllib3 2.5.0
yarl 1.20.1
please uninstall discord, discord.py and reinstall py-cord
Now im getting:
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop
can you show that cog's code ?
can you also send the full error traceback please ?
Traceback (most recent call last):
File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 796, in _load_from_module_spec
setup(self)
~~~~~^^^^^^
File "c:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 187, in setup
bot.add_cog(Logout(bot))
~~~~~~^^^^^
File "c:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 30, in __init__
self.client = Client(os.getenv("API_TOKEN"))
~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\unbelievaboat\Client.py", line 43, in __init__
self._session: aiohttp.ClientSession = aiohttp.ClientSession()
~~~~~~~~~~~~~~~~~~~~~^^
File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\aiohttp\client.py", line 316, in __init__
loop = loop or asyncio.get_running_loop()
~~~~~~~~~~~~~~~~~~~~~~~~^^
RuntimeError: no running event loop
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "c:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 105, in <module>
load_cogs()
~~~~~~~~~^^
File "c:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 84, in load_cogs
bot.load_extension(cog)
~~~~~~~~~~~~~~~~~~^^^^^
File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 918, in load_extension
self._load_from_module_spec(spec, name)
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^
File "C:\Users\rooky\AppData\Roaming\Python\Python313\site-packages\discord\cog.py", line 801, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop
Well that seems clear to me now. That self.client that you are creating needs to be created in an async context, so for example you can do it in an on_ready.
i dont unterstand why now, because the code was working
but now its not 😦
Do you want to use discord.py or py-cord ?
py-cord
Then you probably upgraded python. While there's only a couple of issues with 3.13 on pycords side, I would't be surprised that that unbelievaboat package you're using has some issues with 3.13
Please downgrade to python 3.12 or lower
Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 1, in <module>
import discord, random, time
ModuleNotFoundError: No module named 'discord'
i have
Package Version
aiohappyeyeballs 2.6.1
aiohttp 3.12.13
aiosignal 1.4.0
attrs 25.3.0
discord 2.3.2
discord.py 2.5.2
dotenv 0.9.9
frozenlist 1.7.0
idna 3.10
load-dotenv 0.1.0
multidict 6.6.3
mysql-connector 2.2.9
pip 25.1.1
propcache 0.3.2
py-cord 2.6.1
python-dotenv 1.1.1
typing_extensions 4.14.1
unbelievaboat 2.2.0
yarl 1.20.1
please uninstall discord and discord.py
and also
.tag venv
Sometimes you want to keep libraries from polluting system installs or use a different version of libraries than the ones installed on the system. You might also not have permissions to install libraries system-wide. For this purpose, the standard library (as of Python 3.3) comes with a concept called "Virtual Environment"s to help maintain these separate versions.
The main benefit is to avoid package conflicts and unnecessary packages
Read more in the guide
so i need todo what?
Ok let's do this in an easier way. Can you first open a new terminal and in it run pip install uv
done
Alright perfect. Now go in your bot's folder and run uv venv -p 3.12 --seed
he doens't find the command
can you close and reopen that terminal ? If that still doesn't fix it please do the following instead: python -m uv venv -p 3.12 --seed
Using CPython 3.12.10 interpreter at: C:\Users\rooky\AppData\Local\Microsoft\WindowsApps\PythonSoftwareFoundation.Python.3.12_qbz5n2kfra8p0\python.exe
Creating virtual environment with seed packages at: .venv
- pip==25.1.1
Activate with: .venv\Scripts\activate
he cant find the command
huh
Oh mb activate should be capitalized
.venv\Scripts\Activate
just paste that in the terminal in your bot's directory
i do that but i get the following error:
.venv\Scripts\Activate : Die Datei "C:\Coding Projekte\discord\wpBot\.venv\Scripts\activate.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden
Sie unter "about_Execution_Policies" (https:/go.microsoft.com/fwlink/?LinkID=135170).
In Zeile:1 Zeichen:1
+ .venv\Scripts\Activate
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Sicherheitsfehler: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Oh you need to enable the thingy
wait 1 sec imma find the command
run this Unblock-File .venv\Scripts\Activate.ps1
done
then the same command as before
ths one
.venv\Scripts\Activate : Die Datei "C:\Coding Projekte\discord\wpBot\.venv\Scripts\activate.ps1" kann nicht geladen werden, da die Ausführung von Skripts auf diesem System deaktiviert ist. Weitere Informationen finden
Sie unter "about_Execution_Policies" (https:/go.microsoft.com/fwlink/?LinkID=135170).
In Zeile:1 Zeichen:1
+ .venv\Scripts\Activate
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : Sicherheitsfehler: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process run this and then that command above again
it worked
Its still showing me the same error:
Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 1, in <module>
import discord, random, time
ModuleNotFoundError: No module named 'discord'
How are your running your bot ? Make sure you are running it from the same terminal you opened and you ran the other commands in.
Now im getting this error again:
Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 796, in _load_from_module_spec
setup(self)
File "C:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 187, in setup
bot.add_cog(Logout(bot))
^^^^^^^^^^^
File "C:\Coding Projekte\discord\wpBot\cogs\data_rs\logout_system.py", line 30, in __init__
self.client = Client(os.getenv("API_TOKEN"))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\unbelievaboat\Client.py", line 43, in __init__
self._session: aiohttp.ClientSession = aiohttp.ClientSession()
^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\aiohttp\client.py", line 316, in __init__
loop = loop or asyncio.get_running_loop()
^^^^^^^^^^^^^^^^^^^^^^^^^^
RuntimeError: no running event loop
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 105, in <module>
load_cogs()
File "C:\Coding Projekte\discord\wpBot\wp_bot_main.py", line 84, in load_cogs
bot.load_extension(cog)
File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 918, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Coding Projekte\discord\wpBot\.venv\Lib\site-packages\discord\cog.py", line 801, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.errors.ExtensionFailed: Extension 'cogs.data_rs.logout_system' raised an error: RuntimeError: no running event loop
Ok. Can you try changing your code as follows:
class Logout(commands.Cog):
def __init__(self, bot: discord.Bot):
load_dotenv()
self.bot = bot
- self.client = Client(os.getenv("API_TOKEN"))
+ self.client: Client = None
self.master_url = "https://unbelievaboat.com/api/v1/guilds/"
+ @commands.Cog.listener()
+ async def on_ready(self) -> None:
+ self.client = Client(os.getenv("API_TOKEN"))
but why its now so weird
i dont rally unterstand why my code before is not working anymore
Either you switched from discord.py to py-cord or unbelievaboat made some update
this is py-cord right?
I'd hope so if the server name is Pycord
yes
I mean the Code
Whats the diffrences between this two?
different libraries
what even is the Client you're using here
because discord also has a Client
idk some api theyre using
nah not the same
so you might have imported the wrong thing
from unbelievaboat import Client
I know why
discord.py uses async cog loading so it makes sense it used to work with it, I assume you used it before
real issue here is unbelievaboats library tbh
bc a running loop is already ther
yea but it's highly dumb that UB doesn't just make it's own loop