【发布时间】:2020-05-05 18:39:51
【问题描述】:
我想在我的代码中进行多项选择。 让我解释一下:
有了cheerio,我可以找到一类HTML网页代码的文本
Let elo = $('.statPlayer).text().trim();
//Here elo = "Iron I" Or "Iron II" or "Iron III" or "Iron IV" or "Bronze I" Until "Bronze IV" etc... Until Challenger
现在我想:当 elo 以 Ir 为 Iron 或 Br 为 Bronse 或 Si 为 Silver... 直到 Ch 到 Challenger 时,LOGO 成为相应的值之一下面
const iron = ('<:Iron:702831042112782437>') // it's value of log
const bronze = ('<:Bronze:702831061012578384>');
const silver = ('<:Silver:702831073771388928>');
const gold = ('<:Gold:702831081778577459>');
const plat = ('<:Platine:702831091823673414>');
const diams = ('<:Diamant:702831105752956969>');
const Master = ('<:Master:702831167384191007>');
const GMaster = ('<:GrandMaster:702831178855743618>');
const Chall = ('<:Chall:702831190268313670>');
所以我们会得到:
If `ELO` = Gold II or Gold IV => `LOGO` = `gold`
我不知道这是否可以理解,但我已尽力做到最好。
【问题讨论】:
标签: node.js discord.js