[MOD] Smart chat [smart_chat]

Post Reply
User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

[MOD] Smart chat [smart_chat]

by Clyde » Post

Hello,

i have written a small but easy extendable chat for minetest.

Smart chat

With this mod, you have the capability:

Image
  • A lightweight mod but easy extendable.
  • Configurable about the minetest-settings.
  • A public chat, looks like the normal chat in minetest.
  • Create new channels.
  • Join or leave channels.
  • Kick people from channels.
  • Set or free channels for permanent.
  • Shows you a list of all channels.
  • can connect to IRC.
and many features more, take a look.

The chat uses the inbuild translation of minetest, so it's easy to translate it in other languages.

For Admins and Modders:

The chat has a modular system with a template modul.
There is a selfgrowing helpsystem integrated.
You remove a module, you remove it automatiycally from the config and help.
You add a module, you add it automatically in the help and config.
You can turn on and off modules in the configuration without to touch the mod itself.
Use the cmd_template to develop your own commands for the chat.
There are the privs channelmod and channeladmin, who can kick people, set's or free channels from permanent and more.

Version:
1.4

Depends:
If you use IRC, then your system need an installed lua-socket.

Source:
https://github.com/acmgit/smart_chat.git

Release: 1.4
https://github.com/acmgit/smart_chat/ar ... gs/1.4.zip

Contentdb:
https://content.minetest.net/packages/Clyde/smart_chat/

Requires:
MT 5.x

License:
GPL 3.0

Greetings, Clyde.
Last edited by Clyde on Thu Feb 17, 2022 20:47, edited 5 times in total.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

Bastrabun
Member
Posts: 211
Joined: Mon Nov 04, 2019 19:48

Re: [MOD] Smart chat [smart_chat]

by Bastrabun » Post

I'm using that mod on my server, my playersand me like it so far :)

1. Could there be a command to listen to more than one channel? Of course, you can only have one channel you write to by default, but maybe you want to listen to multiple channels like "defense", "commerce", "adminchat" and "looking_for_group" at the same time.

Something like /c listen_to [channelname] or even include that in the toggle command like this

/c t [channelname, mainchat if empty]

Of course, if you permanently want to write to another channel, you need to join that channel. Unless 2 gets implemented:

2. Could there be a shorthand command to write to the main chat, when you're in a channel?

There's already a way to also read the mainchat, but it's a bit complicated to leave, write something then join the channel again.

Something like /c for [channelname, "main" for main chat] [message]

/c all doesn't fit, this command also talks to players in other channels

Short could be /c f [channelname, "." for main chat] [message]

3. Then there's the party mod we also use. It has some chat integration and conflicts with smartchat - with smartchat taking precedence. I'd rather disable the partychat than smart_chat :D We also intend to use a factions mod.

The party mod we use:

viewtopic.php?t=18588

Not sure about the factions yet, but maybe we'll go for this one:

viewtopic.php?t=23281

Is there a way to make channels not joinable unless one is in the faction/party/squad and ofc at the same time stick the player into the channel of his faction/party/squad?
Whatever I say is CC0

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Sorry, i'm a little bit late, but i wan't last time not here.

Interesting idea, to listen to multiple channels ;-).
This feature was thought for moderators, but of course, it should be possible, to listen to more than one channel.

Take the modul cmd_toggle, there is the code for the public channel.
You can easy add your own command, based on toggle.

Hmm, locking a channel, it's not possible, but i will take a look to add this feature.
For myself, it was not neccesary to lock channels.

Greetings, Clyde.

Edit:

I added a API-Documentation to the mod.
It's easier to develop own modules.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Update: Version 1.2

What's new:
Smart chat has now the ability to connect to any irc-server, so the chat in your server is reachable about irc.
You have more Server than one? Yes? Then connect the server about smart chat and irc.
Fast and easy to configure with the settingtypes.
Command status for the irc ....

At Contentdb:
Image
Image

https://content.minetest.net/packages/Clyde/smart_chat/
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
afflatus
Member
Posts: 362
Joined: Tue Apr 01, 2014 19:47
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus
Location: Avalonia
Contact:

Re: [MOD] Smart chat [smart_chat]

by afflatus » Post

There are errors in your command descriptions.
Suggestions:
cmd_all should be "Sends a message to all channels."
cmd_free_channel doesn't make sense at all. What do you mean by "Set a channel from permanent free."?
do you mean "remove a channel from the permanent list" or "Unmarks a channel as permanent."? either would work
cmd_list - ""List all players in the channel." would be better s/player/players in all the other text messages here.
cmd_status - "Print Information about the Chat." would be better.
cmd_store_channel - "Marks a channel as permanent." would be better
cmd_toggle - "Turns the permanent public Chat on or off." again no apostrophe for plurals in English
cmd_where - "Shows the room where <name> is." or "Shows which channel <name> is on" would be better, because you don't use the term 'room' anywhere else.
also: s/privileg/privilege

HTH
Grailtest is stirring ...

User avatar
afflatus
Member
Posts: 362
Joined: Tue Apr 01, 2014 19:47
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus
Location: Avalonia
Contact:

Re: [MOD] Smart chat [smart_chat]

by afflatus » Post

Only use apostrophes to mark possession or for concatenation "it is" => "it's"
e.g. "The player's message"
3rd person verbs and plurals just add s on its own

"its" is irregular, even L1 English speakers get this wrong
Grailtest is stirring ...

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

afflatus wrote:
Mon Feb 14, 2022 17:23
There are errors in your command descriptions.
Suggestions:
cmd_all should be "Sends a message to all channels."
In fact, the command sends to all players, but this is only programming.
afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_free_channel doesn't make sense at all. What do you mean by "Set a channel from permanent free."?
do you mean "remove a channel from the permanent list" or "Unmarks a channel as permanent."? either would work
I agree, my wife didn't understand it too.
afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_list - ""List all players in the channel." would be better s/player/players in all the other text messages here.
Will be changed.
afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_status - "Print Information about the Chat." would be better.
You're right, but the shortcut would be /c i and /c i stands for invite.
A command status in MT exists, so i choose /c status.
Also the command give more information about the IRC-Status.

afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_store_channel - "Marks a channel as permanent." would be better
...
afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_toggle - "Turns the permanent public Chat on or off." again no apostrophe for plurals in English
...
afflatus wrote:
Mon Feb 14, 2022 17:23
cmd_where - "Shows the room where <name> is." or "Shows which channel <name> is on" would be better, because you don't use the term 'room' anywhere else.
Will be changed.
afflatus wrote:
Mon Feb 14, 2022 17:23
also: s/privileg/privilege
Sorry, English isn't my mother tongue.
Next time, please send me a PR.

Greetings, Clyde.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
afflatus
Member
Posts: 362
Joined: Tue Apr 01, 2014 19:47
GitHub: 0-afflatus
IRC: afflatus
In-game: afflatus
Location: Avalonia
Contact:

Re: [MOD] Smart chat [smart_chat]

by afflatus » Post

No need to apologise Clyde. English can be a silly language at the best of times :D
It seemed trivial for a PR and I wanted to discuss the meanings because I may have misunderstood some things.
As an L1 English speaker and documentation writer, the best way I can help is to provide a bit of language support.
If I spot any more I will make a PR &/ raise a ticket on github
Grailtest is stirring ...

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Thank you, a PR has the function to comment.

Greetings, Clyde.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

Bastrabun
Member
Posts: 211
Joined: Mon Nov 04, 2019 19:48

Re: [MOD] Smart chat [smart_chat]

by Bastrabun » Post

Thanks a lot, you added everything I wanted :)

Regarding IRC:

1. Is there a way to use an existing account with password or even SASL?

2. I didn't manage to get IRC to run unless I disabled modsecurity altogether. secure.trusted_mods = smart_chat did not suffice. Am I doing something wrong? Error message during startup is like

Code: Select all

2022-02-17 15:18:58: ERROR[Main]: ModError: Failed to load and run script from /home/p/projects/minetest/5.5.0-dev/minetest-dev/bin/../mods/smart_chat/init.lua:
2022-02-17 15:18:58: ERROR[Main]: require() is disabled when mod security is on.
2022-02-17 15:18:58: ERROR[Main]: stack traceback:
2022-02-17 15:18:58: ERROR[Main]: 	[C]: in function 'require'
2022-02-17 15:18:58: ERROR[Main]: 	...st/5.5.0-dev/minetest-dev/bin/../mods/smart_chat/irc.lua:32: in main chunk
2022-02-17 15:18:58: ERROR[Main]: 	[C]: in function 'dofile'
2022-02-17 15:18:58: ERROR[Main]: 	...t/5.5.0-dev/minetest-dev/bin/../mods/smart_chat/init.lua:63: in main chunk
3. Could you add a command for people who do not wish their chat sent out to some external service, like /c noirc? This would cause them to neither transmit to nor receive from IRC.
Whatever I say is CC0

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

