Skip to content

Commit bbb56fc

Browse files
authored
Merge pull request #247 from mkmccarty/handle-change-no-contract-branch
feat: Add handling for no existing contract in boost_change command.
2 parents c0113fa + dcdf70b commit bbb56fc

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

src/boost/boost_change.go

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -204,6 +204,17 @@ func HandleChangeOneBoosterCommand(s *discordgo.Session, i *discordgo.Interactio
204204

205205
var err error
206206
contract := FindContract(i.ChannelID)
207+
if contract == nil {
208+
s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
209+
Type: discordgo.InteractionResponseChannelMessageWithSource,
210+
Data: &discordgo.InteractionResponseData{
211+
Content: errorNoContract,
212+
Flags: discordgo.MessageFlagsEphemeral,
213+
Components: []discordgo.MessageComponent{}},
214+
})
215+
return
216+
}
217+
207218
position := 0
208219
boosterName := ""
209220
newBooster := ""

0 commit comments

Comments
 (0)