Skip to content

Commit

Permalink
Adding Variables and LocalChat Event
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Fear committed Nov 22, 2023
1 parent 3d37ca6 commit 26a2f14
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 1 deletion.
16 changes: 16 additions & 0 deletions SLevents/ChatEvent.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/* eslint-disable no-unused-vars */
const { permlevel,
} = require('../modules/functions.js');
const config = require('../config.js');
const nmv = require('@caspertech/node-metaverse');
const { MessageEmbed, WebhookClient } = require('discord.js');
// The MESSAGE event runs anytime a message is received
// Note that due to the binding of client to every event, every event
// goes `client, other, args` when this function is run.

const { UUID } = nmv.UUID;
module.exports = async (client, ChatEvent) => {
const SLbot = client.container.SLbot;
const currentBot = process.env.SL_FIRSTNAME + ' ' + process.env.SL_LASTNAME;

};
1 change: 1 addition & 0 deletions SLevents/GroupChat.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable no-shadow */
/* eslint-disable no-unused-vars */
const { permlevel,
} = require('../modules/functions.js');
Expand Down
14 changes: 13 additions & 1 deletion config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,23 @@ const config = {

// //// This maps inworld group UUIDs to Discord Channels.
relays: new Map([
["1b6af450-96e2-8fad-291c-74fc4928f0b1", "1176644698027331745"]
['1b6af450-96e2-8fad-291c-74fc4928f0b1', '1176644698027331745'],
]),
// Array of SL UUIDs to Ignore and not relay, say if you have a bot that regularly posts in group chat or something.
'ignored': ['49d6a705-de90-4458-b166-ccf56401053c'],
/*
Settings for local chat relay
*/
// Enable Local Chat Relay
'relayLocal': true,

// Discord Channel to Relay to
'relayChannel': '1176658491239305266',
/*
* Intents the bot needs.
* By default GuideBot needs Guilds and Guild Messages to work.
*/
Expand Down
5 changes: 5 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ client.container = {
};

const GroupChatEventHandler = require('./SLevents/GroupChat.js');
const ChatEventHandler = require('./SLevents/ChatEvent.js');

// We're doing real fancy node 8 async/await stuff here, and to do that
// we need to wrap stuff in an anonymous function. It's annoying but it works.
Expand All @@ -74,6 +75,10 @@ const init = async () => {
GroupChatEventHandler(client, eventInfo);

});
client.container.SLbot.clientEvents.onNearbyChat.subscribe((eventInfo) => {
ChatEventHandler(client, eventInfo);

});


}).catch((error) => {
Expand Down

0 comments on commit 26a2f14

Please sign in to comment.