Skip to content

Commit 26a2f14

Browse files
author
Jacob Fear
committed
Adding Variables and LocalChat Event
1 parent 3d37ca6 commit 26a2f14

File tree

4 files changed

+35
-1
lines changed

4 files changed

+35
-1
lines changed

SLevents/ChatEvent.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
/* eslint-disable no-unused-vars */
2+
const { permlevel,
3+
} = require('../modules/functions.js');
4+
const config = require('../config.js');
5+
const nmv = require('@caspertech/node-metaverse');
6+
const { MessageEmbed, WebhookClient } = require('discord.js');
7+
// The MESSAGE event runs anytime a message is received
8+
// Note that due to the binding of client to every event, every event
9+
// goes `client, other, args` when this function is run.
10+
11+
const { UUID } = nmv.UUID;
12+
module.exports = async (client, ChatEvent) => {
13+
const SLbot = client.container.SLbot;
14+
const currentBot = process.env.SL_FIRSTNAME + ' ' + process.env.SL_LASTNAME;
15+
16+
};

SLevents/GroupChat.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable no-shadow */
12
/* eslint-disable no-unused-vars */
23
const { permlevel,
34
} = require('../modules/functions.js');

config.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,23 @@ const config = {
1414

1515
// //// This maps inworld group UUIDs to Discord Channels.
1616
relays: new Map([
17-
["1b6af450-96e2-8fad-291c-74fc4928f0b1", "1176644698027331745"]
17+
['1b6af450-96e2-8fad-291c-74fc4928f0b1', '1176644698027331745'],
1818
]),
1919
// Array of SL UUIDs to Ignore and not relay, say if you have a bot that regularly posts in group chat or something.
2020
'ignored': ['49d6a705-de90-4458-b166-ccf56401053c'],
2121
/*
22+
23+
24+
Settings for local chat relay
25+
*/
26+
// Enable Local Chat Relay
27+
'relayLocal': true,
28+
29+
// Discord Channel to Relay to
30+
'relayChannel': '1176658491239305266',
31+
/*
32+
33+
2234
* Intents the bot needs.
2335
* By default GuideBot needs Guilds and Guild Messages to work.
2436
*/

index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ client.container = {
5050
};
5151

5252
const GroupChatEventHandler = require('./SLevents/GroupChat.js');
53+
const ChatEventHandler = require('./SLevents/ChatEvent.js');
5354

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

7677
});
78+
client.container.SLbot.clientEvents.onNearbyChat.subscribe((eventInfo) => {
79+
ChatEventHandler(client, eventInfo);
80+
81+
});
7782

7883

7984
}).catch((error) => {

0 commit comments

Comments
 (0)