Skip to content

Commit c2db396

Browse files
danishiclaude
andauthored
feat: make reaction emojis configurable via environment variables (#8)
Add REACTION_PROCESSING and REACTION_COMPLETED environment variables to allow customizing the emoji reactions for processing and completion. Defaults to "eyes" and "white_check_mark" respectively. https://claude.ai/code/session_0161Zkff8QojLyz6G43hvQjL Co-authored-by: Claude <noreply@anthropic.com>
1 parent 9837102 commit c2db396

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

.env.example

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,5 @@ GOOGLE_CLOUD_PROJECT="your-gcp-project"
66
GOOGLE_CLOUD_LOCATION="global"
77
CLOUD_RUN_LOCATION="asia-northeast1"
88
MODEL_NAME="gemini-3.1-pro-preview"
9+
REACTION_PROCESSING="eyes"
10+
REACTION_COMPLETED="white_check_mark"

app/main.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,8 @@
2626
MODEL_NAME = os.environ.get("MODEL_NAME", "gemini-3.1-pro-preview")
2727
ALLOWED_SLACK_WORKSPACE = os.environ.get("ALLOWED_SLACK_WORKSPACE")
2828
APP_NAME = os.environ.get("APP_NAME", "slack-bot")
29+
REACTION_PROCESSING = os.environ.get("REACTION_PROCESSING", "eyes")
30+
REACTION_COMPLETED = os.environ.get("REACTION_COMPLETED", "white_check_mark")
2931

3032
# Initialize Slack Bolt AsyncApp
3133
bolt_app = AsyncApp(token=SLACK_BOT_TOKEN, signing_secret=SLACK_SIGNING_SECRET)
@@ -201,7 +203,7 @@ async def handle_mention(body, say, client, logger, ack):
201203

202204
# Add 👀 reaction to indicate the message is being processed
203205
try:
204-
await client.reactions_add(channel=channel, timestamp=message_ts, name="eyes")
206+
await client.reactions_add(channel=channel, timestamp=message_ts, name=REACTION_PROCESSING)
205207
except Exception:
206208
pass
207209

@@ -254,7 +256,7 @@ async def handle_mention(body, say, client, logger, ack):
254256

255257
# Add ✅ reaction to indicate the reply is complete
256258
try:
257-
await client.reactions_add(channel=channel, timestamp=message_ts, name="white_check_mark")
259+
await client.reactions_add(channel=channel, timestamp=message_ts, name=REACTION_COMPLETED)
258260
except Exception:
259261
pass
260262

scripts/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ SERVICE_URL=$(gcloud run deploy "${SERVICE_NAME}" \
6565
--allow-unauthenticated \
6666
--no-cpu-throttling \
6767
--project "${PROJECT_ID}" \
68-
--set-env-vars "SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN},SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET},GOOGLE_GENAI_USE_VERTEXAI=${GOOGLE_GENAI_USE_VERTEXAI},GOOGLE_CLOUD_PROJECT=${PROJECT_ID},GOOGLE_CLOUD_LOCATION=global,ALLOWED_SLACK_WORKSPACE=${ALLOWED_SLACK_WORKSPACE:-},MODEL_NAME=${MODEL_NAME:-gemini-3.1-pro-preview}" \
68+
--set-env-vars "SLACK_BOT_TOKEN=${SLACK_BOT_TOKEN},SLACK_SIGNING_SECRET=${SLACK_SIGNING_SECRET},GOOGLE_GENAI_USE_VERTEXAI=${GOOGLE_GENAI_USE_VERTEXAI},GOOGLE_CLOUD_PROJECT=${PROJECT_ID},GOOGLE_CLOUD_LOCATION=global,ALLOWED_SLACK_WORKSPACE=${ALLOWED_SLACK_WORKSPACE:-},MODEL_NAME=${MODEL_NAME:-gemini-3.1-pro-preview},REACTION_PROCESSING=${REACTION_PROCESSING:-},REACTION_COMPLETED=${REACTION_COMPLETED:-}" \
6969
--format 'value(status.url)')
7070

7171
echo "--------------------------------------------"

0 commit comments

Comments
 (0)