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
~宇宙最速~2025年AWS Summit レポート
satodesu
1
1.8k
Oracle Cloud Infrastructure:2025年6月度サービス・アップデート
oracle4engineer
PRO
2
240
How Community Opened Global Doors
hiroramos4
PRO
1
120
Delegating the chores of authenticating users to Keycloak
ahus1
0
120
Observability в PHP без боли. Олег Мифле, тимлид Altenar
lamodatech
0
350
BrainPadプログラミングコンテスト記念LT会2025_社内イベント&問題解説
brainpadpr
1
160
変化する開発、進化する体系時代に適応するソフトウェアエンジニアの知識と考え方(JaSST'25 Kansai)
mizunori
1
220
AIのAIによるAIのための出力評価と改善
chocoyama
2
550
フィンテック養成勉強会#54
finengine
0
180
PostgreSQL 18 cancel request key長の変更とRailsへの関連
yahonda
0
120
GitHub Copilot の概要
tomokusaba
1
130
250627 関西Ruby会議08 前夜祭 RejectKaigi「DJ on Ruby Ver.0.1」
msykd
PRO
2
290
Featured
See All Featured
The Invisible Side of Design
smashingmag
299
51k
Embracing the Ebb and Flow
colly
86
4.7k
Code Review Best Practice
trishagee
68
18k
Building Flexible Design Systems
yeseniaperezcruz
328
39k
Building an army of robots
kneath
306
45k
What's in a price? How to price your products and services
michaelherold
246
12k
Put a Button on it: Removing Barriers to Going Fast.
kastner
60
3.9k
Fantastic passwords and where to find them - at NoRuKo
philnash
51
3.3k
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
138
34k
I Don’t Have Time: Getting Over the Fear to Launch Your Podcast
jcasabona
32
2.3k
Optimizing for Happiness
mojombo
379
70k
GraphQLとの向き合い方2022年版
quramy
48
14k
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