Ported API client library from Mami and load colour presets through it as well.

This commit is contained in:
flash 2025-04-13 00:18:38 +00:00
commit 6870ee3959
Signed by: flash
GPG key ID: 2C9C2C574D47FE3E
9 changed files with 256 additions and 41 deletions
src/ami.js

View file

@ -2,6 +2,7 @@
#include cookies.js
#include copyright.jsx
#include emotes.jsx
#include flashii.js
#include messages.jsx
#include notify.js
#include reconnect.jsx
@ -16,6 +17,9 @@
var AmiContext = function(title, auth, loading) {
var pub = {};
const flashii = new Flashii;
pub.flashii = flashii;
var settings = new AmiSettings;
pub.settings = settings;
@ -187,11 +191,12 @@ var AmiContext = function(title, auth, loading) {
return;
}
futami.getApiJson('/v1/emotes').success(emotes => {
if(Array.isArray(emotes))
emoticons.load(emotes);
chat.emoticonList.render(emoticons);
}).run();
flashii.v1.emotes({ fields: ['url', 'strings', 'min_rank'] })
.success(emotes => {
if(Array.isArray(emotes))
emoticons.load(emotes);
chat.emoticonList.render(emoticons);
}).run();
});
var reconnecter = new AmiReconnecter(chat);