Brozy123 commited on
Commit
d7b2233
·
verified ·
1 Parent(s): 6b7678a

Update server.js

Browse files
Files changed (1) hide show
  1. server.js +2 -4
server.js CHANGED
@@ -441,8 +441,7 @@ app.get('/api/config/:guildId', requireAuth, (req, res) => {
441
  autoFriendlyChannel: config.autoFriendlyChannel || null,
442
  postEnabled: !!config.postEnabled, // Default to false (off)
443
  postChannelId: config.postChannelId || null,
444
- friendlyText: config.friendlyText || "⭐▬▬▬▬▬ **FRIENDLY** ▬▬▬▬▬⭐\n🤝 Session\n🟩 I'm In\n🟥 Busy\n⭐▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬⭐\n🗳️ Needed: {needed}\n@everyone",
445
- lineupText: config.lineupText || "@everyone\n**Lineup Session Active!**"
446
  });
447
  });
448
 
@@ -460,7 +459,7 @@ app.get('/api/channels/:guildId', requireAuth, (req, res) => {
460
 
461
  app.post('/api/config/:guildId', requireAuth, (req, res) => {
462
  const { guildId } = req.params;
463
- const { prefix, autoFriendlyEnabled, autoFriendlyInterval, autoFriendlyChannel, postEnabled, postChannelId, friendlyText, lineupText } = req.body;
464
  const userGuilds = req.dashSession.guilds || [];
465
  const ug = userGuilds.find(g => g.id === guildId);
466
 
@@ -483,7 +482,6 @@ app.post('/api/config/:guildId', requireAuth, (req, res) => {
483
  if (postEnabled !== undefined) storage.data.config[guildId].postEnabled = !!postEnabled;
484
  if (postChannelId !== undefined) storage.data.config[guildId].postChannelId = postChannelId;
485
  if (friendlyText !== undefined) storage.data.config[guildId].friendlyText = friendlyText;
486
- if (lineupText !== undefined) storage.data.config[guildId].lineupText = lineupText;
487
 
488
  storage.save('config');
489
  res.json({ success: true, message: 'Settings updated successfully' });
 
441
  autoFriendlyChannel: config.autoFriendlyChannel || null,
442
  postEnabled: !!config.postEnabled, // Default to false (off)
443
  postChannelId: config.postChannelId || null,
444
+ friendlyText: config.friendlyText || "⭐▬▬▬▬▬ **FRIENDLY** ▬▬▬▬▬⭐\n🤝 Session\n🟩 I'm In\n🟥 Busy\n⭐▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬⭐\n🗳️ Needed: {needed}\n@everyone"
 
445
  });
446
  });
447
 
 
459
 
460
  app.post('/api/config/:guildId', requireAuth, (req, res) => {
461
  const { guildId } = req.params;
462
+ const { prefix, autoFriendlyEnabled, autoFriendlyInterval, autoFriendlyChannel, postEnabled, postChannelId, friendlyText } = req.body;
463
  const userGuilds = req.dashSession.guilds || [];
464
  const ug = userGuilds.find(g => g.id === guildId);
465
 
 
482
  if (postEnabled !== undefined) storage.data.config[guildId].postEnabled = !!postEnabled;
483
  if (postChannelId !== undefined) storage.data.config[guildId].postChannelId = postChannelId;
484
  if (friendlyText !== undefined) storage.data.config[guildId].friendlyText = friendlyText;
 
485
 
486
  storage.save('config');
487
  res.json({ success: true, message: 'Settings updated successfully' });