[ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

[ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Christoph Thiede

Hi all!


After announcing SimulationStudio and Sandbox yesterday [3], today I'm happy to introduce you to two other repositories which I have been working at during the last months. Last week, I had the pleasure to present them during the German Squeak Winter Demos [4]. Drum roll, say hello to TelegramBot [1] & TelegramSmalltalkBot [2]! :-)


TelegramBot is a small framework I built to make it possible to implement bots for the Telegram messenger [5]. It uses the official Telegram Bot REST API [6] and maps it to an object-oriented design in Squeak, providing support for different bot capabilities such as message sending, receiving, and editing. It also allows sending multi-media message types such as pictures (Forms), formatted messages (Texts), audio messages (AbstractSounds), and some others. Last but not least, it comprises a small API to host your bots in a background process of the image. For more information, check out the README.md of the repository in [1].


TelegramSmalltalkBot is a second repository that implements a Telegram bot for evaluating Smalltalk expressions by using the TelegramBot framework from above. Do you know this situation when you wonder "how does XYZ work in Squeak" and cannot check it out because you do not have any PC or laptop at hand right now? This situation is history as of today, just send a message to the bot from wherever you are, just using your phone or even your watch! In a nutshell, TelegramSmalltalkBot is a simple REPL shell that utilizes the Squeak Compiler, but it's also packed with a number of convenient features that make remote access to your image much more pleasant. For example, the bot does not only answer plain text but also multi-media messages such as pictures or files depending on the results of your expressions. You can also use Workspace-like variable bindings or reply to older messages from the bot to bind the receiver of your message. For an exhaustive list of all features, visit the repository in [2] or just send /help to the bot. I also have uploaded a short video demo about it at [7].


Another important thing to note is that TelegramSmalltalkBot is able to evaluate every expression in a sandboxed execution environment by using the SimulationStudio library I announced yesterday [3]. While both projects have grown rather independently of each other, this usage fills an important gap for me and I think it is a relevant real-world use case of the Sandbox.


Please try it out! :-) All you need is a Telegram account for free and a client (Telegram is available cross-platform and can also be used from the web). I am hosting an instance of the bot myself on my raspberry pi and I feel confident enough about the isolation quality of my Sandbox that I dare to unlock public access to the bot for everyone. A small architecture diagram which I have shown at the Winter Demos is in the attachments (contains clickable links to the repositories), you can also find it in the wiki of [2].


Just search in the Telegram app for @SqueakSmalltalkBot or follow this link: https://t.me/SqueakSmalltalkBot [8] (QR code is also in the attachments)


I'm very much looking forward to your feedback! If you experience any problems or have new ideas, please let me know via squeak-dev or GitHub issues! I'm already planning many new features for the bot - be sure to watch the repository if you are interested in them. :-)


Best,

Christoph


[1https://github.com/LinqLover/TelegramBot

[4] http://forum.world.st/Squeak-Winter-Demos-2021-03-06-3-p-m-6-p-m-CET-virtual-tp5126913.html




TelegramSmalltalkBot Architecture.svg (736K) Download Attachment
qr_@SqueakSmalltalkBot.png (7K) Download Attachment
Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Jaromir Matas
Hi Christoph,
 
the telegram Squeak bot is amazing :)
A question: "Control primitives are disabled in sandbox simulation" not
allowing forking, yielding etc. - is it just a precaution or some
fundamental limitation?
Thanks!



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html

^[^ Jaromir
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Christoph Thiede

Hi Jaromir,


thank you for giving it a try, glad you like it! :-)


I would call it precaution. If you would host the bot yourself, you could change TelegramSmalltalkSession >> #isolationEnabled to access your real image without any limitations.

But since @SqueakSmalltalkBot can be accessed by anyone and at the same time is hosted in my private network, it was crucial for me to carefully eliminate all kinds of side effects.

For controlling operations such as forking and suspending, there is not yet any simulation support on the image side, which would potentially allow you to break out of my Sandbox and hack into my smart home system or anything else. :-) Thus I have disabled all the controlling primitives in the sandbox simulation for now (you can read more details about this in [1] if you are interested).


But it's an interesting topic. It would be nice if we could simulate process controlling and scheduling in Squeak as well. Sounds like another exciting project ... :-)


Best,

Christoph


[1] https://github.com/LinqLover/SimulationStudio/blob/a05f395d67a84a457c8224edadf03e3da80e17da/packages/SimulationStudio-Sandbox.package/SandboxContext.class/instance/doPrimitive.method.receiver.args..st#L44


Von: Squeak-dev <[hidden email]> im Auftrag von Jaromir Matas <[hidden email]>
Gesendet: Mittwoch, 17. März 2021 17:48:16
An: [hidden email]
Betreff: Re: [squeak-dev] [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)
 
Hi Christoph,
 
the telegram Squeak bot is amazing :)
A question: "Control primitives are disabled in sandbox simulation" not
allowing forking, yielding etc. - is it just a precaution or some
fundamental limitation?
Thanks!



-----
^[^ Jaromir
--
Sent from: http://forum.world.st/Squeak-Dev-f45488.html



Carpe Squeak!
Reply | Threaded
Open this post in threaded view
|

Re: [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Kjell Godo
In reply to this post by Christoph Thiede
+10

On Wed, Mar 17, 2021 at 05:32 Thiede, Christoph <[hidden email]> wrote:

Hi all!


After announcing SimulationStudio and Sandbox yesterday [3], today I'm happy to introduce you to two other repositories which I have been working at during the last months. Last week, I had the pleasure to present them during the German Squeak Winter Demos [4]. Drum roll, say hello to TelegramBot [1] & TelegramSmalltalkBot [2]! :-)


TelegramBot is a small framework I built to make it possible to implement bots for the Telegram messenger [5]. It uses the official Telegram Bot REST API [6] and maps it to an object-oriented design in Squeak, providing support for different bot capabilities such as message sending, receiving, and editing. It also allows sending multi-media message types such as pictures (Forms), formatted messages (Texts), audio messages (AbstractSounds), and some others. Last but not least, it comprises a small API to host your bots in a background process of the image. For more information, check out the README.md of the repository in [1].


TelegramSmalltalkBot is a second repository that implements a Telegram bot for evaluating Smalltalk expressions by using the TelegramBot framework from above. Do you know this situation when you wonder "how does XYZ work in Squeak" and cannot check it out because you do not have any PC or laptop at hand right now? This situation is history as of today, just send a message to the bot from wherever you are, just using your phone or even your watch! In a nutshell, TelegramSmalltalkBot is a simple REPL shell that utilizes the Squeak Compiler, but it's also packed with a number of convenient features that make remote access to your image much more pleasant. For example, the bot does not only answer plain text but also multi-media messages such as pictures or files depending on the results of your expressions. You can also use Workspace-like variable bindings or reply to older messages from the bot to bind the receiver of your message. For an exhaustive list of all features, visit the repository in [2] or just send /help to the bot. I also have uploaded a short video demo about it at [7].


Another important thing to note is that TelegramSmalltalkBot is able to evaluate every expression in a sandboxed execution environment by using the SimulationStudio library I announced yesterday [3]. While both projects have grown rather independently of each other, this usage fills an important gap for me and I think it is a relevant real-world use case of the Sandbox.


Please try it out! :-) All you need is a Telegram account for free and a client (Telegram is available cross-platform and can also be used from the web). I am hosting an instance of the bot myself on my raspberry pi and I feel confident enough about the isolation quality of my Sandbox that I dare to unlock public access to the bot for everyone. A small architecture diagram which I have shown at the Winter Demos is in the attachments (contains clickable links to the repositories), you can also find it in the wiki of [2].


Just search in the Telegram app for @SqueakSmalltalkBot or follow this link: https://t.me/SqueakSmalltalkBot [8] (QR code is also in the attachments)


I'm very much looking forward to your feedback! If you experience any problems or have new ideas, please let me know via squeak-dev or GitHub issues! I'm already planning many new features for the bot - be sure to watch the repository if you are interested in them. :-)


Best,

Christoph


