Type error in types\role.py #1

Closed
opened 2026-02-15 23:16:10 -05:00 by yindo · 1 comment
Owner

Originally created by @DivyamChadha on GitHub (Aug 31, 2021).

Summary

Line 5 in types/role.py raises Type Error

Traceback

Traceback (most recent call last):
  File "c:/Users/Divyam/Desktop/Revlot/revolt.py/test.py", line 1, in <module>
    import revolt
  File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\__init__.py", line 3, in <module>
    from .client import Client
  File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\client.py", line 10, in <module>
    from .websocket import WebsocketHandler
  File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\websocket.py", line 7, in <module>
    from .types import Message as MessagePayload
  File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\types\__init__.py", line 8, in <module>
    from .role import *
  File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\types\role.py", line 5, in <module>
    Permission = tuple[int, int]
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())
Originally created by @DivyamChadha on GitHub (Aug 31, 2021). ## Summary [Line 5](https://github.com/Zomatree/revolt.py/blob/cdda2e6d7db1d76112df74da800c0fbc3af0960e/revolt/types/role.py#L5) in types/role.py raises Type Error ## Traceback ``` Traceback (most recent call last): File "c:/Users/Divyam/Desktop/Revlot/revolt.py/test.py", line 1, in <module> import revolt File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\__init__.py", line 3, in <module> from .client import Client File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\client.py", line 10, in <module> from .websocket import WebsocketHandler File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\websocket.py", line 7, in <module> from .types import Message as MessagePayload File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\types\__init__.py", line 8, in <module> from .role import * File "c:\Users\Divyam\Desktop\Revlot\revolt.py\revolt\types\role.py", line 5, in <module> Permission = tuple[int, int] TypeError: 'type' object is not subscriptable ``` ## Minimum reproducible code ```py 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()) ```
yindo closed this issue 2026-02-15 23:16:10 -05:00
Author
Owner

@Zomatree commented on GitHub (Aug 31, 2021):

Python 3.9 is the minimum supported version.

@Zomatree commented on GitHub (Aug 31, 2021): Python 3.9 is the minimum supported version.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: stoatchat/python-client-sdk#1