/wdd - Versão final a funcionar com mysql :)
This commit is contained in:
parent
028afde436
commit
ab48ac6220
@ -3,6 +3,7 @@ const { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, Messag
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
console.error("--------------------- teste.js ---------------------");
|
console.error("--------------------- teste.js ---------------------");
|
||||||
module.exports = {
|
module.exports = {
|
||||||
data: new SlashCommandBuilder()
|
data: new SlashCommandBuilder()
|
||||||
|
|||||||
@ -2,6 +2,7 @@
|
|||||||
const { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js');
|
const { InteractionContextType, PermissionFlagsBits, SlashCommandBuilder, MessageFlags } = require('discord.js');
|
||||||
const conn = require('../../../database/db'); // Ajusta o caminho
|
const conn = require('../../../database/db'); // Ajusta o caminho
|
||||||
|
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'interactionCreate',
|
name: 'interactionCreate',
|
||||||
async execute(interaction, client) {
|
async execute(interaction, client) {
|
||||||
@ -14,7 +15,7 @@ module.exports = {
|
|||||||
const [rows] = await conn.execute(
|
const [rows] = await conn.execute(
|
||||||
'SELECT name,value FROM choices LIMIT 25',
|
'SELECT name,value FROM choices LIMIT 25',
|
||||||
[`%${focusedValue}%`]
|
[`%${focusedValue}%`]
|
||||||
);
|
);
|
||||||
|
|
||||||
const suggestions = rows.map(row => ({
|
const suggestions = rows.map(row => ({
|
||||||
name: row.name,
|
name: row.name,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user