Skip to content
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

Support for slack events #1451

Open
wants to merge 62 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
62 commits
Select commit Hold shift + click to select a range
9555627
Initial support for slack events
AgarFu Sep 7, 2020
dcf7306
Reusing the slack_rtm.py methods
AgarFu Sep 7, 2020
709d174
Removing temporal patches
AgarFu Sep 7, 2020
1a991b0
Refactoring SlackRTM
AgarFu Sep 7, 2020
e0fa7d1
Merge branch 'no_enough_permissions' into slack_event_api_support
AgarFu Sep 7, 2020
5facafe
Merge branch 'master' of https://github.com/errbotio/errbot into no_e…
AgarFu Nov 8, 2020
277376f
Fixing deprecation errors
AgarFu Nov 9, 2020
814536e
Merge branch 'master' of https://github.com/errbotio/errbot into slac…
AgarFu Nov 9, 2020
63a5fa7
Merge branch 'no_enough_permissions' into slack_event_api_support
AgarFu Nov 9, 2020
882e097
Refactoring SlackRTM
AgarFu Sep 7, 2020
930db2a
fixed rendering issue in docs (#1452)
torgeirl Sep 10, 2020
a373b57
fix: merging configs via --storage-merge cli (#1450)
sijis Sep 10, 2020
d4c20ed
Added email property for slack backend SlackPerson class (#1186)
aaugustinas Sep 28, 2020
22ddf1c
fix: Add missing email property to backends (#1456)
sijis Oct 6, 2020
ee1f27c
chore: Add github actions (#1455)
sijis Oct 6, 2020
d7197c8
chore: update changelog and vcheck for 6.1.5
sijis Oct 10, 2020
2d1250f
fix: Add content type to package long description
sijis Oct 10, 2020
c310e22
fix: Set email property as non-abstract (#1461)
sijis Oct 16, 2020
f55d804
fix: username to userid method signature (#1458)
sijis Oct 17, 2020
b88a75d
fix: AttributeError in callback_reaction (#1467)
sijis Oct 22, 2020
622928e
docs: fix webhook examples (#1471)
sijis Oct 26, 2020
93b050a
fix: merging configs via cli with unknown keys (#1470)
sijis Oct 27, 2020
a4766e1
Fix error when plugin plug file is missing description (#1462)
bribroder Oct 27, 2020
4509b4e
docs: Fix typographical issues in setup guide (#1475)
e4r7hbug Nov 1, 2020
7ecd741
Update code to support markdown 3 (#1473)
b1rger Nov 4, 2020
6f0d91f
refactor: Split changelog by major versions (#1474)
sijis Nov 4, 2020
625411e
Fixing deprecation errors
AgarFu Nov 9, 2020
83b4108
chore: update changelog and vcheck for 6.1.6
sijis Nov 17, 2020
32e9a82
Allow dependabot to check GitHub actions weekly (#1464)
jlosito Nov 19, 2020
e15cd14
Enable testing using Python 3.9 (#1477)
nzlosh Nov 19, 2020
1529be0
Rename backend to slack_sdk to reflect the underlying module and the …
nzlosh Nov 23, 2020
8b94e66
blacken code
nzlosh Nov 23, 2020
caeaad9
Declare module dependencies.
nzlosh Nov 23, 2020
d7611ab
Mash-up slack backends.
nzlosh Nov 23, 2020
269b286
Include aiohttp dependency for slacksdk.
nzlosh Nov 24, 2020
d9d6407
Removed SlackRTMBackend from slack_sdk.py since it breaks errbot back…
nzlosh Nov 24, 2020
c0b1275
Completely merge events errbot into base class.
nzlosh Nov 24, 2020
2727da6
Fixed reference to SlackBackend class.
nzlosh Nov 24, 2020
e632485
Provide a fake serveonce method to satisfy Errbot API contract.
nzlosh Nov 24, 2020
45f5ecc
Use base class message limit methods.
nzlosh Nov 24, 2020
b93732d
Include missing module.
nzlosh Nov 24, 2020
afa67e7
Temporarily use configuration setting to indicate the slack api to use.
nzlosh Nov 25, 2020
88cfbf3
Merge branch 'master' into slack_event_api_support
nzlosh Nov 25, 2020
c950d55
Merge branch 'slack_event_api_support' of https://github.com/AgarFu/e…
nzlosh Nov 25, 2020
1ffdacc
Align backend variable names with slacksdk names.
nzlosh Nov 25, 2020
6e4ebdd
Clean up established network connection when backend is shutdown.
nzlosh Nov 26, 2020
23768b4
Merge branch 'master' of https://github.com/errbotio/errbot into coop…
AgarFu Nov 26, 2020
7a33fe8
Merge remote-tracking branch 'carlos/slack_event_api_support' into sl…
AgarFu Nov 26, 2020
821ee6a
Merge pull request #2 from AgarFu/slack_event_api_refactor
AgarFu Nov 26, 2020
c5dad0d
Skipping slack tests
AgarFu Nov 27, 2020
b69f3f5
Merge branch 'slack_event_api_support' of https://github.com/AgarFu/e…
AgarFu Nov 27, 2020
43cc136
Fixing codestyle
AgarFu Nov 27, 2020
ebe28b9
Codestyle
AgarFu Nov 27, 2020
a57050a
Refactor started, added test for slack markdown infrastructure
AgarFu Nov 27, 2020
cce5e9c
Making codestyle happy again
AgarFu Nov 27, 2020
38ded3f
Making codestyle happy
AgarFu Nov 27, 2020
3ce8dcf
Installing slack_sdk for tests
AgarFu Nov 27, 2020
c684a2a
Testing channel name
AgarFu Nov 27, 2020
f65c444
Not implemented error
AgarFu Nov 27, 2020
8670371
Refactoring to optimize the cache and reduce duplications
AgarFu Nov 27, 2020
72eacc7
Small refactor, done testing SlackPerson
AgarFu Nov 27, 2020
53db013
100% coverage for person
AgarFu Nov 27, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
fix: Add missing email property to backends (#1456)
  • Loading branch information
sijis authored and nzlosh committed Nov 24, 2020
commit 22ddf1ccf220aafacd8a7e1c5131de5b8f44ff06
5 changes: 5 additions & 0 deletions errbot/backends/irc.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ class IRCPerson(Person):

def __init__(self, mask):
self._nickmask = NickMask(mask)
self._email = ''

@property
def nick(self):
Expand All @@ -99,6 +100,10 @@ def fullname(self):
# TODO: this should be possible to get
return None

@property
def email(self):
return self._email

@property
def aclattr(self):
return IRCBackend.aclpattern.format(nick=self._nickmask.nick,
Expand Down
12 changes: 12 additions & 0 deletions errbot/backends/slack_rtm.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ def __init__(self, webclient: WebClient, userid=None, channelid=None):
self._username = None # cache
self._fullname = None
self._channelname = None
self._email = None

@property
def userid(self):
Expand Down Expand Up @@ -189,6 +190,17 @@ def fullname(self):

return self._fullname

@property
def email(self):
"""Convert a Slack user ID to their user email"""
user = self._webclient.users_info(user=self._userid)['user']
if user is None:
log.error("Cannot find user with ID %s" % self._userid)
return "<%s>" % self._userid

email = user["profile"]["email"]
return email

def __unicode__(self):
return f'@{self.username}'

Expand Down
5 changes: 5 additions & 0 deletions errbot/backends/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ def __init__(self, person, client=None, nick=None, fullname=None):
self._client = client
self._nick = nick
self._fullname = fullname
self._email = ''

@property
def person(self):
Expand All @@ -66,6 +67,10 @@ def nick(self):
def fullname(self):
return self._fullname

@property
def email(self):
return self._email

@property
def aclattr(self):
return str(self)
Expand Down
5 changes: 5 additions & 0 deletions errbot/backends/xmpp.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ def __init__(self, node, domain, resource):
self._node = node
self._domain = domain
self._resource = resource
self._email = ''

@property
def node(self):
Expand All @@ -68,6 +69,10 @@ def nick(self):
def fullname(self):
return None # Not supported by default on XMPP.

@property
def email(self):
return self._email

@property
def client(self):
return self._resource
Expand Down