notnola / pinychat Goto Github PK
View Code? Open in Web Editor NEWPython module to interface with Tinychat.com
Python module to interface with Tinychat.com
Via a config.
Looks fine in the Flash client, but in the console the message is URL-encoded (i.e. Hello World
= Hello%20World
)
PMed users are currently only tracked by nick, rather than of by some sort of session-unique ID. So if you're PMing a nick and that nick leaves, and then someone else joins with that same nick, you could accidentally assume that this new person under the same nick is the original person. This assumption can be mitigated by just letting you know that the nick you were PMing has left, just like the Flash client already does.
Example: nicks show up as something like �[1mnick:�[0m
instead of just nick:
These extra characters are just the ANSI escape codes for terminal colors.
The chatlog function will probably need to strip those out.
If you enter a command that doesn't exist, it seems to default to the exception line in /playyoutube
("Something went wrong, maybe that link was invalid. Try again.")
Has been like this since the Tinychat gifts update a few months ago, which is when they completely change how account names are served.
This means anything that uses *.users.accountName
is None
. Among others, breaks /list
and /userinfo
.
Doing /playyoutube @
normally opens the current video in a browser. The problem is that the current video is only identified if the module sees someone play it (i.e. the server message /mbs [videoID]
). So if you join a room and a video is already playing, the module thinks that no video is playing, because the server doesn't send that /mbs
upon connecting.
Meaning, there needs to be a way to detect the currently-playing video at connection time.
All non-ASCII characters end up as gibberish.
For stuff like room/nick/account names and time format.
/close
is only used by mods.
Play normal YouTube links and share links.
https://github.com/notnola/pinychat/blob/master/tinychat.py
def playYoutube(self, video):
try:
yt = video.split(".be/")[1][:11]
except:
yt = video.split("?v=")[1][:11]
self.say("/mbs youTube " + str(yt) + " 0")
Figured you may want to throw that in. ❤️
The bot will fetch the cauth from room server and then cannot proceed to connect.
Currently there are only non-obvious indicators that you're already banned from a room. The indicators are either of these: your nick never changes from guest, you never see the topic, if notifications are off there's only one empty line instead of two after the "Connected to", (edit:) or if the module crashes after your first message.
There needs to be a more obvious indicator.
If anyone can fix that.
When the username and password are wrong, there is no obvious indication. It just connects, then crashes after you try to send more than one message. A similar (or possibly the same) thing happens when you connect to a room you've been banned from (see #36).
Haven't been able to connect for the past few weeks. Or to be specific, Tinychat's servers don't seem to be sending and receiving messages to and from the module.
/list
needs a mode that only prints nicks, rather than all that other stuff.
It seems that once a guest has joined, someone who is not using an account, if they set their nick as something other than that they joined in with, the messaging functions seem to work again. This might be a fix to the issue, however I am not completely sure about it.
Tinychat's virtual gifts update a few months ago changed how account names are served. All account get/set requests are now blank (userinfo
does nothing and signed-in sessions show up as signed-out in the Flash client).
This means anything that uses *.users.accountName
is None
. Among others, breaks /list
and /userinfo
.
/userinfo in console with false username causes the bot to break.
An empty line is printed after each for some reason.
instead of playing as /mbs youTube diDgHD-MEOU 0
is actually playing as /mbs youTube 0
Only messages are checked for mentions right now.
The readme is starting to get long enough that it needs things like a table of contents, separate pages, etc. The wiki provides all of this.
Get notified whenever certain phrases are mentioned. Like your nick.
Pretty much just like IRC.
During my few minutes of spare time over the next few days, I will be creating an offical channel for direct and instant communications between developers and community members.
I was thinking about launching a channel on Freenodes' IRC server and providing a web client on Pinychat's .io domain for thouse without an IRC client installed on their machine, or possibly setting up an offical Ti ychat room and embedding it on the .io domain.
Ideas are more than welcome and well receive proper consideration, however if there is no recommendations in the next few days, I'll move forward with one of the plans stated above.
-Regards,
---Nola
If there are any future RTMP updates need for this library. I highly advise you look at the RTMP specifications: https://www.adobe.com/content/dam/Adobe/en/devnet/rtmp/pdf/rtmp_specification_1.0.pdf
Might be worth going over tinychat.py and adding any interesting or useful features.
I attempted to speak with you in manhattanproject but james doesn't like being told his code sucks and needs cleaned up. let me know when i can speak with you.
In tinychat.py the same function _getUser is defined twice.
First on line 254 and then again on line 396. Is there a reason for this?
I think after the latest Tinychat client update 2 days ago, PMs might not be working 100% of the time. This is the TC update that added capital letters to nicks. Seems to happen randomly, haven't really tested it yet to fully reproduce this issue.
@swiftSwathSee, over the next few days lets focus on creating and maintaining seperate and individual identities of Pinychat and any code that uses it. Pinychat's main goal is to provide a set of Python functions/methods to enable the creation of other tools. Example - A room helper bot, TriviaBot, user locator, etc. And it seems to be slowly wandering off course of that goal.
Pinychat's mission was never intended to be a full fledged terminal client for Timychat. However I am willing to support that effort in any way possible. I would love to have a well documented unoffical Tinychat Python API to provide to the community.
I will be assisting you in this endeavor as soon as possible, probably starting Feb24. I encourage any other developers using Pinychat to please help out by submitting pull requests relating to this topic.
-Regards,
---Nola
ab2f661 broke this
PM replies are printed as both PMs and public messages. An quick fix is to just remove the message portions from the PM-printing _chatlog
line (starts with self._chatlog(ppP+" PM "+Ppp + " "
...), but that means each PM will be preceded by a nearly empty line, which is a bit wasteful. A nicer-looking solution would be to suppress the public-printing _chatlog
for PMs (currently 3 lines below the PM one). I haven't looked into this yet but figured I'd make this issue for whoever does.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.