-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix typos, fetching currency for Telegram-Bot
- Loading branch information
Martin Neubauer
committed
Nov 2, 2022
1 parent
fec29ba
commit 4da58c2
Showing
5 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const fetch = require("node-fetch") | ||
|
||
require('dotenv').config() | ||
|
||
const uri = process.env.BACKEND_URL | ||
|
||
const getcurrency = () => { | ||
let fetchCurrency = fetch(uri + '/api/public/currency').then((res) => | ||
res.json()).then(json => json.map(game => { | ||
|
||
if (game.currency === 'EUR') { | ||
return('€') | ||
} else if (game.currency === 'USD') { | ||
return('$') | ||
} else if (game.currency === 'BTC') { | ||
return('₿') | ||
} else { | ||
return 'failed getting currency' | ||
} | ||
})) | ||
return fetchCurrency | ||
} | ||
|
||
exports.getcurrency = getcurrency |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters