命令不是踢成员

时间:2020-12-28 11:34:54

标签: command discord.py

我添加了一个没有任何理由踢的踢命令,但机器人不能踢成员,但权限运行良好。 这段代码有什么问题?

public class Item {
    int play;
    int image;
    int id;
    boolean isPlaying;
    boolean isLocked;

    public Item(int id, int play, int image, boolean isPlaying, boolean isLocked) {
        this.image = image;
        this.id = id;
        this.play = play;
        this.isPlaying = isPlaying;
        this.isLocked = isLocked;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getId() {
        return id;
    }

    public void setImage(int image) {
        this.image = image;
    }

    public int getImage() {
        return image;
    }

    public void setPlay(int play) {
        this.play = play;
    }

    public int getPlay() {
        return play;
    }

    public void setisPlaying(boolean isplay) {
        this.isPlaying = isplay;
    }

    public boolean getisPLaying() {
        return isPlaying;
    }

    public void setisLocked(boolean isLock) {
        this.isLocked = isLock;
    }

    public boolean getisLocked() {
        return isLocked;
    }

}

2 个答案:

答案 0 :(得分:2)

如果要使用齿轮,请将 @client.command() 更改为 @commands.command() 或删除 self 参数。

我推荐阅读:

https://discordpy.readthedocs.io/en/latest/ext/commands/cogs.html https://gist.github.com/EvieePy/d78c061a4798ae81be9825468fe146be

答案 1 :(得分:-2)

await member.kick(reason=reason)

将此行更改为

await client.kick(member)