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
·
Your Podcast. Everywhere. Effortlessly.
Share. Educate. Inspire. Entertain. You do you. We'll handle the rest.
→
ASKUL Engineer
March 30, 2021
Technology
0
690
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
630
いまさら聞けないAWS
askul
0
6.3k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
190
チームでリーダブルコードを実現するには?
askul
0
3.2k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
830
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
3.7k
1on1をする上で大切なこと
askul
1
850
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
AIと新時代を切り拓く。これからのSREとメルカリIBISの挑戦
0gm
0
570
Amazon S3 Vectorsを使って資格勉強用AIエージェントを構築してみた
usanchuu
3
400
今日から始めるAmazon Bedrock AgentCore
har1101
4
320
変化するコーディングエージェントとの現実的な付き合い方 〜Cursor安定択説と、ツールに依存しない「資産」〜
empitsu
4
1.1k
無ければ作る! バイブコーディングで作ったものを一気に紹介
tatsuya1970
0
110
Kiro IDEのドキュメントを全部読んだので地味だけどちょっと嬉しい機能を紹介する
khmoryz
0
110
Meshy Proプラン課金した
henjin0
0
170
Azure SRE Agent x PagerDutyによる近未来インシデント対応への期待 / The Future of Incident Response: Azure SRE Agent x PagerDuty
aeonpeople
0
270
Amazon ElastiCacheのコスト最適化を考える/Elasticache Cost Optimization
quiver
0
370
M&A 後の統合をどう進めるか ─ ナレッジワーク × Poetics が実践した組織とシステムの融合
kworkdev
PRO
1
280
しろおびセキュリティへ ようこそ
log0417
0
250
What happened to RubyGems and what can we learn?
mikemcquaid
0
190
Featured
See All Featured
Thoughts on Productivity
jonyablonski
74
5k
For a Future-Friendly Web
brad_frost
182
10k
Paper Plane (Part 1)
katiecoart
PRO
0
3.8k
More Than Pixels: Becoming A User Experience Designer
marktimemedia
3
310
How to Align SEO within the Product Triangle To Get Buy-In & Support - #RIMC
aleyda
1
1.4k
Skip the Path - Find Your Career Trail
mkilby
0
51
The Impact of AI in SEO - AI Overviews June 2024 Edition
aleyda
5
720
Discover your Explorer Soul
emna__ayadi
2
1.1k
svc-hook: hooking system calls on ARM64 by binary rewriting
retrage
1
93
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
Helping Users Find Their Own Way: Creating Modern Search Experiences
danielanewman
31
3.1k
Pawsitive SEO: Lessons from My Dog (and Many Mistakes) on Thriving as a Consultant in the Age of AI
davidcarrasco
0
60
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