예제 #1
0
        private static async Task UpdateChannelInDB(SocketGuildChannel updatedChannel)
        {
            List <(string, string)> queryParams = new List <(string id, string value)>()
            {
                ("@channelID", updatedChannel.Id.ToString()),
                ("@channelName", updatedChannel.Name),
                ("@channelType", updatedChannel.GetType().Name)
            };

            DatabaseActivity.ExecuteNonQueryCommand(
                "UPDATE guilds SET channelName=@channelName, channelType=@channelType WHERE channelID=@channelID",
                queryParams);
        }
예제 #2
0
        public static async Task InsertChannelToDB(SocketGuildChannel c)
        {
            List <(string, string)> queryParams = new List <(string id, string value)>()
            {
                ("@channelName", c.Name),
                ("@channelType", c.GetType().Name)
            };

            DatabaseActivity.ExecuteNonQueryCommand(
                "INSERT IGNORE INTO " +
                "channels(channelID,inGuildID,channelName,channelType) " +
                "VALUES (" + c.Id + ", " + c.Guild.Id + ", @channelName, @channelType);", queryParams);
        }