Skip to content

Commit

Permalink
misc: improve bot messages
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinKolarik committed Oct 23, 2024
1 parent 4577ad0 commit b49e0fb
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
7 changes: 5 additions & 2 deletions packages/bot-utils/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -255,10 +255,13 @@ traceroute jsdelivr.com from Paris --port 453
export const authHelpTexts = {
preamble: `Authenticate with the Globalping API for higher measurements limits.
Available Commands:
**Available Commands:**
\`\`\`
login Log in to your Globalping account
logout Log out from your Globalping account
status Check the current authentication status`,
status Check the current authentication status
\`\`\`
`,
usage: (rootCommand: string) => `${rootCommand} auth [command]`,
flags: ' -h, --help Help for auth',
};
Expand Down
4 changes: 2 additions & 2 deletions packages/slack/src/auth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ export class OAuthClient {
try {
await this.slackClient.chat.postEphemeral({
token: installation?.bot?.token,
text: `Failed to authorize: ${callbackError}: ${errorDescription}`,
text: `Authentication failed: ${callbackError}: ${errorDescription}`,
user: session.userId,
channel: session.channelId,
thread_ts: session.threadTs,
Expand Down Expand Up @@ -340,7 +340,7 @@ export class OAuthClient {
let message = '';
if (exchangeError) {
this.logger.error(exchangeError, '/oauth/callback failed');
message = `Failed to authorize: ${exchangeError.error}: ${exchangeError.error_description}`;
message = `Authentication failed: ${exchangeError.error}: ${exchangeError.error_description}`;
} else {
message = 'Success! You are now authenticated.';
}
Expand Down
4 changes: 2 additions & 2 deletions packages/slack/src/post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ async function authLogin(client: WebClient, payload: ChannelPayload) {
type: 'section',
text: {
type: 'mrkdwn',
text: `Click <${res.url}|here> to authenticate`,
text: `Please <${res.url}|click here> to authenticate.`,
},
},
],
Expand All @@ -161,7 +161,7 @@ async function authStatus(client: WebClient, payload: ChannelPayload) {
}
text =
introspection && introspection.active
? `Logged in as ${introspection?.username}`
? `Logged in as ${introspection?.username}.`
: 'Not logged in.';
await client.chat.postEphemeral({
text,
Expand Down

0 comments on commit b49e0fb

Please sign in to comment.