@conflict/beta
Advanced tools
Comparing version 0.8.16 to 0.8.17
{ | ||
"name": "@conflict/beta", | ||
"version": "0.8.16", | ||
"version": "0.8.17", | ||
"description": "The first and only UI framework for Discord bots", | ||
@@ -5,0 +5,0 @@ "main": "exports.js", |
// dispatch.js | ||
// Handles Discord interaction only; a complete level of abstraction above the server. | ||
import DiscordInteractions from 'discord-interactions'; | ||
const { | ||
@@ -8,8 +9,7 @@ InteractionResponseType, | ||
verifyKey, | ||
} = require("discord-interactions"); | ||
} = DiscordInteractions; | ||
const path = require('path'); | ||
import path from 'path'; | ||
const Discord = require('discord.js'); | ||
import Discord from 'discord.js'; | ||
const { | ||
@@ -27,3 +27,5 @@ AutocompleteInteraction, | ||
const { all } = require('./commands.json'); | ||
import fs from 'fs'; | ||
const { all } = JSON.parse(fs.readFileSync('commands.json', 'utf8')); | ||
const commands = all; | ||
@@ -48,3 +50,3 @@ | ||
module.exports.dispatch = async (message) => { | ||
export default async function (message) { | ||
if (message.type === InteractionType.APPLICATION_COMMAND) { | ||
@@ -51,0 +53,0 @@ const data = message; |
// Code for running on Vercel. Not part of Conflict server or Conflict build scripts. | ||
import DiscordInteractions from 'discord-interactions'; | ||
const { | ||
@@ -8,5 +9,5 @@ InteractionResponseType, | ||
verifyKey, | ||
} = require("discord-interactions"); | ||
} = DiscordInteractions; | ||
const { dispatch } = require('./dispatch.js'); | ||
import dispatch from './dispatch.js'; | ||
@@ -13,0 +14,0 @@ module.exports = async (request, response) => { |
@@ -35,2 +35,3 @@ // Compile .conflict/build to public/api/index.js for Vercel deployment | ||
fs.writeFileSync(path.join(process.cwd(), '.vercel', 'output', 'functions', 'discord.func', 'dispatch.js'), fs.readFileSync(path.join(__dirname, 'vercel-kit', 'dispatch.js'), 'utf8'), 'utf8'); | ||
fs.writeFileSync(path.join(process.cwd(), '.vercel', 'output', 'functions', 'discord.func', 'package.json'), fs.readFileSync(path.join(__dirname, 'vercel-kit', 'package.json'), 'utf8'), 'utf8'); | ||
@@ -66,3 +67,3 @@ stump.info('Generated core files'); | ||
i++; | ||
} | ||
@@ -69,0 +70,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
86755
46
2244
30