質問編集履歴
2
補足情報の追加
test
CHANGED
File without changes
|
test
CHANGED
@@ -120,4 +120,84 @@
|
|
120
120
|
|
121
121
|
|
122
122
|
|
123
|
-
|
123
|
+
```lang-python
|
124
|
+
|
125
|
+
if message.content == 'ナワバリ':
|
126
|
+
|
127
|
+
# スプラトゥーン2のナワバリステージ情報API
|
128
|
+
|
129
|
+
url_regular = "https://spla2.yuu26.com/regular/"
|
130
|
+
|
131
|
+
|
132
|
+
|
133
|
+
response = requests.get(url_regular + "now")
|
134
|
+
|
135
|
+
|
136
|
+
|
137
|
+
if response.status_code == 200:
|
138
|
+
|
139
|
+
# JSONを取得
|
140
|
+
|
141
|
+
data = response.json()
|
142
|
+
|
143
|
+
|
144
|
+
|
145
|
+
results = data['result']
|
146
|
+
|
147
|
+
name = ""
|
148
|
+
|
149
|
+
st = ""
|
150
|
+
|
151
|
+
et = ""
|
152
|
+
|
153
|
+
map_n = ""
|
154
|
+
|
155
|
+
image = ''
|
156
|
+
|
157
|
+
s_t = st.strftime(%m/%d %H:%M) # 追加(strftime)
|
158
|
+
|
159
|
+
e_t = et.strftime(%m/%d %H:%M) # 追加(strftime)
|
160
|
+
|
161
|
+
|
162
|
+
|
163
|
+
# pprint.pprint(results)
|
164
|
+
|
165
|
+
|
166
|
+
|
167
|
+
for result in results:
|
168
|
+
|
169
|
+
st = result['start']
|
170
|
+
|
171
|
+
et = result['end']
|
172
|
+
|
173
|
+
for map_data in result['maps_ex']:
|
174
|
+
|
175
|
+
map_n = map_n + map_data['name'] + "\n"
|
176
|
+
|
177
|
+
# image = image + map_data['image']
|
178
|
+
|
179
|
+
|
180
|
+
|
181
|
+
embed = discord.Embed(title="開催時間", description=s_t + "-" + e_t + "(開催中)", color=0x7eff00) # st,etから置き換え
|
182
|
+
|
183
|
+
embed.add_field(name="ステージ", value=map_n, inline=False)
|
184
|
+
|
185
|
+
# embed.set_image(url=image)
|
186
|
+
|
187
|
+
|
188
|
+
|
189
|
+
for r_name in results:
|
190
|
+
|
191
|
+
name = r_name['rule_ex']['name']
|
192
|
+
|
193
|
+
|
194
|
+
|
195
|
+
embed.set_author(name=name,
|
196
|
+
|
197
|
+
icon_url='https://images-ext-1.discordapp.net/external/sNH8hPsRSuUYU7eMhUebaL7v8I3q82OepAd-vN_5sWE/https/www.nintendo.co.jp/switch/aab6a/assets/images/battle-sec01_logo.png')
|
198
|
+
|
199
|
+
|
200
|
+
|
201
|
+
await message.channel.send(embed=embed)
|
202
|
+
|
203
|
+
```
|
1
エラーメッセージ項目の削除
test
CHANGED
File without changes
|
test
CHANGED
@@ -13,14 +13,6 @@
|
|
13
13
|
・2017-08-09T14:00:00+00:00
|
14
14
|
|
15
15
|
・1502287200
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
### 発生している問題・エラーメッセージ
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
Errorは出てません。
|
24
16
|
|
25
17
|
|
26
18
|
|