Skip to content

Commit 7bd3373

Browse files
committed
fix!: application command type returning None
1 parent e2852d1 commit 7bd3373

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

CONTRIBUTING.rst

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ for us to log certain events and procedures internally that may happen before, d
1818
error may be produced:
1919

2020
.. code-block:: python
21-
:linenos:
2221
2322
import interactions
2423
from logging import DEBUG

interactions/models/misc.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,11 @@ class InteractionData(DictSerializerMixin):
100100

101101
def __init__(self, **kwargs):
102102
super().__init__(**kwargs)
103-
self.type = ApplicationCommandType(self.type) if self._json.get("type") else None
103+
if self._json.get("type"):
104+
self.type = ApplicationCommandType(self.type)
105+
self._json.update({"type": self.type.value})
106+
else:
107+
self.type = 0
104108
self.resolved = (
105109
InteractionResolvedData(**self.resolved) if self._json.get("resolved") else None
106110
)
@@ -115,7 +119,6 @@ def __init__(self, **kwargs):
115119
if self._json.get("component_type"):
116120
self.component_type = ComponentType(self.component_type)
117121
self._json.update({"component_type": self.component_type.value})
118-
self._json.update({"type": self.type.value})
119122

120123

121124
class Interaction(DictSerializerMixin):

0 commit comments

Comments
 (0)