-
-
Notifications
You must be signed in to change notification settings - Fork 775
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add slack bot integration #934
Conversation
app/dashboard/notifications.py
Outdated
return False | ||
return True | ||
|
||
def build_message_for_slack(bounty, event_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
app/dashboard/notifications.py
Outdated
title = bounty.title if bounty.title else bounty.github_url | ||
msg = f"{event_name.replace('bounty', 'funded_issue')} worth {round(bounty.get_natural_value(), 4)} {bounty.token_name} " \ | ||
f"{usdt_details}" \ | ||
f"{bounty.token_name}: {title} \n\n{bounty.get_absolute_url()}" | ||
return msg | ||
|
||
def maybe_market_to_user_slack(bounty, event_name): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
app/dashboard/notifications.py
Outdated
sc.api_call("chat.postMessage", channel=channel, text=msg) | ||
username = uri_array[1] | ||
repo = uri_array[2] | ||
subscribers = EmailSubscriber.objects.filter(profile__handle=username, repos__contains=[repo]).exclude(slack_token='', slack_channel='') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (144 > 120 characters)
migrations.AddField( | ||
model_name='emailsubscriber', | ||
name='repos', | ||
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, default=[], size=None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E501 line too long (140 > 120 characters)
app/marketing/views.py
Outdated
@@ -614,6 +618,43 @@ def email_settings(request, key): | |||
} | |||
return TemplateResponse(request, 'settings/email.html', context) | |||
|
|||
def slack_settings(request): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E302 expected 2 blank lines, found 1
Codecov Report
@@ Coverage Diff @@
## master #934 +/- ##
==========================================
- Coverage 33.45% 33.14% -0.31%
==========================================
Files 100 100
Lines 6238 6305 +67
Branches 755 765 +10
==========================================
+ Hits 2087 2090 +3
- Misses 4045 4109 +64
Partials 106 106
Continue to review full report at Codecov.
|
model_name='emailsubscriber', | ||
name='repos', | ||
field=django.contrib.postgres.fields.ArrayField(base_field=models.CharField(max_length=200), blank=True, | ||
default=[], size=None), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
E128 continuation line under-indented for visual indent
- send same messages to user's slack as to gitcoin's slack Fixes: gitcoinco#259
fbbe8cc
to
aae7d84
Compare
Checklist
Affected core subsystem(s)
Testing
Tested manually
Refers/Fixes
Fixes: #259