Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@conflict/beta

Package Overview
Dependencies
Maintainers
1
Versions
117
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@conflict/beta - npm Package Compare versions

Comparing version 0.9.14 to 0.9.15

20

commands.js

@@ -57,4 +57,4 @@ import View, { Component } from './view.js'

export class InteractionResponse {
constructor (interaction, onReply = () => {}) {
this.onReply = onReply;
constructor (interaction, vercelConfig) {
this.vercelConfig = vercelConfig;
this.interaction = interaction;

@@ -142,3 +142,9 @@ if (interaction.options) {

if (ephemeral && options[0] && options[0].toString() == '[object Object]') options[0].ephemeral = true;
this.onReply?.(...options);
if (this.vercelConfig?.isVercel) {
return this.vercelConfig?.onReply?.({
type: 4,
data: options[0],
...(options[0]?.ephemeral ? { flags: 1 << 6 } : {})
});
}
return (

@@ -176,2 +182,8 @@ this.interaction.conflictThunked ?

if (!view.components) throw new Error('Missing components');
if (this.vercelConfig?.isVercel) {
return this.vercelConfig?.onReply?.({
type: 7,
data: view
});
}
return this.interaction.client.api.interactions(this.interaction.id, this.interaction.token).callback.post({ data: {

@@ -185,4 +197,4 @@ type: 9,

if (this.onReply) {
view.applyTo({ reply: (...args) => {
console.log('view!', args)
this.onReply?.(...args);

@@ -189,0 +201,0 @@ this.interaction.reply(...args);

2

package.json
{
"name": "@conflict/beta",
"version": "0.9.14",
"version": "0.9.15",
"description": "The first and only UI framework for Discord bots",

@@ -5,0 +5,0 @@ "main": "exports.js",

@@ -102,3 +102,3 @@ // dispatch.js

const result = await new Promise(async (resolve, reject) => {
const vercelOutput = await new Promise(async (resolve, reject) => {
let resolved = false;

@@ -115,6 +115,8 @@

try {
let output = await command.execute(new InteractionResponse(interaction, (...data) => {
console.log({data})
let output = await command.execute(new InteractionResponse(interaction, {
isVercel: true,
onReply: data => {
console.log({data});
if (!resolved) resolve(data);
}));
}}));
if (output instanceof Promise) output = await output;

@@ -165,8 +167,3 @@ } catch (err) {

return status(200, {
type: 4,
data: {
content: "Hello! You can debug the following data:\n\n```json\n" + JSON.stringify({ result }, null, 4).substring(0, 1900) + "\n```",
},
});
return status(200, vercelOutput);
} else {

@@ -173,0 +170,0 @@ return status(200, {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc