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
540
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
520
いまさら聞けないAWS
askul
0
4.8k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
130
チームでリーダブルコードを実現するには?
askul
0
2.6k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
660
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
2.8k
1on1をする上で大切なこと
askul
1
640
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
2.7k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.2k
Other Decks in Technology
See All in Technology
可視化により内部品質をあげるAIドキュメントリバース/20240910 Hiromitsu Akiba
shift_evolve
0
220
LINEヤフーのフロントエンド組織・体制の紹介
lycorp_recruit_jp
1
1.2k
たった1人からはじめる【Agile Community of Practice】~ソース原理とFearless Changeを添えて~
ktc_corporate_it
1
480
Discovering AI Models
picardparis
4
3.9k
Next.js のページ遷移を全力で止める
ypresto
7
3.3k
JEP 480: Structured Concurrency
aya_ebata
0
130
Privacy Sandbox on Android / DroidKaigi 2024
7pairs
1
270
o1のAPIで実験してみたが 制限きつすぎて辛かった話
pharma_x_tech
0
200
グイグイ系QAマネージャーの仕事
sadonosake
0
340
AIを活用した柔軟かつ効率的な社内リソース検索への取り組み
cygames
0
180
Tricentisにおけるテスト自動化へのAI活用ご紹介/20240910Shunsuke Katakura
shift_evolve
0
200
Jetpack Compose Modifier 徹底解説 / Jetpack Compose Modifier
wiroha
0
200
Featured
See All Featured
Designing Dashboards & Data Visualisations in Web Apps
destraynor
227
52k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
278
13k
Speed Design
sergeychernyshev
22
430
Exploring the Power of Turbo Streams & Action Cable | RailsConf2023
kevinliebholz
25
3.9k
Keith and Marios Guide to Fast Websites
keithpitt
408
22k
Designing Experiences People Love
moore
138
23k
4 Signs Your Business is Dying
shpigford
179
21k
ピンチをチャンスに:未来をつくるプロダクトロードマップ #pmconf2020
aki_iinuma
103
48k
XXLCSS - How to scale CSS and keep your sanity
sugarenia
246
1.3M
JavaScript: Past, Present, and Future - NDC Porto 2020
reverentgeek
45
4.8k
The Art of Programming - Codeland 2020
erikaheidi
48
13k
Principles of Awesome APIs and How to Build Them.
keavy
125
16k
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