Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 345 Vote(s) - 3.48 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ermergerd. ANOTHER CHATANGO THREAD

#1
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:


Hidden Content
You must

[To see links please register here]

or

[To see links please register here]

to view this 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
You must

[To see links please register here]

or

[To see links please register here]

to view this 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
You must

[To see links please register here]

or

[To see links please register here]

to view this 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:

[Image: 2zg5aog.jpg]

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
You must

[To see links please register here]

or

[To see links please register here]

to view this content.

That should be good. Alright people, bye.
~Dub out


#UPDATE#

I tested having spaces between words, and yes you can.
Reply

#2

[To see links please register here]

, this is a PM function that uses PandoraBots and a delay based on average WPM to simulate a real person replying.

Untested for like, half a year. And also really shitty uncommented code, lets not talk about this era please. >>;

Requires you to import "urllib.parse", "urllib.request", "re", and "queue" if you've not done so already.
Reply

#3
Quote:(12-15-2013, 03:24 PM)Anizeb Wrote:

[To see links please register here]

Requires you to import "urllib.parse", "urllib.request", and "re" if you've not done so already.

Tested on Intellect.

Traceback (most recent call last):
File "C:\Users\Grayson\Desktop\Intellect\Intellect.py", line 165, in onPMMessage
que2 = queue.Queue()
NameError: global name 'queue' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:\Users\Grayson\Desktop\Intellect\Intellect.py", line 584, in <module>
Intellect.easy_start(rooms, "Intellect", password)
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 3247, in easy_start
self.main()
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 3214, in main
con._feed(data)
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 578, in _feed
self._process(food.decode("latin-1").rstrip("\r\n")) #numnumz ;3
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 608, in _process
getattr(self, func)(args)
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 700, in rcmd_msg
self._callEvent("onPMMessage", user, body)
File "C:\Users\Grayson\Desktop\Intellect\ch.py", line 868, in _callEvent
getattr(self.mgr, evt)(self, *args, **kw)
File "C:\Users\Grayson\Desktop\Intellect\Intellect.py", line 173, in onPMMessage
print("\n"+e+"\n")
TypeError: Can't convert 'NameError' object to str implicitly
Reply

#4
Must have missed something, gimme a minute.

Edit; queue is a module, add "import queue", should work.\
Edit; Updated post to correct my mistakes.
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through