質問編集履歴

7

タイトル変更

2020/12/24 16:01

投稿

jun12
jun12

スコア5

test CHANGED
@@ -1 +1 @@
1
- RuntimeError: Event loop is closedというエラーを解決したい
1
+ Pythonでbotを作った際に発生した"RuntimeError: Event loop is closed"というエラーを解決したい
test CHANGED
File without changes

6

2020/12/24 16:00

投稿

jun12
jun12

スコア5

test CHANGED
@@ -1 +1 @@
1
- PythonでDiscord bot 作成したい
1
+ RuntimeError: Event loop is closedというエラー解決したい
test CHANGED
File without changes

5

エラーメッセージの追加

2020/12/24 14:59

投稿

jun12
jun12

スコア5

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- No such file or directoryというエラーを解決したい!
5
+ RuntimeError: Event loop is closedというエラーを解決したい!
6
6
 
7
7
 
8
8
 
@@ -12,29 +12,87 @@
12
12
 
13
13
  ```
14
14
 
15
- C:\Users(ユザー名)\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Windows\縲cocoabot.py': [Errno 2] No such file or directory
15
+ 現在発生してるエラです。
16
16
 
17
17
 
18
18
 
19
- VScodeのターミナルで実行した際のエラーメッセージ↓
19
+ Traceback (most recent call last):
20
20
 
21
- C:\Windows>C:/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python.exe //jyunya/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python/cocoabot.py
21
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 291, in static_login
22
+
23
+ data = await self.request(Route('GET', '/users/@me'))
24
+
25
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 245, in request
26
+
27
+ raise HTTPException(r, data)
28
+
29
+ discord.errors.HTTPException: 401 Unauthorized (error code: 0): 401: Unauthorized
30
+
31
+
32
+
33
+ The above exception was the direct cause of the following exception:
34
+
35
+
22
36
 
23
37
  Traceback (most recent call last):
24
38
 
25
- File "\(ユーザー名)\Users(ユーザー名)\AppData\Local\Programs\Python\Python39\python\cocoabot.py", line 23, in <module>
39
+ File "C:\Users\〇〇\cocoabot.py", line 23, in <module>
26
40
 
27
- client.run ('NzkwODQ2MjgwNTkwODE5MzQ4.X-Gi_g.z_TKINJ4juJ1QFXZULa02di8Stk')
41
+ client.run ('_oichcWRKMTLibPiELjgOTvYt9rO0SwO')
28
42
 
43
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 708, in run
44
+
45
+ return future.result()
46
+
47
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 687, in runner
48
+
49
+ await self.start(*args, **kwargs)
50
+
51
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 650, in start
52
+
53
+ await self.login(*args, bot=bot)
54
+
55
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\client.py", line 499, in login
56
+
57
+ await self.http.static_login(token.strip(), bot=bot)
58
+
59
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\http.py", line 295, in static_login
60
+
61
+ raise LoginFailure('Improper token has been passed.') from exc
62
+
29
- TypeError: run() takes 1 positional argument but 2 were given
63
+ discord.errors.LoginFailure: Improper token has been passed.
64
+
65
+ Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x000002616CB195E0>
66
+
67
+ Traceback (most recent call last):
68
+
69
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 116, in __del__
70
+
71
+ self.close()
72
+
73
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\asyncio\proactor_events.py", line 108, in close
74
+
75
+ self._loop.call_soon(self._call_connection_lost, None)
76
+
77
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 746, in call_soon
78
+
79
+ self._check_closed()
80
+
81
+ File "C:\Users\〇〇\AppData\Local\Programs\Python\Python39\lib\asyncio\base_events.py", line 510, in _check_closed
82
+
83
+ raise RuntimeError('Event loop is closed')
84
+
85
+ RuntimeError: Event loop is closed
86
+
87
+
88
+
89
+
90
+
91
+
30
92
 
31
93
  ```
32
94
 
33
-
34
-
35
95
  ###ソースコード
36
-
37
-
38
96
 
39
97
  ```Python
40
98
 
@@ -96,7 +154,7 @@
96
154
 
97
155
  ### 補足情報(FW/ツールのバージョンなど)
98
156
 
99
-
157
+ 〇〇の部分はユーザー名です。
100
158
 
101
159
  使用エディタ>VScode
102
160
 

4

エラーメッセージの追加

2020/12/24 14:34

投稿

jun12
jun12

スコア5

test CHANGED
File without changes
test CHANGED
@@ -16,7 +16,7 @@
16
16
 
17
17
 
18
18
 
19
- VScodeでのエラーメッセージ↓
19
+ VScodeのターミナル実行した際のエラーメッセージ↓
20
20
 
21
21
  C:\Windows>C:/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python.exe //jyunya/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python/cocoabot.py
22
22
 

3

エラーメッセージの追加

2020/12/23 16:44

投稿

jun12
jun12

スコア5

test CHANGED
File without changes
test CHANGED
@@ -13,6 +13,20 @@
13
13
  ```
14
14
 
15
15
  C:\Users(ユーザー名)\AppData\Local\Programs\Python\Python39\python.exe: can't open file 'C:\Windows\縲cocoabot.py': [Errno 2] No such file or directory
16
+
17
+
18
+
19
+ VScodeでのエラーメッセージ↓
20
+
21
+ C:\Windows>C:/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python.exe //jyunya/Users/(ユーザー名)/AppData/Local/Programs/Python/Python39/python/cocoabot.py
22
+
23
+ Traceback (most recent call last):
24
+
25
+ File "\(ユーザー名)\Users(ユーザー名)\AppData\Local\Programs\Python\Python39\python\cocoabot.py", line 23, in <module>
26
+
27
+ client.run ('NzkwODQ2MjgwNTkwODE5MzQ4.X-Gi_g.z_TKINJ4juJ1QFXZULa02di8Stk')
28
+
29
+ TypeError: run() takes 1 positional argument but 2 were given
16
30
 
17
31
  ```
18
32
 

2

2020/12/23 16:41

投稿

jun12
jun12

スコア5

test CHANGED
File without changes
test CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
 
4
4
 
5
- Discord botpythonで作ってみたい(初心者)
5
+ No such file or directoryというエラー解決したい
6
6
 
7
7
 
8
8
 

1

CyべrRexさんありがとうございます!気づいてなかったです!

2020/12/23 15:09

投稿

jun12
jun12

スコア5

test CHANGED
File without changes
test CHANGED
@@ -68,7 +68,7 @@
68
68
 
69
69
 
70
70
 
71
- client.run ('NzkwODQ2MjgwNTkwODE5MzQ4.X-Gi_g.z_TKINJ4juJ1QFXZULa02di8Stk')
71
+ client.run ('TOKEN入力欄')
72
72
 
73
73
  ```
74
74