Я пишу дискорд бота на python но при попытке создать команду mute мне выходит ошибка.
from discord.ext import commands
from discord.ext.commads import has_permissions, MissingPermissions
import discord
class Mute(commands.Cog):
def __init__(self, client):
self.client = client
@commands.command()
@commands.has_perrmissions( mute_members = True)
async def mute(self, ctx, *, member: discord.Member, reason = None):
for i in ctx.guild.channels:
channel = self.client.get_channel(i.id)
await channel.set_permissions(member, reason = reason, send_messages = False, add_reactions = False, speak = False)
def setup(client):
client.add_cog(Mute(client))
ошибка:
File "<frozen importlib._bootstrap_external>", line 850, in exec_module
File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
File "D:\Python\Bots\Discord Bots\CasinoBot\module\commands\mute.py", line 2, in <module>
from discord.ext.commads import has_permissions, MissingPermissions
ModuleNotFoundError: No module named 'discord.ext.commads'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "D:\Python\Bots\Discord Bots\CasinoBot\main.py", line 28, in <module>
client.load_extension( f'module.commands.{ filename[:-3] }' )
File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 678, in load_extension
self._load_from_module_spec(spec, name)
File "C:\Users\Acer\AppData\Local\Programs\Python\Python39\lib\site-packages\discord\ext\commands\bot.py", line 609, in _load_from_module_spec
raise errors.ExtensionFailed(key, e) from e
discord.ext.commands.errors.ExtensionFailed: Extension 'module.commands.mute' raised an error: ModuleNotFoundError: No module named 'discord.ext.commads'