Feat: Adding GUILDS! #12

Merged
snxraven merged 21 commits from guilds into main 2024-07-07 23:01:33 -04:00
2 changed files with 11 additions and 11 deletions
Showing only changes of commit aa70e42fdc - Show all commits

2
app.js
View File

@ -1163,7 +1163,7 @@ async function sendMessage(e) {
const timestamp = Date.now(); const timestamp = Date.now();
console.log("Sending message to current topic:", topic); // Add logging console.log("Sending message to current topic:", topic); // Add logging
if (message.startsWith('~')) { if (message.startsWith('>')) {
await handleCommand(message, { await handleCommand(message, {
eventEmitter, eventEmitter,
currentTopic: topic, // Pass the current topic as a string currentTopic: topic, // Pass the current topic as a string

View File

@ -23,33 +23,33 @@ export default async function handleCommand(command, context) {
console.log("Current topic:", currentTopic); // Add logging to check the current topic console.log("Current topic:", currentTopic); // Add logging to check the current topic
switch (cmd) { switch (cmd) {
case '~clear': case '>clear':
clearMessages(currentTopic); clearMessages(currentTopic);
break; break;
case '~ping': case '>ping':
addMessage('LinkUp', 'pong', agentAvatar, currentTopic); addMessage('LinkUp', 'pong', agentAvatar, currentTopic);
break; break;
case '~help': case '>help':
addMessage('LinkUp', 'Available commands:\n- ~clear\n- ~ping\n- ~help\n- ~join [topic]\n- ~leave\n- ~create [alias]\n- ~list-files', agentAvatar, currentTopic); addMessage('LinkUp', 'Available commands:\n- >clear\n- >ping\n- >help\n- >join [topic]\n- >leave\n- >create [alias]\n- >list-files', agentAvatar, currentTopic);
break; break;
case '~join': case '>join':
if (restArgs) { if (restArgs) {
await joinRoom(currentTopic, restArgs); await joinRoom(currentTopic, restArgs);
} else { } else {
addMessage('LinkUp', 'Usage: ~join [topic]', agentAvatar, currentTopic); addMessage('LinkUp', 'Usage: >join [topic]', agentAvatar, currentTopic);
} }
break; break;
case '~leave': case '>leave':
leaveRoom(currentTopic); leaveRoom(currentTopic);
break; break;
case '~create': case '>create':
if (restArgs) { if (restArgs) {
await createRoom(currentTopic, restArgs); await createRoom(currentTopic, restArgs);
} else { } else {
addMessage('LinkUp', 'Usage: ~create [alias]', agentAvatar, currentTopic); addMessage('LinkUp', 'Usage: >create [alias]', agentAvatar, currentTopic);
} }
break; break;
case '~list-files': case '>list-files':
const files = await listFiles(); const files = await listFiles();
const fileList = files.length > 0 ? files.map(file => `- ${file}`).join('\n') : 'No files available'; const fileList = files.length > 0 ? files.map(file => `- ${file}`).join('\n') : 'No files available';
addMessage('LinkUp', `Available files:\n${fileList}`, agentAvatar, currentTopic); addMessage('LinkUp', `Available files:\n${fileList}`, agentAvatar, currentTopic);