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
Sponsored
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ASKUL Engineer
March 30, 2021
Technology
720
0
Share
Discord Bot はじめの一歩
20210325 AStudy+
https://askul.connpass.com/event/204742/
speaker:みわすけ
ASKUL Engineer
March 30, 2021
More Decks by ASKUL Engineer
See All by ASKUL Engineer
EditorConfigで導くコードの「美しさ」
askul
0
660
いまさら聞けないAWS
askul
0
6.4k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
210
チームでリーダブルコードを実現するには?
askul
0
3.3k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
860
10分で「エラスティックリーダーシップ」をアウトプット
askul
1
3.8k
1on1をする上で大切なこと
askul
1
880
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.5k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.6k
Other Decks in Technology
See All in Technology
Every Conversation Counts
kawaguti
PRO
0
180
The 7 pitfalls of AI
ufried
0
200
会社説明資料|株式会社ギークプラス ソフトウェア事業部
geekplus_tech
0
210
オライリーイベント登壇資料「鉄リサイクル・産廃業界におけるAI技術実応用のカタチ」
takarasawa_
0
360
Digital Independence: Why, When and How
wannesrams
0
310
Modernizing Your HCL Connections Experience: Visual Report to chain, Profile Enhancements, and AI Integration
wannesrams
0
300
QAエンジニアはどうやって プロダクト議論の場に入れるのか?
moritamasami
2
410
サンプリングは「作る」のか「使う」のか? 分散トレースのコストと運用を両立する実践的戦略 / Why you need the tail sampling and why you don't want it
ymotongpoo
3
150
AI飲み会幹事エージェントを作っただけなのに
ykimi
0
100
変化の激しい時代をゴキゲンに生き抜くために 〜ストレスマネジメントのススメ〜
kakehashi
PRO
4
1.2k
試作とデモンストレーション / Prototyping and Demonstrations
ks91
PRO
0
200
Agent の「自由」と「安全」〜未来に向けて今できること〜
katayan
0
350
Featured
See All Featured
"I'm Feeling Lucky" - Building Great Search Experiences for Today's Users (#IAC19)
danielanewman
231
23k
The browser strikes back
jonoalderson
0
1k
Effective software design: The role of men in debugging patriarchy in IT @ Voxxed Days AMS
baasie
0
340
Digital Ethics as a Driver of Design Innovation
axbom
PRO
1
280
A Guide to Academic Writing Using Generative AI - A Workshop
ks91
PRO
1
290
職位にかかわらず全員がリーダーシップを発揮するチーム作り / Building a team where everyone can demonstrate leadership regardless of position
madoxten
62
54k
Are puppies a ranking factor?
jonoalderson
1
3.4k
Abbi's Birthday
coloredviolet
2
7.5k
Responsive Adventures: Dirty Tricks From The Dark Corners of Front-End
smashingmag
254
22k
[SF Ruby Conf 2025] Rails X
palkan
2
1k
The untapped power of vector embeddings
frankvandijk
2
1.7k
Facilitating Awesome Meetings
lara
57
6.8k
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