質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.50%
Discord

Discordは、ゲーマー向けのボイスチャットアプリです。チャット・通話がブラウザ上で利用可能で、個人専用サーバーも開設できます。通話中でも音楽を流したり、PC画面を共有できるなど多機能な点が特徴です。

Q&A

2回答

1277閲覧

botができないので助けて

hi7ata

総合スコア0

Discord

Discordは、ゲーマー向けのボイスチャットアプリです。チャット・通話がブラウザ上で利用可能で、個人専用サーバーも開設できます。通話中でも音楽を流したり、PC画面を共有できるなど多機能な点が特徴です。

0グッド

0クリップ

投稿2022/09/30 05:36

前提

discord bot を作っています

実現したいこと

しっかりどうさするようにしたい

発生している問題・エラーメッセージ

2.0.1 2022-09-30 14:34:31 INFO discord.client logging in using static token Traceback (most recent call last): File "c:\Users\21EO0122\Documents\discord_bot.py", line 16, in <module> client.run(TOKEN) File "C:\Users\21EO0122\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 828, in run asyncio.run(runner()) File "C:\Program Files\Python39\lib\asyncio\runners.py", line 44, in run return loop.run_until_complete(main) File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 647, in run_until_complete return future.result() File "C:\Users\21EO0122\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 817, in runner await self.start(token, reconnect=reconnect) File "C:\Users\21EO0122\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 746, in start await self.connect(reconnect=reconnect) File "C:\Users\21EO0122\AppData\Roaming\Python\Python39\site-packages\discord\client.py", line 672, in connect raise PrivilegedIntentsRequired(exc.shard_id) from None discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead. Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000027EA43A21F0> Traceback (most recent call last): File "C:\Program Files\Python39\lib\asyncio\proactor_events.py", line 116, in __del__ self.close() File "C:\Program Files\Python39\lib\asyncio\proactor_events.py", line 108, in close self._loop.call_soon(self._call_connection_lost, None) File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 751, in call_soon self._check_closed() File "C:\Program Files\Python39\lib\asyncio\base_events.py", line 515, in _check_closed raise RuntimeError('Event loop is closed') RuntimeError: Event loop is closed

該当のソースコード

import discord

TOKEN = '+++' # TOKENを貼り付け
client = discord.Client(intents=discord.Intents.all())
CHANNEL_ID = +++ # チャンネルIDを貼り付け
print(discord.version) # 1.2.5

@client.event
async def on_ready():
while True:
MSGK = input("文字を入力:")
MSG = "送信者:" + str(NAME) + str(MSGK)
channel = client.get_channel(CHANNEL_ID)
await channel.send(str(MSG))

client.run(TOKEN)

discord.py

試したこと

ここに問題に対して試したことを記載してください。

補足情報(FW/ツールのバージョンなど)

ここにより詳細な情報を記載してください。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

novelistory

2022/10/03 01:59

該当のソースコードとして提示いただいたコードを実行したときに、どういった動作をすることを求めているのかご記載いただくと回答を得やすいかと思います。
guest

回答2

0

丸投げは禁止されています
何がしたいのかはっきりさせてください

投稿2022/10/20 10:55

Act_Celery

総合スコア20

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

0

他の人も言っているように具体的な内容を書いてください。丸投げの質問はしないでください。


discord.errors.PrivilegedIntentsRequired: Shard ID None is requesting privileged intents that have not been explicitly enabled in the developer portal. It is recommended to go to https://discord.com/developers/applications/ and explicitly enable the privileged intents within your application's page. If this is not possible, then consider disabling the privileged intents instead.

これが原因です。

投稿2022/10/11 06:18

pecop

総合スコア409

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.50%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問