12-15-2013, 06:12 AM
This thread is for creating personal messaging commands for your chatango bot.
Here we go;
When making the bot class if you want personal messaging commands you're going to want to have this code in your class:
This just lets us know when people personal message the bot. It will automatically respond, but I use this feature more of cleaning up people who spam the bot.
Now onPMMessage is different from onMessage.
For example; you can't put message.body if you were going to make the messages in the prompt for the bot, that's onMessage specific. We're going to use JUST body.
Now we already added this, but I only re-added this to reference this.
You can't put used_prefix or of that sort. In the onPMMessage case you would have to use the startswith method.
That's the "ily" pm command. Now if you noticed we put "user, ...". This declares who to send the message to.
So I've compiled a few basic commands to give you guys an example.
Here's an image that shows how it works if you're still confused:
You can do as many as you want, the only restriction to my knowledge AS OF THIS THREAD is that you cannot have spaces.
That should be good. Alright people, bye.
~Dub out
#UPDATE#
I tested having spaces between words, and yes you can.
Here we go;
When making the bot class if you want personal messaging commands you're going to want to have this code in your class:
Hidden Content
This just lets us know when people personal message the bot. It will automatically respond, but I use this feature more of cleaning up people who spam the bot.
Now onPMMessage is different from onMessage.
For example; you can't put message.body if you were going to make the messages in the prompt for the bot, that's onMessage specific. We're going to use JUST body.
Hidden Content
Now we already added this, but I only re-added this to reference this.
You can't put used_prefix or of that sort. In the onPMMessage case you would have to use the startswith method.
Hidden Content
That's the "ily" pm command. Now if you noticed we put "user, ...". This declares who to send the message to.
So I've compiled a few basic commands to give you guys an example.
Here's an image that shows how it works if you're still confused:
You can do as many as you want, the only restriction to my knowledge AS OF THIS THREAD is that you cannot have spaces.
Hidden Content
That should be good. Alright people, bye.
~Dub out
#UPDATE#
I tested having spaces between words, and yes you can.