Skip to content

Instantly share code, notes, and snippets.

View WilliamBergamin's full-sized avatar

William Bergamin WilliamBergamin

  • Slack
  • Montreal, Canada
  • 21:31 (UTC -04:00)
View GitHub Profile
@WilliamBergamin
WilliamBergamin / app.py
Created January 24, 2025 22:15
Custom Fields With Dynamic Options
import json
import logging
import os
from typing import List, NotRequired, TypedDict
from slack_bolt import Ack, App, Complete, Fail, Say
from slack_bolt.adapter.socket_mode import SocketModeHandler
from slack_sdk import WebClient
logging.basicConfig(level=logging.INFO)
@WilliamBergamin
WilliamBergamin / downloads.py
Created January 13, 2025 21:15
Python package download statistics
import requests
import sys
from typing import Dict, TypedDict
relevant_python_versions = ["3.6", "3.7", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13"]
allowed_pkg_names = ["slack_sdk", "slack_bolt", "slack_cli_hooks"]
pkg_name = allowed_pkg_names[0]
if len(sys.argv) >= 2:
if sys.argv[1] not in allowed_pkg_names:
@WilliamBergamin
WilliamBergamin / .env
Last active November 25, 2024 19:46
test-update-image-block
CHANNEL_ID=<your channel id>
SLACK_BOT_TOKEN=<you bot token>
IMAGE_PATH=<path to original file>
UPDATE_IMAGE_PATH=<path to the file that will update the image block>
@WilliamBergamin
WilliamBergamin / app.py
Last active March 13, 2024 05:25
MVP python function handler
import logging
from slack_sdk import WebClient
from slack_bolt import App, Ack, Say, Complete, Fail, BoltContext
from slack_bolt.adapter.socket_mode import SocketModeHandler
logging.basicConfig(level=logging.DEBUG)
app = App()