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
630
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
590
いまさら聞けないAWS
askul
0
5.6k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
160
チームでリーダブルコードを実現するには?
askul
0
3k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
780
10分で「エラスティックリーダーシップ」をアウトプット
askul
0
3.4k
1on1をする上で大切なこと
askul
1
760
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.2k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.4k
Other Decks in Technology
See All in Technology
25分で解説する「最小権限の原則」を実現するための AWS「ポリシー」大全 / 20250625-aws-summit-aws-policy
opelab
9
1.1k
低レイヤを知りたいPHPerのためのCコンパイラ作成入門 完全版 / Building a C Compiler for PHPers Who Want to Dive into Low-Level Programming - Expanded
tomzoh
4
3.1k
標準技術と独自システムで作る「つらくない」SaaS アカウント管理 / Effortless SaaS Account Management with Standard Technologies & Custom Systems
yuyatakeyama
3
1.2k
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
120
生成AIで小説を書くためにプロンプトの制約や原則について学ぶ / prompt-engineering-for-ai-fiction
nwiizo
3
920
Wasm元年
askua
0
140
Observability в PHP без боли. Олег Мифле, тимлид Altenar
lamodatech
0
340
Uniadex__公開版_20250617-AIxIoTビジネス共創ラボ_ツナガルチカラ_.pdf
iotcomjpadmin
0
160
Liquid Glass革新とSwiftUI/UIKit進化
fumiyasac0921
0
200
AIのAIによるAIのための出力評価と改善
chocoyama
2
540
Amazon Bedrockで実現する 新たな学習体験
kzkmaeda
1
520
ローカルLLMでファインチューニング
knishioka
0
150
Featured
See All Featured
Typedesign – Prime Four
hannesfritz
42
2.7k
jQuery: Nuts, Bolts and Bling
dougneiner
63
7.8k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
BBQ
matthewcrist
89
9.7k
GitHub's CSS Performance
jonrohan
1031
460k
Documentation Writing (for coders)
carmenintech
71
4.9k
A Tale of Four Properties
chriscoyier
160
23k
The Pragmatic Product Professional
lauravandoore
35
6.7k
Understanding Cognitive Biases in Performance Measurement
bluesmoon
29
1.8k
The Cult of Friendly URLs
andyhume
79
6.5k
How To Stay Up To Date on Web Technology
chriscoyier
790
250k
Faster Mobile Websites
deanohume
307
31k
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