Пример #1
0
        public void VerifyLoginCredentials()
        {
            if (!IsLoginCredentialsValid)
            {
                throw new ArgumentException("Login credentials are not valid!");
            }

            // These should be always lowercase
            BotName = BotName.ToLower();
            Channel = Channel.ToLower();
        }
Пример #2
0
 public ParticipantID(int ID, BotName Name, Team Team, int SpawnNumber, GameObject main, Health health)
 {
     if (this.id <= 0)
     {
         this.id          = ID;
         this.botName     = Name;
         this.team        = Team;
         this.spawnNumber = SpawnNumber;
         this.playerName  = null;
         this.mainObject  = main;
         this.healthStats = health;
     }
 }
Пример #3
0
        string getBotInfo(string token)
        {
            string BaseUrl = "https://api.telegram.org/bot" + token + "/getMe";
            string info    = "";

            using (WebClient cl = new WebClient())
            {
                info = cl.DownloadString(BaseUrl);
            }

            BotName k = JsonConvert.DeserializeObject <BotName>(info);

            return(k.result.username);
        }
 public override void WriteXml(XmlWriter writer)
 {
     writer.WriteAttributeString("BotName", BotName.ToString());
 }