ReadChannels() 정적인 개인적인 메소드

static private ReadChannels ( string condition, string value = "channel" ) : SQLiteDataReader
condition string
value string
리턴 System.Data.SQLite.SQLiteDataReader
예제 #1
0
            internal Handler(ulong client_id, string user, string key)
            {
                // Store credentials
                _user = user;
                _key  = key;
                // Load the chatbots
                var reader = SQL.ReadChannels("chatbot <> -1");

                while (reader.Read())
                {
                    CreateBot(client_id.ToString(), reader["channel"].ToString());
                }
                // Register the handler
                Program.Cmds.NonCommands += e => Task.Run(() => Do(e));
            }
예제 #2
0
파일: Music.cs 프로젝트: Jammyhammy/Nekobot
            internal Task Load(DiscordClient client)
            {
                // Load the entrance gestures
                var reader = SQL.ReadUsers("entrance_gesture<>''", "user,entrance_gesture");

                while (reader.Read())
                {
                    EntranceGestures[Convert.ToUInt64(reader["user"].ToString())] = reader["entrance_gesture"].ToString();
                }

                // Load the stream channels
                var channels = new List <Tuple <Channel, int> >();

                reader = SQL.ReadChannels("music<>0", "channel,music");
                while (reader.Read())
                {
                    channels.Add(Tuple.Create(client.GetChannel(Convert.ToUInt64(reader["channel"].ToString())), int.Parse(reader["music"].ToString())));
                }
                return(Task.WhenAll(
                           channels.Select(s => s.Item1?.Type == ChannelType.Voice ? Task.Run(async() => await AddStream(s.Item1, s.Item2 == 2)) : null)
                           .Where(t => t != null).ToArray()));
            }