Update backend, DB, Commands, Live Reloading
This commit is contained in:
@@ -22,6 +22,15 @@ module.exports = {
|
||||
});
|
||||
if (resp.ok) {
|
||||
await interaction.reply({ content: `Added ${username} to watch list.`, flags: 64 });
|
||||
// Refresh cached settings from backend so watcher sees new user immediately
|
||||
try {
|
||||
const settingsResp = await fetch(`${backendBase}/api/servers/${interaction.guildId}/settings`);
|
||||
if (settingsResp.ok) {
|
||||
const json = await settingsResp.json();
|
||||
const bot = require('..');
|
||||
if (bot && bot.setGuildSettings) bot.setGuildSettings(interaction.guildId, json);
|
||||
}
|
||||
} catch (_) {}
|
||||
} else {
|
||||
await interaction.reply({ content: 'Failed to add user via backend.', flags: 64 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user