38

Prologue

We love hanging out in our main chatroom. It's a very friendly place, where we talk about virtually everything - even TeX, sometimes! I decided to give it a try and add a few "extra features" to our chatroom, and the result is presented in this meta thread.

I was planning to implement a bot and find a way to wrap it into the SE infrastructure. Thankfully, there is already a project from Zirak named SO-ChatBot, a bot written in JavaScript which runs in one's browser session. I played with it a little and decided to tweak it (apart from my lack of JS skills) in order to make it more TeXy. The result is Psmith.

Introduction

Psmith is a SO chatroom bot based on Zirak's original code which runs under my credentials and within my browser session. If I'm not in the room or if I didn't deliberately trigger the startup script, the bot won't respond. I'm in charge of the bot's execution.

The name

We first thought of Jeeves, but it's taken. Then our next attempt was with Wooster, but it wasn't catchy enough. I thought of Jarvis, but it's too Stark-based. :) Then Andrew suggested Psmith, and we all approved.

Available commands

Our bot recognizes the following commands:

  • !!/answer question: an experimental command where the bot tries to actually answer your question. The database is still tiny, we are working on it.
  • !!/basketball: fetches the last news from basketball and displays them nicely.
  • !!/battle: displays and compares the daily reputations of the titans, egreg and David Carlisle.
  • !!/choose opt1, opt2, ... , optn: chooses one of the elements from the given comma-separated list.
  • !!/cricket: fetches the last news from cricket and displays them nicely.
  • !!/ctan: displays the last entries available in the official CTAN announcement RSS feed.
  • !!/eightball question: replies the question with a yes/no answer.
  • !!/fencing: fetches the last news from fencing and displays them nicely.
  • !!/help: displays the general help.
  • !!/help command: displays the help related to the specific command commands.
  • !!/list: lists all the bot's commands.
  • !!/reputation userid: displays the reputation of the user whose id is userid
  • !!/song: list the song Psmith's master, Paulo, is currently listening to.
  • !!/texdef arguments: runs Martin Scharrer's amazing texdef tool on the provided parameters.
  • !!/translate from lang1 to lang2 text: translates text from lang1 to lang2.

Potential issues

This bot replies under my name, with the Psmith, the TeX bot prefix. Most of the commands are asynchronous, so the bot might take a while to answer. If too many requests are made, the bot might flood the chat and I get suspended for spam. :) So, take it easy.

Why am I posting this text?

Are bots specifically allowed or prohibited in Stack Exchange chatrooms?

[...] Finally, a bot will be held against abuse standards just like any other user. If it "behaves" inappropriately, we're not going to like that. This holds both as far as the actual chatting (content/flooding) goes, as well as considering communication with the server (if you poll the server for new messages every 50ms, that's going to get you banned pretty quickly).

That said, we're all programmers here, and this is the kind of "exercise" we like. So we'll probably not come after you with pitchforks.

But just to make it clear: We can, at any time and with or without any reason, say "We don't want that anymore; turn it off now."

I don't leave the bot unsupervised, at least for long periods of time. That said, I'm in the chatroom almost 24h/day, and I monitor the bot's activities and replies. I can shutdown the little rascal if needed, at any time and moment. Every command is triggered at my side of the connection, in my machine, including texdef running on my TeX distro. In other words, the JS script adds hooks to the messages, intercepts certain patterns and then forwards requests to my local machine for processing. Then, the reply happens as if I were typing that message.

As balpha said in his reply, it's a good exercise. :) Let's see how it goes. If the SO team thinks this is a terrible idea or if it opens a dangerous precedent, by all means, let me know. I can easily shutdown everything, by simply closing my browser. :)

By the way, thanks to Aarthi for being so kind in helping me with the procedures to announce the bot.

Thanks a lot. :)

3
  • 5
    retag please: duck
    – yo'
    Dec 3, 2012 at 15:33
  • 2
    Wooster: Whatto Aunt Agatha! Aunt Agatha: Bertie, watch your language!
    – cmhughes
    Dec 4, 2012 at 2:16
  • 5
    Every time I visit the site, Paulo has built something new and awesome.
    – Seamus
    Dec 5, 2012 at 17:21

1 Answer 1

38

I believe to express a general feeling by saying:

Welcome to TeX.SX, Psmith! :)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .