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
660
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
620
いまさら聞けないAWS
askul
0
5.8k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
180
チームでリーダブルコードを実現するには?
askul
0
3.1k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
810
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
3.5k
1on1をする上で大切なこと
askul
1
810
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.3k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.4k
Other Decks in Technology
See All in Technology
SwiftUIのGeometryReaderとScrollViewを基礎から応用まで学び直す:設計と活用事例
fumiyasac0921
0
140
From Prompt to Product @ How to Web 2025, Bucharest, Romania
janwerner
0
120
Green Tea Garbage Collector の今
zchee
PRO
2
390
Where will it converge?
ibknadedeji
0
180
Why React!?? Next.jsそしてReactを改めてイチから選ぶ
ypresto
10
4.5k
いまさら聞けない ABテスト入門
skmr2348
1
200
ユニットテストに対する考え方の変遷 / Everyone should watch his live coding
mdstoy
0
130
Escaping_the_Kraken_-_October_2025.pdf
mdalmijn
0
140
Why Governance Matters: The Key to Reducing Risk Without Slowing Down
sarahjwells
0
110
SoccerNet GSRの紹介と技術応用:選手視点映像を提供するサッカー作戦盤ツール
mixi_engineers
PRO
1
180
Large Vision Language Modelを用いた 文書画像データ化作業自動化の検証、運用 / shibuya_AI
sansan_randd
0
110
動画データのポテンシャルを引き出す! Databricks と AI活用への奮闘記(現在進行形)
databricksjapan
0
150
Featured
See All Featured
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
48
9.7k
How STYLIGHT went responsive
nonsquared
100
5.8k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
4k
Navigating Team Friction
lara
189
15k
Easily Structure & Communicate Ideas using Wireframe
afnizarnur
194
16k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
Cheating the UX When There Is Nothing More to Optimize - PixelPioneers
stephaniewalter
285
14k
Performance Is Good for Brains [We Love Speed 2024]
tammyeverts
12
1.2k
Six Lessons from altMBA
skipperchong
28
4k
4 Signs Your Business is Dying
shpigford
185
22k
Keith and Marios Guide to Fast Websites
keithpitt
411
22k
10 Git Anti Patterns You Should be Aware of
lemiorhan
PRO
657
61k
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