add: token in env var
This commit is contained in:
parent
74024e696a
commit
fceef8197b
@ -53,4 +53,16 @@ int get_article_data(std::string& str, unsigned int& quantity, float& price)
|
|||||||
quantity = get_quantity(str);
|
quantity = get_quantity(str);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
std::string get_token(char** av, char** env)
|
||||||
|
{
|
||||||
|
if (av[1] != NULL)
|
||||||
|
return av[1];
|
||||||
|
for (size_t i = 0; env[i] != NULL; ++i)
|
||||||
|
{
|
||||||
|
if (std::strncmp("BOT_TOKEN", env[i], 9) == 0)
|
||||||
|
return env[i] + 10;
|
||||||
|
}
|
||||||
|
return BOT_TOKEN;
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user