示例#1
0
 public SpotifyControl(SpotifyPluginConfig config, ConfRoot rootConf)
 {
     if (initialized)
     {
         return;
     }
     _spotifyConfig = config;
     if (SpotifyAPIWeb == null)
     {
         var dll = Path.GetFullPath(Path.Combine(rootConf.Plugins.Path.Value, "lib", "SpotifyAPI.Web.dll"));
         SpotifyAPIWeb = Assembly.LoadFrom(dll);
     }
     if (SpotifyAPIAuth == null)
     {
         var dll2 = Path.GetFullPath(Path.Combine(rootConf.Plugins.Path.Value, "lib", "SpotifyAPI.Web.Auth.dll"));
         SpotifyAPIAuth = Assembly.LoadFrom(dll2);
     }
 }
示例#2
0
    public void Initialize()
    {
        this.info("Spotify initialized");
        //Load or create config
        if (botConf.TomlObject.TryGetValue("spotify", out var tempBotSpotifyTomlObject))
        {
            spotifyPluginConfig = tempBotSpotifyTomlObject.Get <SpotifyPluginConfig>();
            this.info("Config loaded");
        }
        else
        {
            spotifyPluginConfig = new SpotifyPluginConfig();
            saveConfig();

            this.info("Config created - Please edit your Bot-Config and reload plugin");
        }
        fullClient.OnEachClientLeftView += StopSpotifyOnLeave;
        PlayManager.ResourceStopped     += playBackBeforeRessourceStop;
    }
示例#3
0
 public SpotifyInstance(SpotifyPluginConfig config, SpotifyAccount account)
 {
     this.config  = config;
     this.account = account;
     resetArgs();
 }