Skip to content

Commit

Permalink
Fixing Profile Image Errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Fear committed Nov 21, 2023
1 parent ce652b8 commit 3d37ca6
Show file tree
Hide file tree
Showing 4 changed files with 178 additions and 2,772 deletions.
12 changes: 6 additions & 6 deletions .env-example
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
DISCORD_TOKEN=
OWNER=
SL_FIRSTNAME=
SL_LASTNAME=
SL_PASSWORD=
SL_START=
DISCORD_TOKEN=
OWNER=
SL_FIRSTNAME=
SL_LASTNAME=
SL_PASSWORD=
SL_START=last
5 changes: 2 additions & 3 deletions SLevents/GroupChat.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ module.exports = async (client, GroupChatEvent) => {
if (GroupChatEvent.fromName === currentBot) return;
if (config.ignored.includes(GroupChatEvent.from.toString())) return;
const id = new nmv.UUID(GroupChatEvent.from);
let img = '10991f3b-980e-88d8-867a-b2670da85701';
// Default to Fox Hollow Logo
let img = 'bfc51542-be49-4595-9784-aec1e3f612dc';
// if (GroupChatEvent.groupID.toString() === config.roleplayUUID) {
if (config.relays.has(GroupChatEvent.groupID.toString())) {
try {
Expand All @@ -30,7 +29,7 @@ module.exports = async (client, GroupChatEvent) => {
if (id) {
try {
const profile = await axios.get(`http://world.secondlife.com/resident/${id}`);
img = await profile.data.split('meta name="imageid" content="')[1].split('" />')[0];
img = await profile.data.split('<meta name="imageid" content="')[1].split('">')[0];
// console.log("Image UUID Recieved: " + img);
}
catch (error) {
Expand Down
7 changes: 1 addition & 6 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,7 @@ const config = {

// //// This maps inworld group UUIDs to Discord Channels.
relays: new Map([
["SL Group UUID", "Discord Channel ID"], // For Multiple relays you need a comma after each bracket but the last one
["SL Group UUID", "Discord Channel ID"], // For Multiple relays you need a comma after each bracket but the last one
["SL Group UUID", "Discord Channel ID"], // For Multiple relays you need a comma after each bracket but the last one
["SL Group UUID", "Discord Channel ID"], // For Multiple relays you need a comma after each bracket but the last one
["SL Group UUID", "Discord Channel ID"], // For Multiple relays you need a comma after each bracket but the last one
["SL Group UUID", "Discord Channel ID"] // For Multiple relays you need a comma after each bracket but the last one
["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'],
Expand Down
Loading

0 comments on commit 3d37ca6

Please sign in to comment.