mirror of
https://github.com/AsgardEternal/SquadJS.git
synced 2024-09-28 17:34:25 -05:00
Add different colors for each chat type in discord-chat
This commit is contained in:
parent
2381af93bd
commit
70b5950fb1
@ -25,7 +25,8 @@ await discordChat(
|
||||
'discordChannelID',
|
||||
{ // options - the options included below display the defaults and can be removed for simplicity.
|
||||
ignoreChats: ['ChatSquad', 'ChatAdmin'], // an array of chats to not display.
|
||||
color: 16761867 // color of embed
|
||||
color: 16761867, // color of embed
|
||||
chatColors: { 'ChatAll': 16761867 } // change the color of chat types individually. Defaults to color above if not specified.
|
||||
}
|
||||
);
|
||||
```
|
||||
|
@ -11,6 +11,9 @@ export default async function(server, discordClient, channelID, options = {}) {
|
||||
const ignoreChats = options.ignoreChats || ['ChatSquad', 'ChatAdmin'];
|
||||
|
||||
options = {
|
||||
chatColors: {
|
||||
...options.chatColors
|
||||
},
|
||||
color: 16761867,
|
||||
...options
|
||||
};
|
||||
@ -25,7 +28,7 @@ export default async function(server, discordClient, channelID, options = {}) {
|
||||
channel.send({
|
||||
embed: {
|
||||
title: info.chat,
|
||||
color: options.color,
|
||||
color: options.chatColors[info.chat] || options.color,
|
||||
fields: [
|
||||
{
|
||||
name: 'Player',
|
||||
|
Loading…
Reference in New Issue
Block a user