| 1 | pub struct Client { |
| 2 | pub: |
| 3 | token string |
| 4 | intents int |
| 5 | mut: |
| 6 | ready bool |
| 7 | sequence ?int |
| 8 | } |
| 9 | |
| 10 | enum Intents { |
| 11 | foo |
| 12 | } |
| 13 | |
| 14 | pub type IntentsOrInt = Intents | int |
| 15 | |
| 16 | @[params] |
| 17 | pub struct BotConfig { |
| 18 | pub: |
| 19 | intents IntentsOrInt |
| 20 | } |
| 21 | |
| 22 | pub fn bot(token string, config BotConfig) Client { |
| 23 | return Client{ |
| 24 | token: 'Bot ${token}' |
| 25 | intents: match config.intents { |
| 26 | Intents { int(config.intents) } |
| 27 | int { config.intents } |
| 28 | } |
| 29 | } |
| 30 | } |
| 31 | |
| 32 | fn test_main() { |
| 33 | assert true |
| 34 | } |
| 35 |