Skip to content

Guild.owner_id type mismatch between docs and code. #1270

Open
@dlchamp

Description

@dlchamp

Summary

Guild.owner_id documented as int, but is Optional[int] in code

Reproduction Steps

Declare return type as int and try to return owner_id. Strict type checking enabled in vscode.

Minimal Reproducible Code

def get_guild_owner_id(guild: disnake.Guild) -> int:
    return guild.owner_id

Expected Results

I expect owner_id to always be an int, otherwise, update the documentation to show it can also be None

Actual Results

Got an error because int | None doesn't match a return type of int

Type "int | None" is not assignable to return type "int"
  Type "int | None" is not assignable to type "int"
    "None" is not assignable to "int"Pylance[reportReturnType](https://github.com/microsoft/pyright/blob/main/docs/configuration.md#reportReturnType)

Intents

All, while testing

System Information

- Python v3.12.4-final
- disnake v2.10.1-final
    - disnake importlib.metadata: v2.10.1
- aiohttp v3.11.11
- system info: Windows 11 10.0.22631 AMD64

Checklist

  • I have searched the open issues for duplicates.
  • I have shown the entire traceback, if possible.
  • I have removed my token from display, if visible.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    unconfirmed bugSomething might not be working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions