You are viewing a single comment's thread from:

RE: first attempt at a discord bot with nodejs

in #palnet6 years ago (edited)

this morning I decided to see if I could get a telegram bot operating-I just left it as the demo starter version. just went through telegram's bot father, installed the npm package for telegram, then ran a hello world program and gave it a quick run.

to get started you join the botfather channel.
https://telegram.me/botfather
type /start
type /newbot


discover every name you think of has been taken

until you chose something stupid and you get your api/token key.

the npm pacjage for telegram with code example
https://github.com/yagop/node-telegram-bot-api/blob/master/examples/game/game.js

Be sure to copy and paste the code example from this page, and store it as a file in the folder you are going to work with.

do the npm [file.js] on the command line in your work[ing] folder, and you can play with the bot. The started bot allows you to dm it, and will also respond each time it sees "/echo". Of course you can expand its vocabulary to do other things.

I think it should be possible to have one script interacting with multiple platforms if one script is allowed to control to multiple bot instances, but I digress.

Sort:  

Oh yeah, you also need to create your own room. To create your own room, you have to invite a user. So either invite an image bot, or your own bot. Kind of lame that telegram requires you to invite someone to create a group.

Ultimately you need to invite your bot to your room to play with it.