Skip to content

Commit

Permalink
don't crash when incorrect permissions discord
Browse files Browse the repository at this point in the history
  • Loading branch information
ethboi committed Jul 30, 2023
1 parent cbb3961 commit 3155235
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
4 changes: 1 addition & 3 deletions app/src/bot.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ import { TrackEvents } from './event/blockEvent'
import { ArbitrageJob, LeaderBoardFillJob, LeaderboardSendJob, OneMinuteJob, StatsJob } from './schedule'
import { SetUpDiscord } from './discord'
import getLyraSDK from './utils/getLyraSDK'
import { GetArbitrageDeals } from './lyra/arbitrage'
import { getLyraRates } from './providers/Lyra'

let discordClientEth: Client
let discordClientBtc: Client
Expand Down Expand Up @@ -81,7 +79,7 @@ function InitVariables() {

export async function runBot(network: Network) {
await RunTradeBot(discordClientLyra, twitterClient, telegramClient, network)
await TrackEvents(discordClientLyra, telegramClient, twitterClient, twitterClient1, network)
//await TrackEvents(discordClientLyra, telegramClient, twitterClient, twitterClient1, network)
}

export async function SetUpTwitter() {
Expand Down
6 changes: 5 additions & 1 deletion app/src/discord/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,11 @@ export async function PostDiscord(
.filter((value) => (value as TextChannel)?.name == channelName)
.map(async (channel) => {
console.log(`found channel: ${channelName}`)
await (channel as TextChannel).send({ embeds: embed, components: rows })
try {
await (channel as TextChannel).send({ embeds: embed, components: rows })
} catch (error) {
console.log(error)
}
})
} catch (e: any) {
console.log(e)
Expand Down

0 comments on commit 3155235

Please sign in to comment.