mo9mo9study / discord.CodeWarehouse

3 stars 2 forks source link

[#26] リアクションを押すとRoleを付与、もう一度押すとはく奪するコードをjsからpyに移行させました #29

Closed iceE-1591 closed 3 years ago

iceE-1591 commented 3 years ago

主な機能

導入するにあたって

management.pyは弄らなくて大丈夫です。 Cogs/Management/rolemaneger.py内に await self.Add_Reaction(payload, "🇦", ) というコードがありますが、 await self.Add_Reaction(payload, "reaction", role_id) の様に"reaction"が押された時に付与する、role_idを入力してください。 role_idは複数入力することが可能です。

issue #21

supleiades commented 3 years ago

正常に動かないので、一緒に検証したい

Traceback (most recent call last):
  File "/home/centos/work/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 607, in _load_from_module_spec
    spec.loader.exec_module(lib)
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/centos/work/discord.CodeWarehouse/python/Cogs/Managements/rolesmanager.py", line 4, in <module>
    from voiceChannelJoinLeave_roleModify import VoiceJoin_Role
ModuleNotFoundError: No module named 'voiceChannelJoinLeave_roleModify'

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "management.py", line 15, in <module>
    bot.load_extension("Cogs.Managements.rolesmanager")
  File "/home/centos/work/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 664, in load_extension
    self._load_from_module_spec(spec, name)
  File "/home/centos/work/discord.CodeWarehouse/python/venv/lib/python3.8/site-packages/discord/ext/commands/bot.py", line 610, in _load_from_module_spec
    raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'Cogs.Managements.rolesmanager' raised an error: ModuleNotFoundError: No module named 'voiceChannelJoinLeave_roleModify'