Comments (10)
oh.. that was funny, thank you
sorry for disturbing :D
from hcclient.
The message string is handled by send_input()
hcclient/src/hcclient/__main__.py
Line 539 in beb32a2
Note that this function also processes commands, so you'll want to make sure your encryption is done after the function has checked if the string is not a command and meant to be a message. This is the line that finally sends a regular chat message:
hcclient/src/hcclient/__main__.py
Line 935 in beb32a2
Also make sure to check if the message begins with a /
anyway, since we pass some commands like /whisper
and /me
to the server to handle.
Feel free to ask anything else :D
from hcclient.
ok so i was doing a test trying to see if i could mess with the string by adding a dot at the end but apparently it's not working.
self.send(json.dumps({"cmd":
"chat", "text": f"{message}."}))`
any suggestions?
from hcclient.
Hmm, not sure why it isn't working for you. I've tested on my side and it does append a period to messages.
message.mp4
from hcclient.
Can you share the full code you've used?
from hcclient.
I modified this snippet:
hcclient/src/hcclient/__main__.py
Lines 941 to 949 in 850ae8e
to
case _:
if self.whisper_lock:
if not message.split(" ")[0] in ("/whisper", "/w", "/reply", "/r") or message.startswith(" "):
self.print_msg("{}|{}| {}".format(termcolor.colored("-NIL-", self.args["timestamp_color"]),
termcolor.colored("CLIENT", self.args["client_color"]),
termcolor.colored("Whisper lock active, toggle it off to send messages", self.args["client_color"])))
return
self.send(json.dumps({"cmd": "chat", "text": f"{message}."}))
The change is at line 949 specifically
(There have been a few commits adding unrelated stuff, so the line number isn't the same as before)
from hcclient.
Can you fork and add your changes so I can see your code? I'm puzzled as to why it doesn't add a period for you.
from hcclient.
done.
from hcclient.
Just tested, works as expected. Are you maybe accidentally testing with a different installation of hcclient? Maybe one you have installed globally
from hcclient.
It's okay, glad we clarified it. Have a great day :D
from hcclient.
Related Issues (2)
- hcclient is a package HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hcclient.