rycieos / slack-compilebot Goto Github PK
View Code? Open in Web Editor NEWCompiles code snipits on Slack. Like /u/compilebot, but for Slack
License: GNU General Public License v3.0
Compiles code snipits on Slack. Like /u/compilebot, but for Slack
License: GNU General Public License v3.0
If a block like this is passed in as the "Input":
```
1
2
3
```
what slack actually is doing is this:
\n
1\n
2\n
3\n
since there is a newline character directly after and before the respective start and end.
This can be "fixed" by not including the newline when you type it:
```1
2
3```
but that doesn't look as clean. It would be simple to strip out a start and end character if they are '\n', but would it be too confusing?
When trying to use a new language, it's hard to guess what Sphere Engine is looking for in a string.
Add a way to specify a simple string like python
, and have the bot return possible matches.
Ideally, it could do this as part of the normal code submit. If only one option came back, it would use that one, but if multiple did, then it would error and show the possible language options.
This issue was originally discovered 2017-10-23, but apparently never logged on Github.
If this is passed to compilebot:
@compilebot python
while True: pass
compilebot will correctly return:
@Rycieos: There was an error processing your code:
Time limit exceeded
But, if this is passed:
@compilebot python
while True: print("test")
compilebot will never appear to return anything.
What actually happens is that the text the bot is trying to send to Slack (when the compile times out) is too long and the connection breaks. Slack's docs (https://api.slack.com/methods/chat.postMessage) suggest that "a single message should be no larger than 4,000 bytes".
An easy fix would be to truncate the message after a certain number of characters. Slack's 4,000 byte limit claims to be for the text field, so chopping anything larger than 4,000 bytes to 3,950 or so and adding a "message was truncated" message is probably the best solution.
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.