cordo 2.9.3 → 2.9.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cordo",
3
- "version": "2.9.3",
3
+ "version": "2.9.5",
4
4
  "description": "A framework for handling complex discord api interactions",
5
5
  "exports": {
6
6
  ".": "./src/index.ts",
@@ -80,12 +80,20 @@ export namespace CordoGateway {
80
80
  return null
81
81
  }
82
82
 
83
+ if (!internals.answered) {
84
+ if (payload)
85
+ return apiRequest('post', `/interactions/${i.id}/${i.token}/callback`, payload)
86
+
87
+ if (i.type === InteractionType.ApplicationCommand)
88
+ return apiRequest('post', `/interactions/${i.id}/${i.token}/callback`, { type: InteractionResponseType.DeferredChannelMessageWithSource })
89
+
90
+ if (i.type === InteractionType.MessageComponent)
91
+ return apiRequest('post', `/interactions/${i.id}/${i.token}/callback`, { type: InteractionResponseType.DeferredMessageUpdate })
92
+ }
93
+
83
94
  if (!payload)
84
95
  return null
85
96
 
86
- if (!internals.answered)
87
- return apiRequest('post', `/interactions/${i.id}/${i.token}/callback`, payload)
88
-
89
97
  const { type, data } = payload
90
98
  if (!type || !data)
91
99
  return null
@@ -157,7 +157,9 @@ export namespace RoutingRespond {
157
157
  has: (key: string) => key in interaction.locals
158
158
  },
159
159
 
160
- ack: opts.disableRendering ? noOp : () => CordoGateway.respondTo(interaction, null),
160
+ ack: opts.disableRendering ? noOp : () => {
161
+ CordoGateway.respondTo(interaction, null)
162
+ },
161
163
  render: opts.disableRendering ? noOp : (...response) => {
162
164
  const rendered = renderRouteResponse(response, interaction, opts)
163
165
  CordoGateway.respondTo(interaction, rendered)