-
Notifications
You must be signed in to change notification settings - Fork 37
Closed
Description
Summary
Line 35 of server.py raises Type Error
Note: This is visible after applying fix for #1
Traceback
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<WebsocketHandler.handle_event() done, defined at c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\websocket.py:57> exception=TypeError("'type' object is not subscriptable")>
Traceback (most recent call last):
File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\websocket.py", line 66, in handle_event
await func(payload)
File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\websocket.py", line 76, in handle_ready
self.state.add_server(server)
File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\state.py", line 66, in add_server
server = Server(payload, self)
File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\server.py", line 35, in __init__
channels = cast(list[Channel], list(filter(bool, [state.get_channel(channel_id) for channel_id in data["channels"]])))
TypeError: 'type' object is not subscriptable
Minimum reproducible code
import revolt
import asyncio
import aiohttp
class Client(revolt.Client):
async def on_message(self, message: revolt.Message):
if message.content == "hello":
await message.channel.send("hi how are you")
async def main():
async with aiohttp.ClientSession() as session:
client = Client(session, "TOKEN")
await client.start()
asyncio.run(main())Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels