diff options
author | Polymath <polymath@hax.al> | 2024-10-06 20:14:31 +0000 |
---|---|---|
committer | Polymath <polymath@hax.al> | 2024-10-06 20:14:31 +0000 |
commit | b72ee92c70c5bb19d76c7807524208d0b03817c1 (patch) | |
tree | 2ddd7129e379c02308626da012e7cffcfa2cda9a | |
parent | Welcoming bot for xmpp (diff) | |
download | xmpp_bot-b72ee92c70c5bb19d76c7807524208d0b03817c1.tar.gz xmpp_bot-b72ee92c70c5bb19d76c7807524208d0b03817c1.zip |
Adding readmeHEADv0.7origin/mainorigin/HEADmain
-rw-r--r-- | README.md | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/README.md b/README.md new file mode 100644 index 0000000..cf5e959 --- /dev/null +++ b/README.md @@ -0,0 +1,49 @@ +# erdhe + +XMPP Welcome Bot in C + +Build and run: + +`` +make +`` + +Run the bot: + +`` +./xmpp_bot 2>&1 +`` + +Remember to replace BOT_JID and BOT_PASSWORD with your actual credentials. If you're getting connection errors, you might need to verify: + +The server's TLS certificate is valid +The server allows client connections +Your network allows outbound XMPP traffic + +------------- + +Key changes made to the code: + +Added a configurable welcome message with a default template that includes the user's nickname: DEFAULT_WELCOME_MSG "Welcome to the room, %s!" +Added functionality to extract nicknames from full JIDs using the get_nickname function +Implemented a message handler to process room messages and check for the command to update the welcome message (.erdha wm) +Added logic to check if the user trying to change the welcome message is an admin or owner +Modified the presence handler to: + +Not send welcome messages to users already in the room when the bot joins +Use the configurable welcome message format with the user's nickname + + +Added a separate function send_welcome_message to format and send the welcome message + +To use the updated bot: + +The bot will automatically join the room and not send welcome messages to existing users +When new users join, they'll receive a whispered welcome message that includes their nickname +Room admins or owners can change the welcome message using the command: .erdha wm "New welcome message" + +The message can include %s which will be replaced with the joining user's nickname + + + +Note that the welcome message has a size limit of 511 characters to prevent buffer overflows. |