alexames / DeltaBot

GNU General Public License v3.0
65 stars 18 forks source link

Auto-PM a user when they receive their first delta. #2

Closed Snorrrlax closed 11 years ago

Snorrrlax commented 11 years ago

Here's a draft:


Congratulations; you've earned your first delta!

As you may already know, a delta (∆) is given when a comment has changed someone's view. For a more detailed explanation of the delta system, see here.

/u/DeltaBot has updated your user flair and created your own wiki page which will be updated every time you earn a delta. If you do well, you may find yourself on our leaderboards (the monthly one is also featured in our sidebar).

Good luck, and happy CMVing!


PixelOrange commented 11 years ago

The below code has not been tested. Also, DeltaBot will need a link karma of at least 3 for this code to work properly. Otherwise, he will fail captcha. Please test before implementing.

Change lines 122-124 to:

else:
    points = 0
    send_first_time_message(parent)
    css_class = ''

Add function:

send_first_time_message(self, parent):
    self.reddit.send_message(parent.author.name, "Congratulations on your first delta!", self.config.private_message)
Snorrrlax commented 10 years ago

This isn't currently up and running, although I seem to remember the code being added to the script? Either way, DeltaBot's not sending out first-delta-PMs.

PixelOrange commented 10 years ago

It is, just not every time. Probably a flaw in how deltabot is detecting first time PMs, but when it detects it is properly sending them out.

Log in to deltabot and see here: http://www.reddit.com/message/messages/1qx39f

I will open a separate issue for first-time-delta detection.