@jeb192004/swgoh-fun
v0.2.8
Published
A small set of tools to share between my website, bot, and guild/player data updater for my bot and website.
Downloads
1
Readme
swgoh-fun
swgoh.fun A small set of tools to share between my website, bot, and guild/player data updater for my bot and website.
const fun = require('@jeb192004/swgoh-fun');
get guild from swgoh.help api(this has been removed. not needed)
var guild = await fun.get_guild(swapi, allycode);
get next allycode form database
var next_allycode = await get_next_allycode(/*mysql conn*/ con, /*guild id*/ id);
get allycodes from guild roster and return allycodes array, guild leader name, and array of members waiting to enter guild.
var { allycodes, leader, pending_members_array } = await fun.get_members_allycodes(jb, guild, webhookPendingPlayer);
split allycodes array into an array of arrays of allycodes. split into chunks of 10. ex. [[10 allycodes],[10 allycodes]]
var chunked_allycodes_array = await fun.chunk_sbr_players(allycodes)
get one or more players form swgoh.help api(this has been removed. not needed)
var player = await get_player_from_api(swapi, allycodes);
save 1 or more players to database
await fun.save_player(players_array, jb, cat_list, '');
save guild info to alliance description
await jb.fun.save_guild_to_alliance(jb, guild, leader).catch((err) => { console.error(err); });
save guild data(from api) to database
await jb.fun.save_guild(jb, guild).catch((err)=>{console.log(err)});