From 04b259cf567c39a36eba4916905bda07f0c47c30 Mon Sep 17 00:00:00 2001 From: Baipyrus Date: Mon, 29 Jan 2024 15:00:30 +0100 Subject: [PATCH] implement database access for self roles --- commands/admin/self_roles.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/commands/admin/self_roles.js b/commands/admin/self_roles.js index 49fa8a0..a84703d 100644 --- a/commands/admin/self_roles.js +++ b/commands/admin/self_roles.js @@ -1,4 +1,5 @@ import { SlashCommandBuilder } from 'discord.js'; +import { Message, RoleEmojiPair } from './../../database.js'; export const data = new SlashCommandBuilder() .setName('self_roles') @@ -84,10 +85,15 @@ export async function execute(interaction) { content: 'Added new entry for self roles!', ephemeral: true, }); + + RoleEmojiPair.create({ message: id, role: role.id, emoji }); + console.debug(`[DEBUG] Added new entry to get role with ID '${role.id}' using '${emoji}'.`); break; } - if (createNew) + if (createNew) { console.debug(`[DEBUG] New self roles on message with ID: '${id}'.`); + Message.create({ id }); + } }