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
610
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
570
いまさら聞けないAWS
askul
0
5.4k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
160
チームでリーダブルコードを実現するには?
askul
0
2.9k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
750
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
3.3k
1on1をする上で大切なこと
askul
1
740
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.1k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.3k
Other Decks in Technology
See All in Technology
生成AIによるCloud Native基盤構築の可能性と実践的ガードレールの敷設について
nwiizo
7
930
DETR手法の変遷と最新動向(CVPR2025)
tenten0727
2
1.4k
ガバクラのAWS長期継続割引 ~次の4/1に慌てないために~
hamijay_cloud
1
230
4/17/25 - CIJUG - Java Meets AI: Build LLM-Powered Apps with LangChain4j (part 2)
edeandrea
PRO
0
110
より良い開発者体験を実現するために~開発初心者が感じた生成AIの可能性~
masakiokuda
0
200
Running JavaScript within Ruby
hmsk
3
330
白金鉱業Meetup_Vol.18_AIエージェント時代のUI/UX設計
brainpadpr
0
110
PagerDuty×ポストモーテムで築く障害対応文化/Building a culture of incident response with PagerDuty and postmortems
aeonpeople
1
270
Amazon CloudWatch Application Signals ではじめるバーンレートアラーム / Burn rate alarm with Amazon CloudWatch Application Signals
ymotongpoo
5
530
Road to Go Gem #rubykaigi
sue445
0
670
AWSで作るセキュアな認証基盤with OAuth mTLS / Secure Authentication Infrastructure with OAuth mTLS on AWS
kaminashi
0
180
新卒エンジニアがCICDをモダナイズしてみた話
akashi_sn
2
240
Featured
See All Featured
Docker and Python
trallard
44
3.3k
Imperfection Machines: The Place of Print at Facebook
scottboms
267
13k
Creating an realtime collaboration tool: Agile Flush - .NET Oxford
marcduiker
30
2k
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
47
5.3k
Agile that works and the tools we love
rasmusluckow
328
21k
Art, The Web, and Tiny UX
lynnandtonic
298
20k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
656
60k
Code Reviewing Like a Champion
maltzj
522
40k
BBQ
matthewcrist
88
9.6k
Building a Modern Day E-commerce SEO Strategy
aleyda
40
7.2k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.7k
It's Worth the Effort
3n
184
28k
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