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
Discord Bot はじめの一歩
Search
ASKUL Engineer
March 30, 2021
Technology
0
700
Discord Bot はじめの一歩
20210325 AStudy+
https://askul.connpass.com/event/204742/
speaker:みわすけ
ASKUL Engineer
March 30, 2021
Tweet
Share
More Decks by ASKUL Engineer
See All by ASKUL Engineer
EditorConfigで導くコードの「美しさ」
askul
0
650
いまさら聞けないAWS
askul
0
6.3k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
200
チームでリーダブルコードを実現するには?
askul
0
3.2k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
850
10分で「エラスティックリーダーシップ」をアウトプット
askul
1
3.8k
1on1をする上で大切なこと
askul
1
860
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.4k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.5k
Other Decks in Technology
See All in Technology
Keycloak を使った SSO で CockroachDB にログインする / CockroachDB SSO with Keycloak
kota2and3kan
0
120
決済サービスを支えるElastic Cloud - Elastic Cloudの導入と推進、決済サービスのObservability
suzukij
2
640
VPCエンドポイント意外とお金かかるなぁ。せや、共有したろ!
tommy0124
1
590
Postman v12 で変わる API開発ワークフロー (Postman v12 アップデート) / New API development workflow with Postman v12
yokawasa
0
120
今のWordPress の制作手法ってなにがあんねん?(改) / What’s the Deal with WordPress Development These Days?
tbshiki
0
450
情シスのための生成AI実践ガイド2026 / Generative AI Practical Guide for Business Technology 2026
glidenote
0
250
Shifting from MCP to Skills / ベストプラクティスの変遷を辿る
yamanoku
4
850
JAWS DAYS 2026 ExaWizards_20260307
exawizards
0
430
The_Evolution_of_Bits_AI_SRE.pdf
nulabinc
PRO
0
200
内製AIチャットボットで学んだDatadog LLM Observability活用術
mkdev10
0
110
(Test) ai-meetup slide creation
oikon48
3
390
AI時代のSaaSとETL
shoe116
1
150
Featured
See All Featured
Scaling GitHub
holman
464
140k
How People are Using Generative and Agentic AI to Supercharge Their Products, Projects, Services and Value Streams Today
helenjbeal
1
140
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
990
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
659
61k
Optimizing for Happiness
mojombo
378
71k
Site-Speed That Sticks
csswizardry
13
1.1k
HDC tutorial
michielstock
1
540
[Rails World 2023 - Day 1 Closing Keynote] - The Magic of Rails
eileencodes
38
2.8k
HU Berlin: Industrial-Strength Natural Language Processing with spaCy and Prodigy
inesmontani
PRO
0
260
Beyond borders and beyond the search box: How to win the global "messy middle" with AI-driven SEO
davidcarrasco
3
72
Kristin Tynski - Automating Marketing Tasks With AI
techseoconnect
PRO
0
190
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
31
2.7k
Transcript
DiscordBot はじめの⼀歩 アスクル株式会社 三輪亮介
⾃⼰紹介 • ⾃分について⾊々わかっていないためサイズ違いの靴や服が 余っている • 社会⼈になって太った • 業務では、AWSの構築などインフラ関連のことを⾏なっている 1
⽬次 1. Discordの紹介 2. やってみる 3. Botの例 2
Discordって︖ • ビデオ、⾳声通話ソフト • 1つのサーバーに複数の通話部屋、チャット部屋を作ることが できる 3
4
DiscordのBotって︖ • ユーザーの⼊⼒に⾃動応答させられる • ユーザーができることはだいたいできる • 複数⾔語対応 (https://discordpy.readthedocs.io/ja/latest/api.html) 5
6 やってみる
サンプル import discord import os import setToken # 環境変数を使うべき。今回は外部ファイルを参照 #
token = os.environ['DISCORD_TOKEN’] TOKEN = setToken.tokenclient = discord.Client()# 起動時 @client.event async def on_ready(): print("AStudy discordBot")# チャットイベント @client.event async def on_message(message): # メッセージ送信者がBotだった場合は無視する if message.author.bot: return # /test に対してhelloを返答 if message.content == '/test': await message.channel.send('hello')# bot起動 client.run(TOKEN) 7