-
Notifications
You must be signed in to change notification settings - Fork 911
How do I make the bot send custom messages? #302
Comments
The code you will want to add will go in the OnMessage Function. What you want to do is add if and else if statements to read the message and see what it is. For example: Then if you wanted to add more situations, just add else if's for other things the user might say |
Look at the OnMessage and OnTradeMessage methods in the AdminUserHandler or equivalent handlers. |
Huh, still having problems with it. Can you explain where I have to put it? |
It will go inside the OnMessage function |
Uh should it look like this? I think i've made it wrong because it doesn't work :c public override void OnMessage (string message, EChatEntryType type) |
You have now 2 responses in the method, you can delete the default one "Bot.SteamFriends.SendChatMessage(OtherSID, type, Bot.ChatResponse);" And why doesn't it work? compiler error or is the bot not responding? also note this is for a steam chat response when talking through friends. |
What I would suggest is to, after you have included all of your custom responses, end with an else that responds with the default greeting. Also, like StormReaper said, this wont' work if you are messaging the bot while in a trade. For that you would have to use the OnTradeMessage function |
Thanks to both of you I finally managed it. Thanks c: |
Hello there. Just wanted to ask how to make the bot sending custom messages? I mean, if the user say "Hello there", the bot should say something like "What's up?"
The text was updated successfully, but these errors were encountered: