Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
setName: () => {},
debug: (msg: string) => {
// non-ideal way to detect calls to slack.
webLog.debug.bind(webLog);
if (!this.onRemoteCall) { return; }
const match = /apiCall\('([\w\.]+)'\) start/.exec(msg);
if (match && match[1]) {
this.onRemoteCall(match[1]);
}
webLog.debug(msg);
},
warn: webLog.warn.bind(webLog),
info: webLog.info.bind(webLog),
error: webLog.error.bind(webLog),
} as Logger,
logLevel: LogLevel.DEBUG,
...opts,
});
try {
const teamInfo = (await slackClient.team.info()) as TeamInfoResponse;
const auth = (await slackClient.auth.test()) as AuthTestResponse;
const user = (await slackClient.users.info({user: auth.user_id})) as UsersInfoResponse;
log.debug("Created new team client for", teamInfo.team.name);
return { slackClient, team: teamInfo.team, auth, user };
} catch (ex) {
throw Error("Could not create team client: " + ex.data.error);
}
}
}
getLevel: () => LogLevel.DEBUG,
setLevel: () => {}, // We don't care about these.