add: token in env var
This commit is contained in:
parent
74024e696a
commit
fceef8197b
@ -54,3 +54,15 @@ int get_article_data(std::string& str, unsigned int& quantity, float& price)
|
||||
|
||||
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