Documentation ¶
Overview ¶
Package discord provides a discord bot to poll NDX contracts
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ExampleConfig is primarily used to provide a template for generating the config file ExampleConfig = &Config{ MainDiscordToken: "CHANGEME-MAIN", InfuraAPIKey: "INFURA-KEY", InfuraWSEnabled: false, ETHRPCEndpoint: "http://localhost:8545", Watchers: []Watcher{ {DiscordToken: "CHANGEME-TOKEN", Currency: "CHANGEME-CURRENCY"}, }, Database: Database{ Type: "sqlite", Host: "localhost", Port: "5432", User: "user", Pass: "pass", DBName: "indexed", DBPath: "/changeme", SSLModeDisable: false, }, } )
Functions ¶
func BaseEmbed ¶
func BaseEmbed() *discordgo.MessageEmbed
BaseEmbed returns a base message embed type to be customized
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps bclient and discordgo to provide a discord bot for indexed finance
type Config ¶
type Config struct { // the token used by the main bot (NDXBot) MainDiscordToken string `yaml:"main_discord_token"` // if nil we dont use infura and connect directly to the rpc node below InfuraAPIKey string `yaml:"infura_api_key"` InfuraWSEnabled bool `yaml:"infura_ws_enabled"` ETHRPCEndpoint string `yaml:"eth_rpc_endpoint"` Watchers []Watcher `yaml:"watchers"` Database Database `yaml:"database"` }
Config bundles together discord configuration information
type Database ¶ added in v0.0.6
type Database struct { Type string `yaml:"type"` // sqlite or postgres, if sqlite all other options except DBName are ignored Host string `yaml:"host"` Port string `yaml:"port"` User string `yaml:"user"` Pass string `yaml:"pass"` DBName string `yaml:"db_name"` DBPath string `yaml:"db_path"` SSLModeDisable bool `yaml:"ssl_mode_disable"` }
Database provides configuration over our database connection
Click to show internal directories.
Click to hide internal directories.