Spaces:
Runtime error
Runtime error
Update server.js
Browse files
server.js
CHANGED
|
@@ -440,7 +440,9 @@ app.get('/api/config/:guildId', requireAuth, (req, res) => {
|
|
| 440 |
autoFriendlyInterval: config.autoFriendlyInterval || 40,
|
| 441 |
autoFriendlyChannel: config.autoFriendlyChannel || null,
|
| 442 |
postEnabled: !!config.postEnabled, // Default to false (off)
|
| 443 |
-
postChannelId: config.postChannelId || null
|
|
|
|
|
|
|
| 444 |
});
|
| 445 |
});
|
| 446 |
|
|
@@ -458,7 +460,7 @@ app.get('/api/channels/:guildId', requireAuth, (req, res) => {
|
|
| 458 |
|
| 459 |
app.post('/api/config/:guildId', requireAuth, (req, res) => {
|
| 460 |
const { guildId } = req.params;
|
| 461 |
-
const { prefix, autoFriendlyEnabled, autoFriendlyInterval, autoFriendlyChannel, postEnabled, postChannelId } = req.body;
|
| 462 |
const userGuilds = req.dashSession.guilds || [];
|
| 463 |
const ug = userGuilds.find(g => g.id === guildId);
|
| 464 |
|
|
@@ -480,6 +482,8 @@ app.post('/api/config/:guildId', requireAuth, (req, res) => {
|
|
| 480 |
if (autoFriendlyChannel !== undefined) storage.data.config[guildId].autoFriendlyChannel = autoFriendlyChannel;
|
| 481 |
if (postEnabled !== undefined) storage.data.config[guildId].postEnabled = !!postEnabled;
|
| 482 |
if (postChannelId !== undefined) storage.data.config[guildId].postChannelId = postChannelId;
|
|
|
|
|
|
|
| 483 |
|
| 484 |
storage.save('config');
|
| 485 |
res.json({ success: true, message: 'Settings updated successfully' });
|
|
|
|
| 440 |
autoFriendlyInterval: config.autoFriendlyInterval || 40,
|
| 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 |
|
| 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 |
|
|
|
|
| 482 |
if (autoFriendlyChannel !== undefined) storage.data.config[guildId].autoFriendlyChannel = autoFriendlyChannel;
|
| 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' });
|