Skip to content

Commit

Permalink
Add delay to slackbot ping (forem#1086)
Browse files Browse the repository at this point in the history
  • Loading branch information
benhalpern authored and maestromac committed Nov 8, 2018
1 parent 1ae463b commit 1d69b56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/observers/application_observer.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
class ApplicationObserver < ActiveRecord::Observer
def warned_user_ping(activity)
if activity.user.warned == true
SlackBot.ping "@#{activity.user.username} just posted.\nThey've been warned since #{activity.user.roles.where(name: 'warned')[0].updated_at.strftime('%d %B %Y')}\nhttps://dev.to#{activity.path}",
SlackBot.delay.ping "@#{activity.user.username} just posted.\nThey've been warned since #{activity.user.roles.where(name: 'warned')[0].updated_at.strftime('%d %B %Y')}\nhttps://dev.to#{activity.path}",
channel: "warned-user-activity",
username: "sloan_watch_bot",
icon_emoji: ":sloan:"
Expand Down

0 comments on commit 1d69b56

Please sign in to comment.