Skip to content

Commit

Permalink
v1.3.8 - Update code to work with 3 name pokemon
Browse files Browse the repository at this point in the history
  • Loading branch information
kyan0045 authored Jan 9, 2025
1 parent ff2b4e9 commit 4f85854
Showing 1 changed file with 10 additions and 17 deletions.
27 changes: 10 additions & 17 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -435,18 +435,15 @@ async function Login(token, Client, guildId) {
number = footerWords[2].substring(0, footerWords[2].length - 5);

const titleStr = message.embeds[0]?.title;
const titleWords = titleStr.split(" ");
if (titleWords[3]) latestName = titleWords[2] + " " + titleWords[3];
if (!titleWords[3]) latestName = titleWords[2];
latestLevel = titleWords[1];
const latestName = titleStr.match(/\d+\s+(.*)/)[1];
const latestLevel = titleStr.match(/\d+/)[0];
const shiny = titleStr.includes("✨") ? true : false;

link = message.url;
now = new Date();

if (titleWords[0] == "✨" && config.logCatches) {
if (shiny && config.logCatches) {
shinyCount++;
if (titleWords[4]) latestName = titleWords[3] + " " + titleWords[4];
if (!titleWords[4]) latestName = titleWords[3];
latestLevel = titleWords[2];
message.channel.send(
`<@716390085896962058> market search --n ${latestName} --sh --o price`
);
Expand Down Expand Up @@ -860,11 +857,10 @@ async function Login(token, Client, guildId) {
number = footerWords[2].substring(0, footerWords[2].length - 5);

const titleStr = message.embeds[0]?.title;
const titleWords = titleStr.split(" ");
if (titleWords[3]) latestName = titleWords[2] + " " + titleWords[3];
if (!titleWords[3]) latestName = titleWords[2];
latestLevel = titleWords[1];

const latestName = titleStr.match(/\d+\s+(.*)/)[1];
const latestLevel = titleStr.match(/\d+/)[0];
const shiny = titleStr.includes("✨") ? true : false;

if (latestLevel === "100") {
let levelup = fs.readFileSync("./data/levelup.json", "utf-8");
let data = JSON.parse(levelup);
Expand Down Expand Up @@ -922,10 +918,7 @@ async function Login(token, Client, guildId) {
);
}

if (titleWords[0] == "✨") {
if (titleWords[4]) latestName = titleWords[3] + " " + titleWords[4];
if (!titleWords[4]) latestName = titleWords[3];
latestLevel = titleWords[2];
if (shiny) {
if (latestLevel === "100") {
let levelup = fs.readFileSync("./data/levelup.json", "utf-8");
let data = JSON.parse(levelup);
Expand Down

0 comments on commit 4f85854

Please sign in to comment.