2.
Have you from Lua51 the socket library on your server installed? This is a extern dependence for this mod.
In Arch-Linux the repo has the name: Lua51-Socket.
And of course you must turn on the IRC in the settings. See the Settingtypes.

1. this should be possible, take a look at irc.lua line 35 to 66, there is the procedere to connect to an irc.

I have tested this on irc.eu.libera.chat and works fine for my servers.

The procedere is, that IRC expect after the login some commands to register on the server.

User, this command expect a User-Name.
Nick, this command expect a Nickname. Don't ask me the difference between both.
Join, is the name of the Channel, you want to join.
Topic, set a Theme for the Channel, afaik it's optional.

I think, there will also exist a command for password or something similar, so that you can send a password.
In this case, you have to insert this line in irc.lua.

A good way is, connect via telnet and enter this commands, then you should enter the irc.
PRIVMSG is on libera with other informations, like the nickname, the chatmessage, what this user has written in the chat.
With telnet, you can send this message manually, when you start the line with PRIVMSG.
A good way to find this commands is, when you has connected, try the command HELP.

I think, this commands are on all IRC-Server the same, because a IRC-Client is doing it on the same way.

3. Of course, this is possible. Another way is, you enter a channel. The IRC can see only the public-channel and a userchannel don't send the messages to the IRC.

Greetings, Clyde.
Last edited by Clyde on Thu Feb 17, 2022 22:46, edited 5 times in total.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

P.S.: Of course, you can enter the channel with an normal IRC-Client, so it's possible to chat with the players in the game, without to be connected with the game ;-).

I've taken a look, the command for a password is PASS.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Update:

Version 1.4 IRC has now the ability to join a channel with an password.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
hephaestus
Member
Posts: 10
Joined: Sun Jan 14, 2024 16:11
IRC: hephaestus

Re: [MOD] Smart chat [smart_chat]

by hephaestus » Post

Hello!
I liked this MOD, very useful.
I have a question, where are the chats recorded? In debug I cannot understand the dialog. I'm worried if a player acts disrespectfully towards another player and needs to be banned, it's important to have a record. And also, is there a way to prevent players from creating channels freely, would it be possible for me to define fixed channels to be used?

Congratulations on the promising work!

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Only the public channel will be logged, to log all channels, i have to look to add it.
But pay attention, the size of the log will "explode" ...

In debug? I am afraid, i can't follow you.

The reason why everybody can create channels is, this channels are not fixed. If the last player leaves this channel, the channel will be removed.
To fix a channel, use the command /c mark, it needs moderator or adminpower to execute this command. With this command you can fix or release a channel.

Prevent player from creating new channels, is to prevent player to join channels. Take a look at the command join. You can add for example a new privilege, before execute the whole command. Otherwise only a mod can move players into or kick from channels.

Ingame, you can enter the command /c help. After them use F10, it's a long but helpfully text about each command.
Shorter is: /c help command, where the command is the name of the command, where you need help, /c help mark for example.

Greetings, Clyde.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Update: Version 1.6

What's new:
A new option added: smart_chat.join_with_priv
This let the join-command check the privs of the user and let only user with the privilege "channeluser" join into another channel.

At Contentdb:
Image
Image

https://content.minetest.net/packages/Clyde/smart_chat/
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

@hephaestus

Smart chat is logging all channels, but only in the verbose mode.
Check the lib.lua

Code: Select all

minetest.log("verbose", "[MOD] " .. lib.modname .. " : Module lib: chat: <" .. playername .. "> " .. text)
But i will add an option to change this log to action, then it logs all messages.
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

User avatar
Clyde
Member
Posts: 222
Joined: Sat Jul 30, 2016 14:23
GitHub: acmgit
In-game: clyde

Re: [MOD] Smart chat [smart_chat]

by Clyde » Post

Update: Version 1.7

What's new:
Chatkommand /me implemented.
Option to disable the overwrite of the /me command.
Option to enable the log of all channels.

At Contentdb:
Image
Image

https://content.minetest.net/packages/Clyde/smart_chat/
My Server: Welcome to Zeitsprung - deadsoft.org:49152 Jungle The next Gundul - jungle-tng.deadsoft.org:49152

Post Reply

Who is online

Users browsing this forum: No registered users and 14 guests