Now private and public channels are loaded (#1222)

Fixes #1210
This commit is contained in:
Ricardo Espinoza 2020-12-02 06:54:19 -05:00 committed by GitHub
parent a38665e82c
commit 1b724db3c2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 3 deletions

View file

@ -12,6 +12,9 @@ const userScopes = [
'stars:write',
'users.profile:read',
'users.profile:write',
'groups:read',
'im:read',
'mpim:read',
];
export class SlackOAuth2Api implements ICredentialType {

View file

@ -35,7 +35,6 @@ export async function slackApiRequest(this: IExecuteFunctions | IExecuteSingleFu
delete options.qs;
}
try {
let response: any; // tslint:disable-line:no-any
if (authenticationMethod === 'accessToken') {

View file

@ -217,7 +217,8 @@ export class Slack implements INodeType {
// select them easily
async getChannels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const channels = await slackApiRequestAllItems.call(this, 'channels', 'GET', '/conversations.list');
const qs = { types: 'public_channel,private_channel' };
const channels = await slackApiRequestAllItems.call(this, 'channels', 'GET', '/conversations.list', {}, qs);
for (const channel of channels) {
const channelName = channel.name;
const channelId = channel.id;
@ -240,7 +241,6 @@ export class Slack implements INodeType {
async getTeamFields(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]> {
const returnData: INodePropertyOptions[] = [];
const { profile: { fields } } = await slackApiRequest.call(this, 'GET', '/team.profile.get');
console.log(fields);
for (const field of fields) {
const fieldName = field.label;
const fieldId = field.id;