Skip to content
This repository has been archived by the owner on Jul 3, 2020. It is now read-only.

Commit

Permalink
Add migration.exchange method
Browse files Browse the repository at this point in the history
  • Loading branch information
os committed Apr 25, 2019
1 parent 4218777 commit f1bd88f
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion slacker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
'UserGroups', 'UserGroupsUsers', 'MPIM', 'OAuth', 'DND', 'Bots',
'FilesComments', 'Reminders', 'TeamProfile', 'UsersProfile',
'IDPGroups', 'Apps', 'AppsPermissions', 'Slacker', 'Dialog',
'Conversations']
'Conversations', 'Migration']


class Error(Exception):
Expand Down Expand Up @@ -1067,6 +1067,16 @@ def end_snooze(self):
return self.post('dnd.endSnooze')


class Migration(BaseAPI):
def exchange(self, users, to_old=False):
if isinstance(users, (list, tuple)):
users = ','.join(users)

return self.get(
'migration.exchange', params={'users': users, 'to_old': to_old}
)


class Reminders(BaseAPI):
def add(self, text, time, user=None):
return self.post('reminders.add', data={
Expand Down Expand Up @@ -1203,6 +1213,7 @@ def __init__(self, token, incoming_webhook_url=None,
self.channels = Channels(**api_args)
self.presence = Presence(**api_args)
self.reminders = Reminders(**api_args)
self.migration = Migration(**api_args)
self.reactions = Reactions(**api_args)
self.idpgroups = IDPGroups(**api_args)
self.usergroups = UserGroups(**api_args)
Expand Down

0 comments on commit f1bd88f

Please sign in to comment.