Skip to content

Commit

Permalink
Fix aws-ts-slackbot compilation and cleanup unused code
Browse files Browse the repository at this point in the history
  • Loading branch information
thomas11 committed Oct 23, 2023
1 parent 557beb8 commit 02f2bb6
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions aws-ts-slackbot/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ interface Event {
}

const handler = new aws.lambda.CallbackFunction("handler", {
callback: async (event) => {
callback: async (ev) => {
try {
if (!slackToken) {
throw new Error("mentionbot:slackToken was not provided");
Expand All @@ -78,6 +78,7 @@ const handler = new aws.lambda.CallbackFunction("handler", {
throw new Error("mentionbot:verificationToken was not provided");
}

const event = <any>ev;
if (!event.isBase64Encoded || event.body == null) {
console.log("Unexpected content received");
console.log(JSON.stringify(event));
Expand Down Expand Up @@ -183,9 +184,6 @@ async function onMessageEventCallback(request: EventCallbackRequest) {
return;
}

const dynoClient = new dynamoClient.DynamoDBClient({});
const client = dynamoLib.DynamoDBDocumentClient.from(dynoClient);

// There might be multiple @mentions to the same person in the same message.
// So make into a set to make things unique.
for (const match of new Set(matches)) {
Expand Down

0 comments on commit 02f2bb6

Please sign in to comment.