Skip to content

Commit

Permalink
feat(listing): fixes PR comments
Browse files Browse the repository at this point in the history
  • Loading branch information
darkpaladi committed Aug 19, 2024
1 parent 24b4017 commit d78a31c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
6 changes: 1 addition & 5 deletions scripts/analyze.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,6 @@ const getContributors = require('./helpers/getContributors')
const isLiquidityValid = require('./helpers/isLiquidityValid')
const getCurrentTokenList = require('./helpers/getCurrentTokenList')

// Deprecated
// const getNewToken = require('./helpers/getNewToken')
// const getNewTokenList = require('./helpers/getNewTokenList')

const getLogoURI = (tokenAddress) =>
`https://raw.githubusercontent.com/voltfinance/swap-default-token-list/master/logos/${tokenAddress}/logo.png`

Expand Down Expand Up @@ -91,7 +87,7 @@ async function analyze() {
}

// Add the new token to the list
fuseTokens.push(view)
fuseTokens.push(newTokenObject)

// Write the updated list back to the file
await fs.writeFile(fuseFilePath, JSON.stringify(fuseTokens, null, 2))
Expand Down
9 changes: 5 additions & 4 deletions scripts/notify-telegram.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ if (!TELEGRAM_BOT_TOKEN || !TELEGRAM_CHAT_ID) {
throw new Error('TELEGRAM_BOT_TOKEN or TELEGRAM_CHAT_ID is not set')
}

async function sendMessage(chatId) {
async function sendMessage() {
if (newToken?.name.length == 0) {
return
}
Expand All @@ -37,17 +37,18 @@ ${newToken.bullishSentence}
`

try {
console.log(text)
const response = await axios.post(url, {
chat_id: chatId,
chat_id: TELEGRAM_CHAT_ID,
photo: newToken.projectImage,
text: text,
parse_mode: 'Markdown',
})

console.log('Message sent:', response.data)
} catch (error) {
if (axios.isAxiosError(error)) {
console.error('Axios error message:', error.message)

if (error.response) {
console.error('Response data:', error.response.data)
console.error('Response status:', error.response.status)
Expand Down Expand Up @@ -84,4 +85,4 @@ ${newToken.bullishSentence}
}
}

sendMessage(TELEGRAM_CHAT_ID)
sendMessage()

0 comments on commit d78a31c

Please sign in to comment.