// NewBot returns new bot
498060
func NewBot(config *Config) *Bot {
	return &Bot{
		userID: config.UserID,
		client: &oauth.Client{
			Credentials: oauth.Credentials{
				Token:  config.ConsumerKey,
				Secret: config.ConsumerSecret,
			},
		},
		credentials: &oauth.Credentials{
			Token:  config.AccessToken,
			Secret: config.AccessTokenSecret,
		},
		idsStore: &idsStore{},
		apiBase:  "https://api.twitter.com/1.1",
	}
}
1040247
func (factory *GitterBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := GitterBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
903141
func (factory *JabberBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := JabberBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
614950
func (s *Service) Bot() *Bot {
	if bot, exists := botPerService[s.Name]; exists {
		return bot
	}
	log.WithField("service", s.Name).Error("Can't get bot for service")
	return nil
}
685499
func NewBotAPI(token string, vtoken string, secret string) *BotAPI {
	return &BotAPI{
		Token:       token,
		AppSecret:   secret,
		VerifyToken: vtoken,
		Debug:       false,
		Client:      &http.Client{},
	}
}
114954
func (factory *TwilioBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := TwilioBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
1372246
func (factory *S3BeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := S3Bee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
1303226
func (s *GetBotVersionsOutput) SetBots(v []*BotMetadata) *GetBotVersionsOutput {
	s.Bots = v
	return s
}
276902
func NewButtonDriver(a ble.BLEConnector) *ButtonDriver {
	n := &ButtonDriver{
		name:       gobot.DefaultName("Microbit Button"),
		connection: a,
		Eventer:    gobot.NewEventer(),
	}

	n.AddEvent(ButtonA)
	n.AddEvent(ButtonB)

	return n
}
966091
func New(token string) (*Bot, error) {
	bot := Bot{
		Token: token,
	}

	return bot.Handshake()
}
643950
func New(robot *hal.Robot) (hal.Adapter, error) {
	c := &config{}
	env.MustProcess(c)

	a := &adapter{
		user:     c.User,
		password: c.Password,
		resource: c.Resource,
		rooms:    func() []string { return strings.Split(c.Rooms, ",") }(),
	}
	a.SetRobot(robot)
	return a, nil
}
312329
func (factory *HTMLExtractBeeFactory) New(name, description string, options bees.BeeOptions) bees.BeeInterface {
	bee := HTMLExtractBee{
		Bee: bees.NewBee(name, factory.ID(), description, options),
	}
	bee.ReloadOptions(options)

	return &bee
}
254827
func Classic(server string, name string) *Bot {
	cfg := Config{
		User: name,
	}
	return New(server, name, cfg)
}
201457
func NewAgent(cfg AgentConfig) (*Agent, error) {
	if err := cfg.CheckAndSetDefaults(); err != nil {
		return nil, trace.Wrap(err)
	}
	ctx, cancel := context.WithCancel(cfg.Context)
	a := &Agent{
		AgentConfig: cfg,
		ctx:         ctx,
		cancel:      cancel,
		authMethods: []ssh.AuthMethod{ssh.PublicKeys(cfg.Signers...)},
	}
	if len(cfg.DiscoverProxies) == 0 {
		a.state = agentStateConnecting
	} else {
		a.state = agentStateDiscovering
	}
	a.Entry = log.WithFields(log.Fields{
		trace.Component: teleport.ComponentReverseTunnelAgent,
		trace.ComponentFields: log.Fields{
			"target": cfg.Addr.String(),
		},
	})
	a.hostKeyCallback = a.checkHostSignature
	return a, nil
}
183848
func (s *DeregisterRobotOutput) SetRobot(v string) *DeregisterRobotOutput {
	s.Robot = &v
	return s
}
588903
func manageBotsAsync(c context.Context) error {
	return trigger(c, &tasks.ManageBot{}, datastore.NewQuery(model.VMKind).Gt("url", ""))
}
616769
func NewMachineAgentCmd(
	ctx *cmd.Context,
	machineAgentFactory machineAgentFactoryFnType,
	agentInitializer AgentInitializer,
	configFetcher AgentConfigWriter,
) cmd.Command {
	return &machineAgentCmd{
		ctx:                 ctx,
		machineAgentFactory: machineAgentFactory,
		agentInitializer:    agentInitializer,
		currentConfig:       configFetcher,
	}
}