GithubHelp home page GithubHelp logo

Comments (6)

Wildric-Auric avatar Wildric-Auric commented on June 9, 2024

It can be easily done; the problem is that I can update the repository now since I've got no midjourney subscription to test changes in code.

from midjourney-wrapper.

deyangchu avatar deyangchu commented on June 9, 2024

Any hints on how to achieve it? I can try to test and make a PR.

from midjourney-wrapper.

yudu233 avatar yudu233 commented on June 9, 2024

image
这样?

from midjourney-wrapper.

deyangchu avatar deyangchu commented on June 9, 2024

image
这样?

是的,要是有根据用户组设置就更好了😆

from midjourney-wrapper.

yudu233 avatar yudu233 commented on June 9, 2024

根据用户组没看到文档,你可以为每个用户添加限制:@commands.cooldown(1, 120, commands.BucketType.user)

from midjourney-wrapper.

deyangchu avatar deyangchu commented on June 9, 2024

根据用户组没看到文档,你可以为每个用户添加限制:@commands.cooldown(1, 120, commands.BucketType.user)

感谢指路。我又参考了一些公开代码,为单个指令增加了@commands.cooldown,并在代码末尾增加了触发cooldown的处理:

@bot.event
async def on_application_command_error(ctx: discord.ApplicationContext, error: discord.DiscordException):
if isinstance(error, commands.CommandOnCooldown):
await ctx.respond("This command is currently on cooldown!")
else:
raise error

得到的效果是成功设置了限制,机器人会在公屏打出频率受限的提示语句(想要你那种只给发指令的人提示),后台出现“discord.errors.HTTPException: 405 Method Not Allowed”的报错但没有影响运行。

总之效果差强人意,可以麻烦你po一下你的改法吗?外行爱好者,问了外行话见谅!

from midjourney-wrapper.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.