humanify: Move constant string out of code
							parent
							
								
									41c8173c95
								
							
						
					
					
						commit
						1828615e94
					
				@ -0,0 +1,35 @@
 | 
				
			|||||||
 | 
					package humanify
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import (
 | 
				
			||||||
 | 
						"fmt"
 | 
				
			||||||
 | 
						"io/ioutil"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						"github.com/BurntSushi/toml"
 | 
				
			||||||
 | 
					)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					var Eng Locale
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type Locale struct {
 | 
				
			||||||
 | 
						NoAdmin  string `toml:"no_admin"`
 | 
				
			||||||
 | 
						Usage    localeUsage
 | 
				
			||||||
 | 
						Autorole localeAutorole
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type localeUsage struct {
 | 
				
			||||||
 | 
						Autorole string `toml:"autorole"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					type localeAutorole struct {
 | 
				
			||||||
 | 
						Success string `toml:"success"`
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					func init() {
 | 
				
			||||||
 | 
						data, err := ioutil.ReadFile("locale.toml")
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
						err = toml.Unmarshal(data, &Eng)
 | 
				
			||||||
 | 
						if err != nil {
 | 
				
			||||||
 | 
							panic(err)
 | 
				
			||||||
 | 
						}
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -0,0 +1,7 @@
 | 
				
			|||||||
 | 
					no_admin="❌ You do not have permission to use this command."
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[usage]
 | 
				
			||||||
 | 
					autorole="❌ Incorrect usage. Usage: `milen autorole <role> <channel> <message> <emoji>`"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					[autorole]
 | 
				
			||||||
 | 
					success="✅ Auto-role registered."
 | 
				
			||||||
		Loading…
	
		Reference in New Issue