mo9mo9study / discord.CodeWarehouse

3 stars 2 forks source link

学習言語ロールの自動付与処理のエラー #92

Open supleiades opened 3 years ago

supleiades commented 3 years ago

原因

対象

エラー

Traceback (most recent call last):
  File "/home/centos/repos/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/client.py", line 343, in _run_event
    await coro(*args, **kwargs)
  File "/home/centos/repos/discord.CodeWarehouse/python/Cogs/Managements/languageVisualization.py", line 40, in on_ready
    await self.message.add_reaction(languages["emoji"])
  File "/home/centos/repos/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/message.py", line 1220, in add_reaction
    await self._state.http.add_reaction(self.channel.id, self.id, emoji)
  File "/home/centos/repos/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/http.py", line 248, in request
    raise Forbidden(r, data)
discord.errors.Forbidden: 403 Forbidden (error code: 30010): Maximum number of reactions reached (20)
supleiades commented 3 years ago

解決方法1

iceE-1591 commented 3 years ago

解決方法

supleiades commented 3 years ago

dict2 = {} for i in range(1,22): dict2.update({f"k{i}":f"v{i}"})

for key in dict2: tmp = {key:dict2[key]} print(f"[DEBUG] tmp: {tmp}") if len(l1) == 0: print("[DEBUG] True") l1.append(tmp) else: print("[DEBUG] False") if len(l1[-1]) >= MAX_REACTION_COUNT: print(f"[DEBUG] len(l1[-1]) : {len(l1[-1])}") print("[DEBUG] 配列に要素を追加しました") l1.append(tmp) else: print("[DEBUG] 配列の最後尾の辞書に要素を追加しました") l1[-1].update(tmp)

supleiades commented 3 years ago

解決方法

  • コマンドで追加

mee6の機能で解決しようと思ったけど、ちょっとした出来心で作ってみようと思う 挫折したら素直にMee6使う リファクタリングで遊ぼ!(日本語で遊ぼ風味)