How I can use the on_message function in scope inside the main function?

Please post your errors in a code block like this:

```
// your error goes here
```

You will need to give on_message access to the values. You can do this by passing them as an argument or by making on_message a function on a struct that has the bonzo and frodo variables in a field.