Repository: interactions-py/interactions.py

Issue:
[BUG] Class `Intents` received an invalid and unexpected value (Python 3.12.3)
### Library Version

5.11.0

### Describe the Bug

Since yesterday, my console when running the bot is filled with these messages.

I am using Python 3.12.3 on MacOS 14.4.1

Class `Intents` received an invalid and unexpected value `33026`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues


### Steps to Reproduce

1. Install Python 3.12.3
2. Run your interactions.py bot

### Expected Results

The bot should function normally and my console isn't polluted with all these errors

### Minimal Reproducible Code

_No response_

### Traceback

```bash
Class `Intents` received an invalid and unexpected value `-33027`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33028`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `4`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33032`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `8`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33040`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `16`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33056`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `32`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33088`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `64`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `128`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33280`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `512`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33792`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1024`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-34816`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `2048`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-36864`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `4096`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-40960`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `8192`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-49152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `16384`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-65536`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `65536`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-131072`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1048576`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-1179648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `2097152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-3276800`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3145728`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3211264`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3227648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3235840`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3239936`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3241984`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243008`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243520`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243712`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243744`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243760`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243768`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243772`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243773`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `33026`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33028`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `4`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33032`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `8`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33040`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `16`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33056`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `32`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33088`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `64`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `128`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33280`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `512`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-33792`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1024`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-34816`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `2048`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-36864`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `4096`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-40960`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `8192`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-49152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `16384`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-65536`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `65536`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-131072`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `1048576`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-1179648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `2097152`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `-3276800`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3145728`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3211264`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3227648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3235840`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3239936`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3241984`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243008`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243520`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243648`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243712`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243744`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243760`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243768`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243772`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `3243773`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `Intents` received an invalid and unexpected value `32768`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
GUILD intent has not been enabled; this is very likely to cause errors
Starting bot and loading exts..
All extensions are loaded!
5/5 Successfully loaded: credits, instagram, tiktok, twitter, youtube
Class `UserFlags` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `UserFlags` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `UserFlags` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `UserFlags` received an invalid and unexpected value `4194432`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
Class `ApplicationFlags` received an invalid and unexpected value `8953856`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
```

### Checklist

- [X] I have searched the open issues for duplicates.
- [X] I have shown the entire traceback, if possible.
- [X] I have removed my token from display, if visible.
- [X] I have attempted to debug this myself, and I believe this issue is with the library

### Additional Information

_No response_


Discussion:
The temporary workaround I am using for now is switching back to Python 3.11
I put a traceback on it
```py
Traceback (most recent call last):
  File "D:\Scratch\Documents\Git\June\Lib\site-packages\interactions\models\discord\enums.py", line 112, in __call__
    return super().__call__(int_value, names, module=module, qualname=qualname, type=type, start=start)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\AppData\Local\Programs\Python\Python312\Lib\enum.py", line 757, in __call__
    return cls.__new__(cls, value)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\AppData\Local\Programs\Python\Python312\Lib\enum.py", line 1179, in __new__
    raise exc
  File "C:\Users\...\AppData\Local\Programs\Python\Python312\Lib\enum.py", line 1156, in __new__
    result = cls._missing_(value)
             ^^^^^^^^^^^^^^^^^^^^
  File "C:\Users\...\AppData\Local\Programs\Python\Python312\Lib\enum.py", line 1422, in _missing_
    raise ValueError(
ValueError: (0, None) is not a valid Intents

Class `Intents` received an invalid and unexpected value `0`, a new enum item will be created to represent this value. Please update interactions.py or report this issue on GitHub - https://github.com/interactions-py/interactions.py/issues
```
There's some migration issues with using Python 3.12.x, I suggest working with 3.11.x for now. I have also found problems on my end using the newer version
This seems to be an issue with 3.12.3 specifically. We're looking into it.
Reproduced on 3.12.3, elevating issue
Will be fixed by #1658. Use Python 3.12.2 or a 3.11 version in the meantime.

Resolving patch:
diff --git a/interactions/models/discord/enums.py b/interactions/models/discord/enums.py
--- a/interactions/models/discord/enums.py
+++ b/interactions/models/discord/enums.py
@@ -103,9 +103,10 @@ def __iter__(cls) -> Iterator:
 
     def __call__(cls, value, names=None, *, module=None, qualname=None, type=None, start=1) -> "DistinctFlag":
         # To automatically convert string values into ints (eg for permissions)
+        kwargs = {"names": names} if names else {}
         try:
             int_value = int(value)
-            return super().__call__(int_value, names, module=module, qualname=qualname, type=type, start=start)
+            return super().__call__(int_value, module=module, qualname=qualname, type=type, start=start, **kwargs)
         except (TypeError, ValueError):
             return _return_cursed_enum(cls, value)
 


Test patch: