有没有办法获得公会的通知设置?

发布于 2025-02-02 20:01:04 字数 592 浏览 4 评论 0原文

例如,每当用户使用!notification命令时,无论服务器的通知设置是否设置为“所有消息”) @Mentions“

这是我想使用它的想法。

@bot.command()
async def notification():
  notificationsettings = # Notification settings here

  if notificationsettings == "only @mentions":
    print("You'll only get mention notifications")

  else:
    print("You'll get every message notifications")

For example, whenever a user uses the !notification command, it should print in the console whether the server's notification settings are set to "all messages" or "only @mentions".

Here is an idea of what I'd like to use it for.

@bot.command()
async def notification():
  notificationsettings = # Notification settings here

  if notificationsettings == "only @mentions":
    print("You'll only get mention notifications")

  else:
    print("You'll get every message notifications")

Image

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

合久必婚 2025-02-09 20:01:04

可以通过guild.default_notifications属性找到公会的通知级别。这将返回a notification> notification> notificationlevel 目的。

A Guild's notification level can be found through the Guild.default_notifications attribute. This will return a NotificationLevel object.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文