alejandro5042 / Run-IrcBot

IRC Bot Toolkit for PowerShell
MIT License
13 stars 4 forks source link

Text from script #8

Open fak0r opened 10 years ago

fak0r commented 10 years ago

Hi :)

Is it possible to send text to the bot from an external script?

e.g. ./mybot.ps1 -text "my fancy text" -channel "mychannel" The Bot will then post "my fancy text" on "mychannel"

Could be usefull as an rss-reader or something like that

alejandro5042 commented 10 years ago

Yes! You can do that. Basically, you can write a new bot that connects to the IRC server and sends a private message to your existing bot. Your existing bot will need to listen to messages that are not from a specific channel. All this information is in the $Message object. You can pass in custom data to your bot on the command-line by the -State switch that places that object in the $Bot.State object. This object can be anything, such as the message you want the bot to send and the username of the other bot you wish to send to (you can use a hash). You can wrap this bot up in a custom script too, and inline your actual bot script with the -BotScript argument. You can get as fancy as you want!

alejandro5042 commented 10 years ago

Here's another option.... you can have your bot join another channel that you monitor, for instance by sending /join #devchannel You can send your bot instructions through this channel or private message channel. I've done that for development.

HumanEquivalentUnit commented 8 years ago

10 is a possible response to this issue.