i have a dashboard for my discord bot hosted on my local host, when i try to use Ipc on the same machine it works fine, but when i run the bot from virtual machine(Ubuntu) and i try to run my dashboard from my current windows machine i get this error in my dashboard logs
"C:\Users\abdoo_000\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1064, in create_connection
raise exceptions[0]
File "C:\Users\abdoo_000\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 1049, in create_connection
sock = await self._connect_sock(
File "C:\Users\abdoo_000\AppData\Local\Programs\Python\Python310\lib\asyncio\base_events.py", line 960, in _connect_sock
await self.sock_connect(sock, address)
File "C:\Users\abdoo_000\AppData\Local\Programs\Python\Python310\lib\asyncio\selector_events.py", line 499, in
sock_connect
return await fut
File "C:\Users\abdoo_000\AppData\Local\Programs\Python\Python310\lib\asyncio\selector_events.py", line 534, in
_sock_connect_cb
raise OSError(err, f'Connect call failed {address}')
ConnectionRefusedError: [Errno 10061] Connect call failed ('127.0.0.1', 20000)
Command in my dashboard
@app.route("/dashboard")
@requires_authorization
async def dashboard():
user = await discord.fetch_user()
guilds = await user.fetch_guilds()
bot_guilds = await ipc_client.request("get_guilds")
common_guilds = [guild for guild in guilds if guild.id in bot_guilds]
return await render_template("dashboard.html", header_name="Dashboard", user = user , signed_in = await discord.authorized, guilds=common_guilds)
Command in my Cog file
@Server.route(name = "get_guilds")
async def get_bot_guilds(self, data: ClientPayload):
guilds = [guild.id for guild in self.bot.guilds]
return guilds