Discord.js 计数器和存储

2022-01-10 00:00:00 javascript discord.js

我知道这似乎很容易,但我没有深入研究 Javascript 或任何代码,但我现在正在这样做,因为我正在制作一个不和谐的机器人,我似乎找不到制作方法我的不和谐机器人的计数器,所以如果有人说!pointsadd 100",那么它会在余额中增加 100,这可以从 ect 中扣除.可以找到其他计数器,如 HTML、CSS,但如果有人能提供帮助,格式会让我感到困惑,非常感谢

I know this may seem easy but I haven't delved too deeply into Javascript or any code for that matter but I'm doing so now that I am making a discord bot I can't seem to find a way to make a counter for my discord bot so if someone says "!pointsadd 100" then it would add 100 to the balance and that can be taken away from ect. can find other counters like HTML, CSS but the format is confusing to me if anyone could help much appreciated

推荐答案

如果您想要一种可靠的方式来存储积分值,请尝试使用 MongoDB 之类的东西.如果你愿意,我可以帮忙.虽然如果您只想将它​​存储在一个普通的旧 JSON 文件中(不推荐,它们在被频繁写入后可能会损坏)https://www.youtube.com/watch?v=Aw4b2VN1KW8 这是一个很好的视频.

If you would like a reliable way to store the points value, try using something like MongoDB. I could help with it if you want. Although if you just want to store it in a plain old JSON file (wouldn't recommend, they can corrupt after being written to too often) https://www.youtube.com/watch?v=Aw4b2VN1KW8 this is a good video to follow.

相关文章