ChatControl-Red icon indicating copy to clipboard operation
ChatControl-Red copied to clipboard

Add predefined format from formats folder to be able to use in a lot of Channels.List formattings

Open MotikaCraft-TheJoshua opened this issue 1 year ago • 19 comments

Summary

So when we are defining a channel in Channels.List, we have

Channels:
<...>
  List:
    standard:
      Format: chat

There are a lot more options such as Format_Console, Format_Discord_Webhook_Name, Format_Discord, Format_Spy, etc...

For the ones i mentioned, maybe for some it is possible, but for discord format and webhook it does not work - to be able to enter "chat" where we are pulling formattings from formats/chat.yml

of course we can have separate discord_webhook_name.yml and format_discord.yml or whatever we like, but i think this would be very useful and not hard to implement

and options like hovering text and clickable will not work / be ignored if used for format which does not support it, i think there will be no problems with that at all

Thank you in advance if you consider this, much appreciated

PS. only reason i think this is needed is because formats give us PARTS and parts gives us UNLIMITED CONDITIONS to be used, and that is powerful thing, this cannot be done directly in Channels.Lists... and even if it is possible, it would be such a mess if we can add parts there - that is why we have formats and that should be utilized for as much format options in Channels.Lists as possible!

MotikaCraft-TheJoshua avatar Aug 25 '24 09:08 MotikaCraft-TheJoshua

The thing that is very messed up as of now is Format_Discord

you can use format from formats folder here, so we can use for example Format_Discord: chat-discord where formats/chat-discord.yml is used, but this only works when message is sent From Discord To Minecraft, when you try to send message from minecraft to discord, this is how it shows on discord: image

So please, change Format_Discord to 2 separate formats:

  • Format_From_Discord
  • Format_From_Minecraft

and for sure allow usage of predefined formats from formats folder for Format_From_Discord, for the Format_From_Minecraft this can also be allowed (why not?), admins just need more caution about things that will not work as they are present in minecraft and not on discord (such as text hovering/clicking...)

MotikaCraft-TheJoshua avatar Aug 25 '24 10:08 MotikaCraft-TheJoshua

I just want to show how easy it would be if Format_Discord would support linking to formats from formats folder, no need for separating into 2 formats as i mentioned above:

settings.yml

Channels:
  List:
    standard:
      Format: chat
      Format_Console: '[{luckperms_primary_group_name}] {player}&r &8>&r {luckperms_meta_chat_color}{chat_color}{chat_decoration}{message}&r'
      Discord_Channel_Id: 1234567891011121314
      Format_Discord: chat-discord

for the formats/chat.yml we have our regular chat ingame based...

formats/chat-discord.yml:

New_Line_Per_Part: false

Parts:
  From_Minecraft_To_Discord-part_1:
    Sender_Condition: '{sender_is_player}'
    Message: '{player_name} > {message}'
  From_Discord_To_Minecraft-part_1:
    Sender_Condition: '{sender_is_discord}'
    Message: '&8[&9Discord&8] &b{discordsrv_user_nickname} &8» &e{message}'

And that is everything handled, I really don't know why it's not already working like this...

MotikaCraft-TheJoshua avatar Aug 25 '24 12:08 MotikaCraft-TheJoshua

Just adding to what has already been said

It should be noted that multiple people on Discord have found the change to "Discord_Format" confusing and limiting. As seen here: image

The formatting syntax is different on Discord compared to Minecraft. For instance **{player}** on discord requires &l{player} on minecraft therefore limiting the way in which people

TheIntolerant avatar Aug 26 '24 02:08 TheIntolerant

If the reason it was changed again was that people not understanding how to format discord messages via the standard "Format" section. Would it not be best to add

Format_Minecraft_To_Discord:
Format_Discord_To_Minecraft:

instead?

TheIntolerant avatar Aug 26 '24 02:08 TheIntolerant

Agreed. I'm gonna rename it and document it in the wiki too so it's 100% clear, my bad. Leaving open when I get to this.

kangarko avatar Aug 27 '24 13:08 kangarko

Agreed. I'm gonna rename it and document it in the wiki too so it's 100% clear, my bad. Leaving open when I get to this.

Veyr nice to hear, please man, just make sure that both of the formats:

  • Format_Minecraft_To_Discord
  • Format_Discord_To_Minecraft support formats from formats/<file>.yml

Let admins simply handle this, we can use conditions for some things such as player_is_discord still and also PAPI (especially if player has linked discordSRV, i hope that CHCRED can then apply papi placeholders which do not require player to be online to be parsed)

  • in short terms: please allow formattings from format folder for both ways for CONDITIONS, i do not want to allow some players to see messages sent from discord to minecraft if they are not synced with DiscordSRV, and of course i can do this via variables in CHC, but i think you could add support for formats and then admins will handle the rest - it's obvious that you cannot check for a lot of papi placeholders there but at least you can do conditional checkings for anything that would work

Thank you so much in advance!

MotikaCraft-TheJoshua avatar Aug 27 '24 16:08 MotikaCraft-TheJoshua

Yep, I will add the two formats and check for variables if we find a linked offlineplayer account!

kangarko avatar Aug 27 '24 20:08 kangarko

Yep, I will add the two formats and check for variables if we find a linked offlineplayer account!

Very nice Just at least for Format_Discord_To_Minecraft add support for formatting from formats folder, but both discord formats supporting that would be even better

MotikaCraft-TheJoshua avatar Aug 28 '24 01:08 MotikaCraft-TheJoshua

Both options will support formats or direct input

kangarko avatar Sep 08 '24 10:09 kangarko

@kangarko can you maybe implement option to delete message if it is flagged by rules or something, because it detects properly, we then just need to use discordSRV discord bot to delete the message that is flagged? before that check if it's discord message ofc if needed check it out: image

So the message thas bot has sent was in CHCPRO previously found in handlers.yml file, i bet this message is in CHCRED somewhere but hardcoded(?) because i can't find it in any file, which should also be configurable?

This message is also ingame of course image

EDIT: Found it, sorry; it's at ChatControlRed/rules/groups.rs Sorry for making digressions

MotikaCraft-TheJoshua avatar Sep 09 '24 16:09 MotikaCraft-TheJoshua

Unfortunately I dont have time for this.

kangarko avatar Sep 09 '24 16:09 kangarko

Unfortunately I dont have time for this.

no worries man, at least formats! that's all we need:)

MotikaCraft-TheJoshua avatar Sep 09 '24 16:09 MotikaCraft-TheJoshua

Thank you and thank you for your understanding! <3

kangarko avatar Sep 09 '24 16:09 kangarko

Okay @TheIntolerant How can I achieve it right now then or do I need to wait on this update?

noaskers avatar Sep 16 '24 19:09 noaskers

Okay @TheIntolerant How can I achieve it right now then or do I need to wait on this update?

I believe it's done via the discord-format option directly in settings

TheIntolerant avatar Sep 16 '24 23:09 TheIntolerant

image

I don't want to change the way it looks in discord aswell I just want to change the way it looks when a message comes from discord.

noaskers avatar Sep 17 '24 11:09 noaskers

After version 10.27.0 the way discord formatting worked was changed as shown here image

Which is why this suggestion was made, as it has been a frequent occurrence where people were confused as to how they could format discord chat both in-game and on the discord server.

As addressed in #2698 The manner in which discord messages are formatted has proven to be more confusing than anything else as this is a common issue but unfortunately attempts at rectifying issues hasn't been effective.

Which is why I truly believe this specific suggestion is the best way to solve these issues going forward.

TheIntolerant avatar Sep 18 '24 14:09 TheIntolerant

Agreed with @TheIntolerant, we will have two distinct keys to fully customize mc>discord and discord>mc format in the next version. I will also ditch DiscordSRV to solve some oddities and improve proxy compatibility and performance, we will use the native JDA library instead.

kangarko avatar Sep 20 '24 11:09 kangarko

ETA 1 week

kangarko avatar Sep 20 '24 11:09 kangarko

Had to postpone this, new ETA is 1-2 weeks

kangarko avatar Sep 30 '24 13:09 kangarko

@kangarko not to hurry you up, just to ask what's up image

MotikaCraft-TheJoshua avatar Oct 13 '24 21:10 MotikaCraft-TheJoshua

Please follow our discord announcements :)

https://discord.com/channels/360404674219737100/375364750588248064/1295383511963926538

kangarko avatar Oct 14 '24 13:10 kangarko

Unfortunately I do not have the capacity to re-implement 90% of discordsrv features and all the placeholder and dynamic webhook creation and safety systems, so I dropped this. Just keep using discordsrv.

We will implement this ticket into v11 tho.

kangarko avatar Nov 09 '24 11:11 kangarko

Unfortunately I do not have the capacity to re-implement 90% of discordsrv features and all the placeholder and dynamic webhook creation and safety systems, so I dropped this. Just keep using discordsrv.

We will implement this ticket into v11 tho.

Can Discord(MC_to_DC) be considered a Receiver? The only problem I have encountered so far is that I can no longer hide a certain line of content in the Format when using the Format_Discord_Webhook_Name and Webhook functions.

For example, if I want to hide the player's ID in the DC to MC message and display the DC name in the DC to MC message, I can only achieve the second point. The first point cannot be achieved. In earlier versions, I could achieve this.

BearLeonLight avatar Nov 12 '24 11:11 BearLeonLight

Yes. I plan on adding two separate formats and you can use the javascript condition to show or hide them. I will rework the placeholders a bit so that it should be possible now.

kangarko avatar Nov 13 '24 11:11 kangarko

Unfortunately I do not have the capacity to re-implement 90% of discordsrv features and all the placeholder and dynamic webhook creation and safety systems, so I dropped this. Just keep using discordsrv. We will implement this ticket into v11 tho.

Can Discord(MC_to_DC) be considered a Receiver? The only problem I have encountered so far is that I can no longer hide a certain line of content in the Format when using the Format_Discord_Webhook_Name and Webhook functions.

For example, if I want to hide the player's ID in the DC to MC message and display the DC name in the DC to MC message, I can only achieve the second point. The first point cannot be achieved. In earlier versions, I could achieve this.

I use: Channels.Format_Discord: '{message}' Not used: Channels.List.Format_Discord: '{message}' The effect I want can be achieved. The two logical processing methods seem to be different. The current Channels.Format_Discord can perfectly achieve my needs~~.

BearLeonLight avatar Nov 18 '24 18:11 BearLeonLight

Using the logic before the change can achieve what I need. I hope this logic will not be changed until the remastered version of CHC is released. Channels.Format_Discord: '{message}

BearLeonLight avatar Nov 18 '24 18:11 BearLeonLight

Yeah but the split will be more customizable for other customers too. Nope, the old chatcontrol will stay the same.

kangarko avatar Nov 18 '24 19:11 kangarko

In the new one you can just use the same value for both Format_Mc_To_Discord and Format_Discord_To_Mc or whatever the keys will be named

kangarko avatar Nov 18 '24 19:11 kangarko

Finally implemented! Will come in v11

kangarko avatar Dec 04 '24 15:12 kangarko