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
·
SiteGround - Reliable hosting with speed, security, and support you can count on.
→
ASKUL Engineer
March 30, 2021
Technology
700
0
Share
Discord Bot はじめの一歩
20210325 AStudy+
https://askul.connpass.com/event/204742/
speaker:みわすけ
ASKUL Engineer
March 30, 2021
More Decks by ASKUL Engineer
See All by ASKUL Engineer
EditorConfigで導くコードの「美しさ」
askul
0
650
いまさら聞けないAWS
askul
0
6.4k
CTOが語る、テックカンパニーに向けた未来の話。by アスクル
askul
0
200
チームでリーダブルコードを実現するには?
askul
0
3.3k
ラズパイを使ってスマートリモコンを作ってみた
askul
0
850
10分で「エラスティックリーダーシップ」をアウトプット
askul
1
3.8k
1on1をする上で大切なこと
askul
1
870
JBUG東京#20 〜そこが知りたい!Backlog活用術〜
askul
1
3.5k
GCPを活用した物流倉庫内の異常検知/Anomaly detection in distribution warehouse using GCP
askul
0
3.5k
Other Decks in Technology
See All in Technology
来期の評価で変えようと思っていること 〜AI時代に変わること・変わらないこと〜
estie
0
130
不確実性と戦いながら見積もりを作成するプロセス/mitsumori-process
hirodragon112
1
160
Tour of Agent Protocols: MCP, A2A, AG-UI, A2UI with ADK
meteatamel
0
170
Bill One 開発エンジニア 紹介資料
sansan33
PRO
5
18k
20260323_データ分析基盤でGeminiを使う話
1210yuichi0
0
210
15年メンテしてきたdotfilesから開発トレンドを振り返る 2011 - 2026
giginet
PRO
2
250
Physical AI on AWS リファレンスアーキテクチャ / Physical AI on AWS Reference Architecture
aws_shota
1
220
AWS Systems Managerのハイブリッドアクティベーションを使用したガバメントクラウド環境の統合管理
toru_kubota
1
190
昔話で振り返るAWSの歩み ~S3誕生から20年、クラウドはどう進化したのか~
nrinetcom
PRO
0
120
Oracle Cloud Infrastructure(OCI):Onboarding Session(はじめてのOCI/Oracle Supportご利⽤ガイド)
oracle4engineer
PRO
2
17k
自分をひらくと次のチャレンジの敷居が下がる
sudoakiy
3
1.2k
Databricks Appsで実現する社内向けAIアプリ開発の効率化
r_miura
0
200
Featured
See All Featured
Bash Introduction
62gerente
615
210k
GraphQLの誤解/rethinking-graphql
sonatard
75
12k
Navigating Algorithm Shifts & AI Overviews - #SMXNext
aleyda
1
1.2k
[RailsConf 2023 Opening Keynote] The Magic of Rails
eileencodes
31
10k
Optimising Largest Contentful Paint
csswizardry
37
3.6k
Imperfection Machines: The Place of Print at Facebook
scottboms
269
14k
Embracing the Ebb and Flow
colly
88
5k
The MySQL Ecosystem @ GitHub 2015
samlambert
251
13k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
1
3.5k
Visualizing Your Data: Incorporating Mongo into Loggly Infrastructure
mongodb
49
9.9k
Leo the Paperboy
mayatellez
5
1.6k
エンジニアに許された特別な時間の終わり
watany
106
240k
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