[1https://github.com/LinqLover/TelegramBot

[4] http://forum.world.st/Squeak-Winter-Demos-2021-03-06-3-p-m-6-p-m-CET-virtual-tp5126913.html




Reply | Threaded
Open this post in threaded view
|

Re: [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Eliot Miranda-2
In reply to this post by Christoph Thiede
Hi Christoph,

    very cool work.  Let me suggest another avenue for the simulation sandbox. Apologies if we've already discussed this.  MethodFinder is a super cool tool, but it has to be prevented from creating havok using a horrible hack.  A set of selectors are used to prevent MethodFinder from starting potentially dangerous computations.  This list isn't obvious, is never up-to-date, and can potentially exclude useful results.  A much better way of implementing MethodFinder seems to be to implement it using simulation and have it maintain the set of objects created so far in the execution, allowing them to be mutated, but aborting whenever an attempt is made to modify an object outside of the sandbox, etc.  This could be a much more robust way to architect the message finder, and performance might be adequate.  I think it's worth exploring.

On Wed, Mar 17, 2021 at 5:32 AM Thiede, Christoph <[hidden email]> wrote:

Hi all!


After announcing SimulationStudio and Sandbox yesterday [3], today I'm happy to introduce you to two other repositories which I have been working at during the last months. Last week, I had the pleasure to present them during the German Squeak Winter Demos [4]. Drum roll, say hello to TelegramBot [1] & TelegramSmalltalkBot [2]! :-)


TelegramBot is a small framework I built to make it possible to implement bots for the Telegram messenger [5]. It uses the official Telegram Bot REST API [6] and maps it to an object-oriented design in Squeak, providing support for different bot capabilities such as message sending, receiving, and editing. It also allows sending multi-media message types such as pictures (Forms), formatted messages (Texts), audio messages (AbstractSounds), and some others. Last but not least, it comprises a small API to host your bots in a background process of the image. For more information, check out the README.md of the repository in [1].


TelegramSmalltalkBot is a second repository that implements a Telegram bot for evaluating Smalltalk expressions by using the TelegramBot framework from above. Do you know this situation when you wonder "how does XYZ work in Squeak" and cannot check it out because you do not have any PC or laptop at hand right now? This situation is history as of today, just send a message to the bot from wherever you are, just using your phone or even your watch! In a nutshell, TelegramSmalltalkBot is a simple REPL shell that utilizes the Squeak Compiler, but it's also packed with a number of convenient features that make remote access to your image much more pleasant. For example, the bot does not only answer plain text but also multi-media messages such as pictures or files depending on the results of your expressions. You can also use Workspace-like variable bindings or reply to older messages from the bot to bind the receiver of your message. For an exhaustive list of all features, visit the repository in [2] or just send /help to the bot. I also have uploaded a short video demo about it at [7].


Another important thing to note is that TelegramSmalltalkBot is able to evaluate every expression in a sandboxed execution environment by using the SimulationStudio library I announced yesterday [3]. While both projects have grown rather independently of each other, this usage fills an important gap for me and I think it is a relevant real-world use case of the Sandbox.


Please try it out! :-) All you need is a Telegram account for free and a client (Telegram is available cross-platform and can also be used from the web). I am hosting an instance of the bot myself on my raspberry pi and I feel confident enough about the isolation quality of my Sandbox that I dare to unlock public access to the bot for everyone. A small architecture diagram which I have shown at the Winter Demos is in the attachments (contains clickable links to the repositories), you can also find it in the wiki of [2].


Just search in the Telegram app for @SqueakSmalltalkBot or follow this link: https://t.me/SqueakSmalltalkBot [8] (QR code is also in the attachments)


I'm very much looking forward to your feedback! If you experience any problems or have new ideas, please let me know via squeak-dev or GitHub issues! I'm already planning many new features for the bot - be sure to watch the repository if you are interested in them. :-)


Best,

Christoph


[1https://github.com/LinqLover/TelegramBot

[4] http://forum.world.st/Squeak-Winter-Demos-2021-03-06-3-p-m-6-p-m-CET-virtual-tp5126913.html




--
_,,,^..^,,,_
best, Eliot


Reply | Threaded
Open this post in threaded view
|

Re: [ANN] TelegramBot framework & @SqueakSmalltalkBot :-)

