简体   繁体   English

Discord 添加角色超时

[英]Discord Adding the role timed out

I am Creating a shop,where users can buy roles.我正在创建一个商店,用户可以在其中购买角色。 The main issue is that I can't handle multiple of request due to dicord api rate limit and I don't know how to handle it主要问题是由于 dicord api 速率限制,我无法处理多个请求,我不知道如何处理

Code to add user the role:添加用户角色的代码:

 guildMember.addRole(role).catch(function(err) {
    if(err.toString() === 'Error: Adding the role timed out.') return res.json({msg:err.toString(),icon: "error"});  
    else {
      return res.json({msg: 'item bought!',icon: "success"});  
    }
  });

The issue is that discord gives me an error (Error: Adding the role timed out.), but even with this error the user can get the role and I don't know why basically I can't handle this problem cause the user can or can't get the role even with this error问题是 discord 给了我一个错误(错误:添加角色超时。),但即使有这个错误,用户也可以获得角色,我不知道为什么基本上我无法处理这个问题,因为用户可以或者即使出现此错误也无法获得角色

It may be related to the use of ram.可能与使用ram有关。 I have this problem.我有这个问题。 And whenever I try to save something to JSON the ram gets too high每当我尝试将某些东西保存到 JSON 时,内存都会变得太高

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM