Код: Выделить всё
var channelMessages = new pylon.KVNamespace("chmsg");
discord.on('MESSAGE_CREATE', async (message) => {
if (!(message instanceof discord.GuildMemberMessage)) {
return;
}
// Check for ayy to prevent overloading, remove when going live.
if (
message.content.toLowerCase().includes('ayy') &&
(message.channelId == "1392115752990933022")) {
channelMessages.put("9", channelMessages.get("8"));
channelMessages.put("8", channelMessages.get("7"));
channelMessages.put("7", channelMessages.get("6"));
channelMessages.put("6", channelMessages.get("5"));
channelMessages.put("5", channelMessages.get("4"));
channelMessages.put("4", channelMessages.get("3"));
channelMessages.put("3", channelMessages.get("2"));
channelMessages.put("2", channelMessages.get("1"));
channelMessages.put("1", message.content);
// Then I want to do something to the message storage, like storing it to a server with fetch()
}
});
< /code>
Объявление в соответствии с SDK для: < /p>
KVstorage.put ( 'string', 'json' )
При попытке назначить результат из Get in the put, я получаю:
Argument of type 'Promise' is not assignable to parameter of type 'Json'
< /code>
Что я делаю не так? Почему я не могу назначить JSON JSON?
Подробнее здесь: https://stackoverflow.com/questions/796 ... -type-json
Мобильная версия