Eliot Miranda-2
oops.  Ignore me.  I just read the longer post about SimulationStudio.  Super cool.  No need to respond.

On Thu, Mar 18, 2021 at 1:18 PM Eliot Miranda <[hidden email]> wrote:
Hi Christoph,

    very cool work.  Let me suggest another avenue for the simulation sandbox. Apologies if we've already discussed this.  MethodFinder is a super cool tool, but it has to be prevented from creating havok using a horrible hack.  A set of selectors are used to prevent MethodFinder from starting potentially dangerous computations.  This list isn't obvious, is never up-to-date, and can potentially exclude useful results.  A much better way of implementing MethodFinder seems to be to implement it using simulation and have it maintain the set of objects created so far in the execution, allowing them to be mutated, but aborting whenever an attempt is made to modify an object outside of the sandbox, etc.  This could be a much more robust way to architect the message finder, and performance might be adequate.  I think it's worth exploring.

On Wed, Mar 17, 2021 at 5:32 AM Thiede, Christoph <[hidden email]> wrote:

Hi all!


After announcing SimulationStudio and Sandbox yesterday [3], today I'm happy to introduce you to two other repositories which I have been working at during the last months. Last week, I had the pleasure to present them during the German Squeak Winter Demos [4]. Drum roll, say hello to TelegramBot [1] & TelegramSmalltalkBot [2]! :-)


TelegramBot is a small framework I built to make it possible to implement bots for the Telegram messenger [5]. It uses the official Telegram Bot REST API [6] and maps it to an object-oriented design in Squeak, providing support for different bot capabilities such as message sending, receiving, and editing. It also allows sending multi-media message types such as pictures (Forms), formatted messages (Texts), audio messages (AbstractSounds), and some others. Last but not least, it comprises a small API to host your bots in a background process of the image. For more information, check out the README.md of the repository in [1].


TelegramSmalltalkBot is a second repository that implements a Telegram bot for evaluating Smalltalk expressions by using the TelegramBot framework from above. Do you know this situation when you wonder "how does XYZ work in Squeak" and cannot check it out because you do not have any PC or laptop at hand right now? This situation is history as of today, just send a message to the bot from wherever you are, just using your phone or even your watch! In a nutshell, TelegramSmalltalkBot is a simple REPL shell that utilizes the Squeak Compiler, but it's also packed with a number of convenient features that make remote access to your image much more pleasant. For example, the bot does not only answer plain text but also multi-media messages such as pictures or files depending on the results of your expressions. You can also use Workspace-like variable bindings or reply to older messages from the bot to bind the receiver of your message. For an exhaustive list of all features, visit the repository in [2] or just send /help to the bot. I also have uploaded a short video demo about it at [7].


Another important thing to note is that TelegramSmalltalkBot is able to evaluate every expression in a sandboxed execution environment by using the SimulationStudio library I announced yesterday [3]. While both projects have grown rather independently of each other, this usage fills an important gap for me and I think it is a relevant real-world use case of the Sandbox.


Please try it out! :-) All you need is a Telegram account for free and a client (Telegram is available cross-platform and can also be used from the web). I am hosting an instance of the bot myself on my raspberry pi and I feel confident enough about the isolation quality of my Sandbox that I dare to unlock public access to the bot for everyone. A small architecture diagram which I have shown at the Winter Demos is in the attachments (contains clickable links to the repositories), you can also find it in the wiki of [2].


Just search in the Telegram app for @SqueakSmalltalkBot or follow this link: https://t.me/SqueakSmalltalkBot [8] (QR code is also in the attachments)


I'm very much looking forward to your feedback! If you experience any problems or have new ideas, please let me know via squeak-dev or GitHub issues! I'm already planning many new features for the bot - be sure to watch the repository if you are interested in them. :-)


Best,

Christoph


[1https://github.com/LinqLover/TelegramBot

[4] http://forum.world.st/Squeak-Winter-Demos-2021-03-06-3-p-m-6-p-m-CET-virtual-tp5126913.html




--
_,,,^..^,,,_
best, Eliot


--
_,,,^..^,,,_
best, Eliot