Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
PythonでSlack通知botを作る
Search
Ryosuke Uchiyama
April 04, 2024
Technology
23
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
PythonでSlack通知botを作る
Ryosuke Uchiyama
April 04, 2024
More Decks by Ryosuke Uchiyama
See All by Ryosuke Uchiyama
AWSでサーバレスな書籍管理アプリを作る
step63r
0
61
ChatGPT実践
step63r
1
390
IoT実践! 行先予定表を電子ペーパーで作る
step63r
0
45
React x Socket.ioで人狼サーバを作る 第一章 フロントエンド実装
step63r
0
32
深層強化学習で東方AI 第一章 DQNの基本
step63r
0
320
Build 2021 プレイバック
step63r
0
42
WPFで実践アプリ開発! 第四章 機能の実装 Part 2
step63r
0
61
WPFで実践アプリ開発! 第三章 機能の実装 Part 1
step63r
0
140
WPFで実践アプリ開発! 第二章 UI
step63r
0
180
Other Decks in Technology
See All in Technology
Genie Code ワークショップ 応用編 / Genie-Code-Workshop-advanced
databricksjapan
PRO
0
360
Sony-DroidKaigi2026
sony
1
320
When Does a Local Qwen Start to Break
morshoto
0
180
振り返りこそエンジニアの本領
negima
0
320
2026/09/10 Spring_Bootから_Jakarta_EE_MicroProfileへの移行
megascus
0
150
AndroidでHDRメディアを「壊さずに」扱う
chigichan24
0
410
こんなアーキテクチャ図は嫌だ BEYOND THE TIME: 半年後の自分へ贈る15のメッセージ / 15 of Anti-pattern in AWS Architecture Diagrams
naospon
3
260
スクラムで身についていた動き方を、XPで捉え直してみた
codmoninc
PRO
1
250
Nav2、Nav3 ... はたまた自作?〜 作って理解する Nav3 の設計意図 〜 / Nav2, Nav3 ... or Build Your Own? — Understanding Nav3's design intent by building it from scratch
yanzm
0
250
なぜSRE・セキュリティは評価されないのか?守りの組織を事業成長エンジンに変えた実践
cscengineer
PRO
3
2.3k
WAF 運用改善の承認サイクル/SRE_BizReach_MIXI_1
visional_engineering_and_design
1
310
grill-me(grilling):AI駆動開発を超助けてくれるSkill / grill me
mathbullet
0
110
Featured
See All Featured
We Analyzed 250 Million AI Search Results: Here's What I Found
joshbly
1
1.9k
The Director’s Chair: Orchestrating AI for Truly Effective Learning
tmiket
1
290
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
2
1.8k
Improving Core Web Vitals using Speculation Rules API
sergeychernyshev
21
1.6k
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
490
Typedesign – Prime Four
hannesfritz
42
3.2k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
520
Build your cross-platform service in a week with App Engine
jlugia
234
19k
The Curious Case for Waylosing
cassininazir
1
500
Future Trends and Review - Lecture 12 - Web Technologies (1019888BNR)
signer
PRO
0
3.7k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Automating Front-end Workflow
addyosmani
1369
210k
Transcript
PythonでSlack通知botを作る Ryosuke Uchiyama 1 © 2023 minato project. step63r step63r
2 AGENDA © 2023 minato project. 1. 概要 • 作るもの
• 前提知識 • 開発環境 • Webhookとは 2. 実践 • Slackでアプリを作成する • Pythonでプログラムを書く • Azureにデプロイする
1. 概要 3 © 2023 minato project. Overview
4 作るもの © 2023 minato project. • 毎朝9時にその日の東京の天気をSlackにお知らせするbotを作ります • 気象情報の取得にはOpen-Meteoを利用します
• プログラムのデプロイ先はAzureとします Open-MeteoのAPI仕様は こちら をご確認ください。 タイマーイベント 天気を通知 Azure Functions Slack データ取得
前提知識 © 2023 minato project. 5 • HTTP通信の基礎知識 • Python
(3.7以降) の基本構文 • Slackの操作方法 • Azureの基礎知識
開発環境 © 2023 minato project. 6 • Windows 11 Pro
23H2 • Visual Studio Code • Azure Tools v1.2.0 • Azurite v3.29.0 • Python v2024.2.1 • Python 3.11.2 • Azure Functions Core Tools 4.0.5441
Webhookとは © 2023 minato project. 7 • アプリケーションの更新情報を他のアプリケーションへリアルタイム提供する仕組みや概念のこと。 • イベント(リポジトリにプッシュなど)発生時、指定したURLにPOSTリクエストする仕組みのこと。
git push等 Webhook通知 Webhookとは? #初心者 - Qiita GitHub Slack
2. 実践 8 © 2023 minato project. Practice
9 Slackでアプリを作成する © 2023 minato project. 1. あらかじめSlackのアカウントとワークスペースを作成しておく 2. Slack
APIにアクセスする 3. 「Create an App」を押下する 4. 「From scratch」→ 名前とワークスペースを入力・選択し「Create App」を押下する 5. 「Incoming Webhooks」→「Activate Incoming Webhooks」を「On」にする 6. 「Add New Webhook to Workspace」を選択、投稿先のチャンネルを選択し「許可する」を押下する 7. 「Sample curl request to post a channel」のコードをコピーし、PowerShellに貼り付け、実行 8. 設定したチャンネルに投稿がされていれば設定完了
10 Pythonでプログラムを書く © 2023 minato project. step63r/uchi-notify-weather-slack-bot https://github.com/step63r/uchi-notify-weather-slack-bot
Azureにデプロイする © 2023 minato project. 11
ご清聴ありがとうございました