riichi / chombot Goto Github PK
View Code? Open in Web Editor NEWDiscord bot for Riichi Mahjong servers
License: MIT License
Discord bot for Riichi Mahjong servers
License: MIT License
Currently !hand
command scans hand description from left to right, which complicates things a bit – tile suite is specified after a sequence of tiles, so we need to either remember tiles with unspecified suite (which is the current solution) or do a forward lookup first. Parsing from right to left should simplify the whole process.
Currently commands.hand.PNGHandRenderer
, when asked to load an image file, reloads it from disk every time, which is probably not a very good thing – there are not that many tiles to begin with and some of them are heavily reused (e.g. Front.png
). It would be nice if it could read each tile at most once – either eagerly (read all tiles at startup) or lazily (read from disk when necessary and store result for later).
The !hand
command does not have input size limit, so it is possible to send a big request which would painfully slow down the bot, e.g. long sequence of 1
s followed by m
repeated many times. Limiting total number of rendered tiles to, say, 30 would (at least partially) solve this problem.
We should throw an error when user tries to exceed some maximum input length (say, 200 characters) to avoid long parsing time or generating an almost empty image that has ridiculously high size.
This should make us less likely to bump into CloudFlare protections and is a good practice overall.
To avoid confusion (+
means climbing up the ranking, but the place number decreases ). Putting e.g. ⬆️ and ⬇️ instead should help.
Currently the hand format parser simply sends error message when given wrong hand description. It would be nicer if it had special tile (e.g. Blank.png
, see tile repository) that would be used after encountering unexpected symbol. It would make the process of pinpointing the mistake much simpler.
ExecStart=/usr/bin/java -jar /home/chombot/chombot.jar
? sus
What if we e.g. want to get best options between 6pm and 10pm?
Is there a specific reason for this text to be provided by the user? It seems like the structure is being used for one reason only anyway, so why not specify it as const inside it?
Originally posted by @seqre in #193 (comment)
Indeed, that doesn't sound like a very bad idea. Perhaps I wanted this to be customizable by the users, but I don't think it makes much sense. Anyway, this is out of scope of this PR, but will fix that in one of the next ones.
Originally posted by @m4tx in #193 (comment)
Each invocation results in 17 HTTP calls 🤷
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.