Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ typings/
.env

/.vscode/

config.js
5 changes: 5 additions & 0 deletions config.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,16 @@ const config = {
]),
// 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
*/

// Use Display Names?
'enableDisplayNames': true,
// Enable Local Chat Relay
'relayLocal': true,

Expand Down
175 changes: 81 additions & 94 deletions config.js.example
Original file line number Diff line number Diff line change
@@ -1,113 +1,100 @@
const { Intents } = require("discord.js");
const { GatewayIntentBits } = require('discord.js');

/* config */
const config = {
// Bot Admins, level 9 by default. Array of user ID strings.
"admins": [],

// Bot Support, level 8 by default. Array of user ID strings
"support": [],
// To be implemented, fallback regions if the .env main region can't be reached.
fallbackRegions: new Map([
["regioname", "uri"]
]),

////// 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
]),
// Array of SL UUIDs to Ignore and not relay, say if you have a bot that regularly posts in group chat or something.
"ignored": [],
/*
// Bot Admins, level 9 by default. Array of user ID strings.
'admins': ["478280993422442497"],

// Bot Support, level 8 by default. Array of user ID strings
'support': [],
// To be implemented, fallback regions if the .env main region can't be reached.
fallbackRegions: new Map([
['regioname', 'uri'],
]),

// //// This maps inworld group UUIDs to Discord Channels.
relays: new Map([
["e38d0caa-2b71-031a-3e1b-4abe1a22e8f3", "1411469523856396359"] // Red Robot Main Group (Client: dark.nebula)

]),
// 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
*/

// Use Display Names?
'enableDisplayNames': true,
// Enable Local Chat Relay
'relayLocal': true,

// Discord Channel to Relay to
'relayChannel': '1176658491239305266',
/*


* Intents the bot needs.
* By default GuideBot needs Guilds, Guild Messages and Direct Messages to work.
* For join messages to work you need Guild Members, which is privileged and requires extra setup.
* For more info about intents see the README.
*/
intents: [ Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES ],
// Partials your bot may need should go here, CHANNEL is required for DM's
partials: ["CHANNEL"],

/*
* Default per-server settings. These settings are entered in a database on first load,
* And are then completely ignored from this file. To modify default settings, use the `conf` command.
* DO NOT REMOVE THIS BEFORE YOUR BOT IS LOADED AND FUNCTIONAL.
* By default GuideBot needs Guilds and Guild Messages to work.
*/
"defaultSettings" : {
"prefix": "~",
"systemNotice": "true", // This gives a notice when a user tries to run a command that they do not have permission to use.
},

// PERMISSION LEVEL DEFINITIONS.

permLevels: [
// This is the lowest permission level, this is for users without a role.
{ level: 0,
name: "User",
/*
intents: [ GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent ],
// Partials your bot may need should go here, CHANNEL is required for DM's
partials: ['CHANNEL'],


// PERMISSION LEVEL DEFINITIONS.

permLevels: [
// This is the lowest permission level, this is for users without a role.
{ level: 0,
name: 'User',
/*
* Don't bother checking, just return true which allows them to execute any command their
* level allows them to.
*/
check: () => true
},
//// Level 3 and Level 2 Perm Levels reserved for Moderator and Administrator roles if ever needed.

// This is the server owner.
{ level: 4,
name: "Server Owner",
/*
check: () => true,
},

// This is the server owner.
{ level: 1,
name: 'Server Owner',
/*
* Simple check, if the guild owner id matches the message author's ID, then it will return true.
* Otherwise it will return false.
*/
check: (message) => {
const serverOwner = message.author ?? message.user;
return message.guild?.ownerId === serverOwner.id;
}
},

/*
* Bot Support is a special in between level that has the equivalent of server owner access
* to any server they joins, in order to help troubleshoot the bot on behalf of owners.
*/
{ level: 8,
name: "Bot Support",
// The check is by reading if an ID is part of this array. Yes, this means you need to
// change this and reboot the bot to add a support user. Make it better yourself!
check: (message) => {
const botSupport = message.author ?? message.user;
return config.support.includes(botSupport.id);
}
},

// Bot Admin has some limited access like rebooting the bot or reloading commands.
{ level: 9,
name: "Bot Admin",
check: (message) => {
const botAdmin = message.author ?? message.user;
return config.admins.includes(botAdmin.id);
}
},

/*
check: (message) => {
const serverOwner = message.author ?? message.user;
return message.guild?.ownerId === serverOwner.id;
},
},

// Bot Admin has some limited access like rebooting the bot or reloading commands.
{ level: 2,
name: 'Bot Admin',
check: (message) => {
const botAdmin = message.author ?? message.user;
return config.admins.includes(botAdmin.id);
},
},

/*
* This is the bot owner, this should be the highest permission level available.
* The reason this should be the highest level is because of dangerous commands such as eval
* or exec (if the owner has that).
* Updated to utilize the Teams type from the Application, pulls a list of "Owners" from it.
*/
{ level: 10,
name: "Bot Owner",
// Another simple check, compares the message author id to a list of owners found in the bot application.
check: (message) => {
const owner = message.author ?? message.user;
return owner.id === process.env.OWNER;
}
}
]
{ level: 10,
name: 'Bot Owner',
// Another simple check, compares the message author id to a list of owners found in the bot application.
check: (message) => {
const owner = message.author ?? message.user;
return owner.id === process.env.OWNER;
},
},
],
};

module.exports = config;